Fix race condition after reorg #29
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
mining
question
rpc
ux
wallet
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: LBRYCommunity/lbcwallet#29
Loading…
Reference in a new issue
No description provided.
Delete branch "roylee/fix-race-condition-after-reorg"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fix #28
This PR solves to issues:
The rollback code, which handles disconnected blocks, did not save the hash to the
w.manager.SyncedTo
status. Seems like a bug caused by a typo -b.hash vs bs.Hash
Handle corner cases where the chain has reorged to a lower height than the wallet had synced to.
This could happen if the chain has reorged to a shorter chain with difficulty greater than the current main chain.
The wallet won't be able to sync before the reorged chain grows past the previous main chain's height.