chainntnfs/btcd+neutrino: close spendChan after send
This commit is contained in:
parent
0d4ee08372
commit
d1e797451d
@ -398,8 +398,12 @@ out:
|
||||
"spend notification for "+
|
||||
"outpoint=%v", ntfn.targetOutpoint)
|
||||
ntfn.spendChan <- spendDetails
|
||||
}
|
||||
|
||||
// Close spendChan to ensure that any calls to Cancel will not
|
||||
// block. This is safe to do since the channel is buffered, and the
|
||||
// message can still be read by the receiver.
|
||||
close(ntfn.spendChan)
|
||||
}
|
||||
delete(b.spendNotifications, prevOut)
|
||||
}
|
||||
}
|
||||
|
@ -398,6 +398,11 @@ func (n *NeutrinoNotifier) notificationDispatcher() {
|
||||
"spend notification for "+
|
||||
"outpoint=%v", ntfn.targetOutpoint)
|
||||
ntfn.spendChan <- spendDetails
|
||||
|
||||
// Close spendChan to ensure that any calls to Cancel will not
|
||||
// block. This is safe to do since the channel is buffered, and the
|
||||
// message can still be read by the receiver.
|
||||
close(ntfn.spendChan)
|
||||
}
|
||||
|
||||
delete(n.spendNotifications, prevOut)
|
||||
|
Loading…
Reference in New Issue
Block a user