txnotifier: delete ntfn by confirm height always
When we cancel a confirmation request, we should remove the request from the height map regardless of the current height. Otherwise we end up in the situation when the height is reached, the notification is attempted sent which results in a crash.
This commit is contained in:
parent
3a12b5867f
commit
2665836fa3
@ -763,11 +763,9 @@ func (n *TxNotifier) CancelConf(confRequest ConfRequest, confID uint64) {
|
|||||||
if confSet.details != nil {
|
if confSet.details != nil {
|
||||||
confHeight := confSet.details.BlockHeight +
|
confHeight := confSet.details.BlockHeight +
|
||||||
ntfn.NumConfirmations - 1
|
ntfn.NumConfirmations - 1
|
||||||
if confHeight <= n.currentHeight {
|
|
||||||
delete(n.ntfnsByConfirmHeight[confHeight], ntfn)
|
delete(n.ntfnsByConfirmHeight[confHeight], ntfn)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// UpdateConfDetails attempts to update the confirmation details for an active
|
// UpdateConfDetails attempts to update the confirmation details for an active
|
||||||
// notification within the notifier. This should only be used in the case of a
|
// notification within the notifier. This should only be used in the case of a
|
||||||
|
Loading…
Reference in New Issue
Block a user