Merge pull request #4703 from wpaulino/is-synced-timestamp-inconsistency
btcwallet: return chain best timestamp while backend is syncing
This commit is contained in:
commit
fbb430ad82
@ -875,9 +875,19 @@ func (b *BtcWallet) IsSynced() (bool, int64, error) {
|
|||||||
return false, 0, err
|
return false, 0, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Make sure the backing chain has been considered synced first.
|
||||||
|
if !b.wallet.ChainSynced() {
|
||||||
|
bestHeader, err := b.cfg.ChainSource.GetBlockHeader(bestHash)
|
||||||
|
if err != nil {
|
||||||
|
return false, 0, err
|
||||||
|
}
|
||||||
|
bestTimestamp = bestHeader.Timestamp.Unix()
|
||||||
|
return false, bestTimestamp, nil
|
||||||
|
}
|
||||||
|
|
||||||
// If the wallet hasn't yet fully synced to the node's best chain tip,
|
// If the wallet hasn't yet fully synced to the node's best chain tip,
|
||||||
// then we're not yet fully synced.
|
// then we're not yet fully synced.
|
||||||
if syncState.Height < bestHeight || !b.wallet.ChainSynced() {
|
if syncState.Height < bestHeight {
|
||||||
return false, bestTimestamp, nil
|
return false, bestTimestamp, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user