lntest/node: call FetchNode info in wait.NoError after init
In case we call it before the RPC server is fully active.
This commit is contained in:
parent
4bbf5c4b6d
commit
5e9e03858d
@ -801,8 +801,9 @@ func (hn *HarnessNode) initLightningClient(conn *grpc.ClientConn) error {
|
|||||||
hn.SignerClient = signrpc.NewSignerClient(conn)
|
hn.SignerClient = signrpc.NewSignerClient(conn)
|
||||||
|
|
||||||
// Set the harness node's pubkey to what the node claims in GetInfo.
|
// Set the harness node's pubkey to what the node claims in GetInfo.
|
||||||
err := hn.FetchNodeInfo()
|
// Since the RPC might not be immediately active, we wrap the call in a
|
||||||
if err != nil {
|
// wait.NoError.
|
||||||
|
if err := wait.NoError(hn.FetchNodeInfo, DefaultTimeout); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -812,7 +813,7 @@ func (hn *HarnessNode) initLightningClient(conn *grpc.ClientConn) error {
|
|||||||
// until then, we'll create a dummy subscription to ensure we can do so
|
// until then, we'll create a dummy subscription to ensure we can do so
|
||||||
// successfully before proceeding. We use a dummy subscription in order
|
// successfully before proceeding. We use a dummy subscription in order
|
||||||
// to not consume an update from the real one.
|
// to not consume an update from the real one.
|
||||||
err = wait.NoError(func() error {
|
err := wait.NoError(func() error {
|
||||||
req := &lnrpc.GraphTopologySubscription{}
|
req := &lnrpc.GraphTopologySubscription{}
|
||||||
ctx, cancelFunc := context.WithCancel(context.Background())
|
ctx, cancelFunc := context.WithCancel(context.Background())
|
||||||
topologyClient, err := hn.SubscribeChannelGraph(ctx, req)
|
topologyClient, err := hn.SubscribeChannelGraph(ctx, req)
|
||||||
|
Loading…
Reference in New Issue
Block a user