From 95273c1cf8ff4d280a77f53f11aa88fd0a126536 Mon Sep 17 00:00:00 2001 From: Andras Banki-Horvath Date: Mon, 6 Apr 2020 10:58:50 +0200 Subject: [PATCH] test: update chainnotifier mock to fwd notifications for matching txs --- test/chainnotifier_mock.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/test/chainnotifier_mock.go b/test/chainnotifier_mock.go index 375de38..bedd766 100644 --- a/test/chainnotifier_mock.go +++ b/test/chainnotifier_mock.go @@ -1,6 +1,7 @@ package test import ( + "bytes" "sync" "time" @@ -111,9 +112,11 @@ func (c *mockChainNotifier) RegisterConfirmationsNtfn(ctx context.Context, select { case m := <-c.lnd.ConfChannel: - select { - case confChan <- m: - case <-ctx.Done(): + if bytes.Equal(m.Tx.TxOut[0].PkScript, pkScript) { + select { + case confChan <- m: + case <-ctx.Done(): + } } case <-ctx.Done(): }