From 2665836fa321977130173534faebdf42ecb731e0 Mon Sep 17 00:00:00 2001 From: "Johan T. Halseth" Date: Wed, 16 Sep 2020 10:46:12 +0200 Subject: [PATCH] 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. --- chainntnfs/txnotifier.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/chainntnfs/txnotifier.go b/chainntnfs/txnotifier.go index 0a8c745d..2e527cfa 100644 --- a/chainntnfs/txnotifier.go +++ b/chainntnfs/txnotifier.go @@ -763,9 +763,7 @@ func (n *TxNotifier) CancelConf(confRequest ConfRequest, confID uint64) { if confSet.details != nil { confHeight := confSet.details.BlockHeight + ntfn.NumConfirmations - 1 - if confHeight <= n.currentHeight { - delete(n.ntfnsByConfirmHeight[confHeight], ntfn) - } + delete(n.ntfnsByConfirmHeight[confHeight], ntfn) } }