test: update chainnotifier mock to fwd notifications for matching txs

This commit is contained in:
Andras Banki-Horvath 2020-04-06 10:58:50 +02:00
parent 605d3ac60b
commit 95273c1cf8

View file

@ -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():
}