test: properly mark txid's as seen within the networkWatcher
This commit is contained in:
parent
668063f61d
commit
d23bf8b633
@ -470,6 +470,11 @@ func (n *networkHarness) networkWatcher() {
|
|||||||
clients[req.txid] = append(clients[req.txid], req.eventChan)
|
clients[req.txid] = append(clients[req.txid], req.eventChan)
|
||||||
}
|
}
|
||||||
case txid := <-n.seenTxns:
|
case txid := <-n.seenTxns:
|
||||||
|
// Add this txid to our set of "seen" transactions. So
|
||||||
|
// we're able to dispatch any notifications for this
|
||||||
|
// txid which arrive *after* it's seen within the
|
||||||
|
// network.
|
||||||
|
seenTxns[txid] = struct{}{}
|
||||||
|
|
||||||
// If there isn't a registered notification for this
|
// If there isn't a registered notification for this
|
||||||
// transaction then ignore it.
|
// transaction then ignore it.
|
||||||
@ -578,7 +583,10 @@ func (n *networkHarness) CloseChannel(ctx context.Context,
|
|||||||
if !ok {
|
if !ok {
|
||||||
return nil, fmt.Errorf("expected close pending update, got %v", pendingClose)
|
return nil, fmt.Errorf("expected close pending update, got %v", pendingClose)
|
||||||
}
|
}
|
||||||
closeTxid, _ := wire.NewShaHash(pendingClose.ClosePending.Txid)
|
closeTxid, err := wire.NewShaHash(pendingClose.ClosePending.Txid)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
n.WaitForTxBroadcast(*closeTxid)
|
n.WaitForTxBroadcast(*closeTxid)
|
||||||
|
|
||||||
return closeRespStream, nil
|
return closeRespStream, nil
|
||||||
|
Loading…
Reference in New Issue
Block a user