txnotifier test: use Cancel() directly

This commit is contained in:
Johan T. Halseth 2020-09-16 10:42:09 +02:00
parent 9dcb522ebc
commit 3a12b5867f
No known key found for this signature in database
GPG Key ID: 15BAADA29DA20D26

View File

@ -1159,7 +1159,6 @@ func TestTxNotifierCancelConf(t *testing.T) {
if err != nil {
t.Fatalf("unable to register spend ntfn: %v", err)
}
cancelConfRequest := ntfn2.HistoricalDispatch.ConfRequest
// Extend the chain with a block that will confirm both transactions.
// This will queue confirmation notifications to dispatch once their
@ -1175,7 +1174,7 @@ func TestTxNotifierCancelConf(t *testing.T) {
}
// Cancel the second notification before connecting the block.
n.CancelConf(cancelConfRequest, 2)
ntfn2.Event.Cancel()
err = n.ConnectTip(block.Hash(), startingHeight+1, block.Transactions())
if err != nil {
@ -1184,7 +1183,7 @@ func TestTxNotifierCancelConf(t *testing.T) {
// Cancel the third notification before notifying to ensure its queued
// confirmation notification gets removed as well.
n.CancelConf(cancelConfRequest, 3)
ntfn3.Event.Cancel()
if err := n.NotifyHeight(startingHeight + 1); err != nil {
t.Fatalf("unable to dispatch notifications: %v", err)