lnwallet/btcwallet: check wallet rescan is complete within IsSynced
In this commit, we add an additional check to btcwallet's IsSynced method to ensure that it is not currently undergoing a rescan. We do this to block upon starting the server and all other dependent subsystems until the rescan is complete.
This commit is contained in:
parent
b1860a95e0
commit
9ca9802d9c
@ -714,6 +714,11 @@ func (b *BtcWallet) SubscribeTransactions() (lnwallet.TransactionSubscription, e
|
||||
//
|
||||
// This is a part of the WalletController interface.
|
||||
func (b *BtcWallet) IsSynced() (bool, int64, error) {
|
||||
// First, we'll ensure the wallet is not currently undergoing a rescan.
|
||||
if !b.wallet.ChainSynced() {
|
||||
return false, 0, nil
|
||||
}
|
||||
|
||||
// Grab the best chain state the wallet is currently aware of.
|
||||
syncState := b.wallet.Manager.SyncedTo()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user