mirror of
https://github.com/LBRYFoundation/lbcwallet.git
synced 2025-08-28 07:51:26 +00:00
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
|
// arbitrary height, rather than all the blocks from genesis, so
|
||||||
// we persist this height to ensure we don't store any blocks
|
// we persist this height to ensure we don't store any blocks
|
||||||
// before it.
|
// before it.
|
||||||
_, bestHeight, err := chainClient.GetBestBlock()
|
startHeight := birthdayStamp.Height
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
startHeight := bestHeight - waddrmgr.MaxReorgDepth + 1
|
|
||||||
if startHeight < 0 {
|
|
||||||
startHeight = 0
|
|
||||||
}
|
|
||||||
if birthdayStamp.Height < startHeight {
|
|
||||||
startHeight = birthdayStamp.Height
|
|
||||||
}
|
|
||||||
|
|
||||||
// With the starting height obtained, get the remaining block
|
// With the starting height obtained, get the remaining block
|
||||||
// details required by the wallet.
|
// details required by the wallet.
|
||||||
|
|
Loading…
Add table
Reference in a new issue