rpcperms+lnd: gate RPC calls on RPC state
This commit makes us gate the calls to the RPC servers according to the current RPC state. This ensures we won't try to call the RPC server before it has been fully initialized, and that we won't call the walletUnlocker after the wallet already has been unlocked.
This commit is contained in:
3 files changed
+204
-28
No files matched your search
+6
-2
@@ -300,8 +300,12 @@ func (n *NetworkHarness) NewNodeWithSeed(name string, extraArgs []string,
|
||||
|
||||
ctxt, cancel := context.WithTimeout(ctxb, DefaultTimeout)
|
||||
defer cancel()
|
||||
genSeedResp, err := node.GenSeed(ctxt, genSeedReq)
|
||||
if err != nil {
|
||||
|
||||
var genSeedResp *lnrpc.GenSeedResponse
|
||||
if err := wait.NoError(func() error {
|
||||
genSeedResp, err = node.GenSeed(ctxt, genSeedReq)
|
||||
return err
|
||||
}, DefaultTimeout); err != nil {
|
||||
return nil, nil, nil, err
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user