mirror of
https://github.com/lightninglabs/loop.git
synced 2026-08-13 12:33:03 +02:00
Merge pull request #174 from bhandras/mock_update
test: update chainnotifier mock to fwd notifications for matching txs
This commit is contained in:
commit
8301abdb4c
1 changed files with 6 additions and 3 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
package test
|
package test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"bytes"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
|
@ -111,9 +112,11 @@ func (c *mockChainNotifier) RegisterConfirmationsNtfn(ctx context.Context,
|
||||||
|
|
||||||
select {
|
select {
|
||||||
case m := <-c.lnd.ConfChannel:
|
case m := <-c.lnd.ConfChannel:
|
||||||
select {
|
if bytes.Equal(m.Tx.TxOut[0].PkScript, pkScript) {
|
||||||
case confChan <- m:
|
select {
|
||||||
case <-ctx.Done():
|
case confChan <- m:
|
||||||
|
case <-ctx.Done():
|
||||||
|
}
|
||||||
}
|
}
|
||||||
case <-ctx.Done():
|
case <-ctx.Done():
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue