Skip to content

Commit 95273c1

Browse files
committed
test: update chainnotifier mock to fwd notifications for matching txs
1 parent 605d3ac commit 95273c1

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

test/chainnotifier_mock.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package test
22

33
import (
4+
"bytes"
45
"sync"
56
"time"
67

@@ -111,9 +112,11 @@ func (c *mockChainNotifier) RegisterConfirmationsNtfn(ctx context.Context,
111112

112113
select {
113114
case m := <-c.lnd.ConfChannel:
114-
select {
115-
case confChan <- m:
116-
case <-ctx.Done():
115+
if bytes.Equal(m.Tx.TxOut[0].PkScript, pkScript) {
116+
select {
117+
case confChan <- m:
118+
case <-ctx.Done():
119+
}
117120
}
118121
case <-ctx.Done():
119122
}

0 commit comments

Comments
 (0)