sweep: delete pending inputs based on their states

This commit uniforms and put the deletion of pending inputs in a single
point.
This commit is contained in:
yyforyongyu committed 2024-04-19 21:33:22 +08:00
1 parent 47478718d4
commit a263d68fb9
3 files changed
+191 -29

No files matched your search

+4
View File
@@ -99,6 +99,8 @@ func (m *MockNotifier) sendSpend(channel chan *chainntnfs.SpendDetail,
outpoint *wire.OutPoint,
spendingTx *wire.MsgTx) {
log.Debugf("Notifying spend of outpoint %v", outpoint)
spenderTxHash := spendingTx.TxHash()
channel <- &chainntnfs.SpendDetail{
SpenderTxHash: &spenderTxHash,
@@ -188,6 +190,8 @@ func (m *MockNotifier) Stop() error {
func (m *MockNotifier) RegisterSpendNtfn(outpoint *wire.OutPoint,
_ []byte, heightHint uint32) (*chainntnfs.SpendEvent, error) {
log.Debugf("RegisterSpendNtfn for outpoint %v", outpoint)
// Add channel to global spend ntfn map.
m.mutex.Lock()