mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-11-20 02:56:47 +01:00
lnwallet: turn off RBF detection in test
This commit is contained in:
@@ -1758,7 +1758,10 @@ func testPublishTransaction(r *rpctest.Harness,
|
||||
tx3, tx3Spend *wire.MsgTx
|
||||
)
|
||||
t.Run("rbf_tests", func(t *testing.T) {
|
||||
for _, rbf := range []bool{false, true} {
|
||||
// Starting with bitcoind v28.0 and later, mempool full RBF is
|
||||
// turned on, so there's no way to _not_ signal RBF anymore.
|
||||
const rbf = true
|
||||
|
||||
// Now we'll try to double spend an output with a
|
||||
// different transaction. Create a new tx and publish
|
||||
// it. This is the output we'll try to double spend.
|
||||
@@ -1807,15 +1810,9 @@ func testPublishTransaction(r *rpctest.Harness,
|
||||
|
||||
err = alice.PublishTransaction(tx5, labels.External)
|
||||
|
||||
// If RBF is not enabled, we expect this to be rejected
|
||||
// because it is a double spend.
|
||||
expectedErr := lnwallet.ErrDoubleSpend
|
||||
|
||||
// If RBF is enabled, we expect it to be rejected
|
||||
// because it doesn't pay enough fees.
|
||||
if rbf {
|
||||
expectedErr = chain.ErrInsufficientFee
|
||||
}
|
||||
// We expect it to be rejected/ because it doesn't pay enough
|
||||
// fees.
|
||||
expectedErr := chain.ErrInsufficientFee
|
||||
|
||||
// Assert the expected error.
|
||||
require.ErrorIsf(t, err, expectedErr, "has rbf=%v", rbf)
|
||||
@@ -1836,19 +1833,13 @@ func testPublishTransaction(r *rpctest.Harness,
|
||||
require.NoError(t, err)
|
||||
|
||||
// Expect rejection in non-RBF case.
|
||||
expErr := lnwallet.ErrDoubleSpend
|
||||
if rbf {
|
||||
// Expect success in rbf case.
|
||||
expErr = nil
|
||||
tx3Spend = tx6
|
||||
}
|
||||
err = alice.PublishTransaction(tx6, labels.External)
|
||||
require.ErrorIs(t, err, expErr)
|
||||
require.NoError(t, err)
|
||||
|
||||
// Mine the tx spending tx3.
|
||||
err = mineAndAssert(r, tx3Spend)
|
||||
require.NoError(t, err)
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("tx_double_spend", func(t *testing.T) {
|
||||
@@ -3071,9 +3062,9 @@ func testSingleFunderExternalFundingTx(miner *rpctest.Harness,
|
||||
)
|
||||
}
|
||||
|
||||
// TestInterfaces tests all registered interfaces with a unified set of tests
|
||||
// which exercise each of the required methods found within the WalletController
|
||||
// interface.
|
||||
// TestLightningWallet tests all registered interfaces with a unified set of
|
||||
// tests which exercise each of the required methods found within the
|
||||
// WalletController interface.
|
||||
//
|
||||
// NOTE: In the future, when additional implementations of the WalletController
|
||||
// interface have been implemented, in order to ensure the new concrete
|
||||
|
||||
Reference in New Issue
Block a user