test: properly mark txid's as seen within the networkWatcher

This commit is contained in:
Olaoluwa Osuntokun 2016-09-13 18:56:35 -07:00
parent 668063f61d
commit d23bf8b633
No known key found for this signature in database
GPG Key ID: 9CC5B105D03521A2

@ -470,6 +470,11 @@ func (n *networkHarness) networkWatcher() {
clients[req.txid] = append(clients[req.txid], req.eventChan)
}
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
// transaction then ignore it.
@ -578,7 +583,10 @@ func (n *networkHarness) CloseChannel(ctx context.Context,
if !ok {
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)
return closeRespStream, nil