Merge pull request #628 from cfromknecht/faster-btcd-init
wallet: speed up bare wallet init when using the btcd backend
This commit is contained in:
commit
4a9774585e
1 changed files with 1 additions and 11 deletions
|
@ -359,17 +359,7 @@ func (w *Wallet) syncWithChain(birthdayStamp *waddrmgr.BlockStamp) error {
|
|||
// arbitrary height, rather than all the blocks from genesis, so
|
||||
// we persist this height to ensure we don't store any blocks
|
||||
// before it.
|
||||
_, bestHeight, err := chainClient.GetBestBlock()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
startHeight := bestHeight - waddrmgr.MaxReorgDepth + 1
|
||||
if startHeight < 0 {
|
||||
startHeight = 0
|
||||
}
|
||||
if birthdayStamp.Height < startHeight {
|
||||
startHeight = birthdayStamp.Height
|
||||
}
|
||||
startHeight := birthdayStamp.Height
|
||||
|
||||
// With the starting height obtained, get the remaining block
|
||||
// details required by the wallet.
|
||||
|
|
Loading…
Reference in a new issue