funding: ensure we fail funding flow if unable to query wallet

This commit is contained in:
Johan T. Halseth 2018-02-19 18:32:04 +01:00
parent 00ea46d9ae
commit ff1dc2bbd4
No known key found for this signature in database
GPG Key ID: 15BAADA29DA20D26
1 changed files with 4 additions and 5 deletions

View File

@ -824,11 +824,10 @@ func (f *fundingManager) handleFundingOpen(fmsg *fundingOpenMsg) {
// synced to the network as we won't be able to properly validate the
// confirmation of the funding transaction.
isSynced, _, err := f.cfg.Wallet.IsSynced()
if err != nil {
fndgLog.Errorf("unable to query wallet: %v", err)
return
}
if !isSynced {
if err != nil || !isSynced {
if err != nil {
fndgLog.Errorf("unable to query wallet: %v", err)
}
f.failFundingFlow(
fmsg.peerAddress.IdentityKey, fmsg.msg.PendingChannelID,
lnwire.ErrorData{byte(lnwire.ErrSynchronizingChain)},