Merge pull request #591 from halseth/not-is-current-at-0

wallet/wallet: assume not current if best height is 0
This commit is contained in:
Olaoluwa Osuntokun 2019-02-12 19:46:19 -08:00 committed by GitHub
commit b51c1adeee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -471,6 +471,12 @@ func (w *Wallet) scanChain(startHeight int32,
Checkpoints[len(w.chainParams.Checkpoints)-1].Height
}
isCurrent := func(bestHeight int32) bool {
// If the best height is zero, we assume the chain backend
// still is looking for peers to sync to.
if bestHeight == 0 {
return false
}
switch c := chainClient.(type) {
case *chain.NeutrinoClient:
return c.CS.IsCurrent()