lntest: ensure we always cancel active streaming notifications
This commit is contained in:
parent
92029370ec
commit
dbf7e4525a
@ -47,6 +47,12 @@ var (
|
|||||||
number: 1,
|
number: 1,
|
||||||
migration: migrateNodeAndEdgeUpdateIndex,
|
migration: migrateNodeAndEdgeUpdateIndex,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
// The DB version that added the invoice event time
|
||||||
|
// series.
|
||||||
|
number: 2,
|
||||||
|
migration: migrateInvoiceTimeSeries,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
// Big endian is the preferred byte order, due to cursor scans over
|
// Big endian is the preferred byte order, due to cursor scans over
|
||||||
|
@ -177,7 +177,7 @@ func deserializeOutgoingPayment(r io.Reader) (*OutgoingPayment, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
p.Invoice = *inv
|
p.Invoice = inv
|
||||||
|
|
||||||
if _, err := r.Read(scratch[:]); err != nil {
|
if _, err := r.Read(scratch[:]); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
@ -639,9 +639,9 @@ func (hn *HarnessNode) lightningNetworkWatcher() {
|
|||||||
go func() {
|
go func() {
|
||||||
defer hn.wg.Done()
|
defer hn.wg.Done()
|
||||||
|
|
||||||
ctxb := context.Background()
|
|
||||||
req := &lnrpc.GraphTopologySubscription{}
|
req := &lnrpc.GraphTopologySubscription{}
|
||||||
topologyClient, err := hn.SubscribeChannelGraph(ctxb, req)
|
ctx, cancelFunc := context.WithCancel(context.Background())
|
||||||
|
topologyClient, err := hn.SubscribeChannelGraph(ctx, req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// We panic here in case of an error as failure to
|
// We panic here in case of an error as failure to
|
||||||
// create the topology client will cause all subsequent
|
// create the topology client will cause all subsequent
|
||||||
@ -650,6 +650,8 @@ func (hn *HarnessNode) lightningNetworkWatcher() {
|
|||||||
"client: %v", err))
|
"client: %v", err))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
defer cancelFunc()
|
||||||
|
|
||||||
for {
|
for {
|
||||||
update, err := topologyClient.Recv()
|
update, err := topologyClient.Recv()
|
||||||
if err == io.EOF {
|
if err == io.EOF {
|
||||||
|
Loading…
Reference in New Issue
Block a user