sweep: catch third party spent in fee bumper for neutrino

This commit adds a new check for neutrino backend - when the inputs in
the sweeping tx are spent by a third party, we will send back a
`TxFailed` event to free the rest of the inputs for re-grouping.
This commit is contained in:
yyforyongyu committed 2024-04-19 21:33:37 +08:00
1 parent 563a5caed5
commit 19a599a1a9
4 files changed
+141

No files matched your search

+12
View File
@@ -45,6 +45,10 @@ func newMockBackend(t *testing.T, notifier *MockNotifier) *mockBackend {
}
}
func (b *mockBackend) BackEnd() string {
return "mockbackend"
}
func (b *mockBackend) CheckMempoolAcceptance(tx *wire.MsgTx) error {
return nil
}
@@ -357,6 +361,14 @@ type MockWallet struct {
// Compile-time constraint to ensure MockWallet implements Wallet.
var _ Wallet = (*MockWallet)(nil)
// BackEnd returns a name for the wallet's backing chain service, which could
// be e.g. btcd, bitcoind, neutrino, or another consensus service.
func (m *MockWallet) BackEnd() string {
args := m.Called()
return args.String(0)
}
// CheckMempoolAcceptance checks if the transaction can be accepted to the
// mempool.
func (m *MockWallet) CheckMempoolAcceptance(tx *wire.MsgTx) error {