-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix reorg race condition that can cause rare crashes
Fixes issue 408. This bug was introduced by PR 393, which changed how txids are determined. That PR changed each call to the zcash getblock call into a pair of calls, the first to get the raw block data, the second to retrieve the txids in the block. (Unfortunately, you can't get both in a single getblock RPC.) But this ordering introduced a timing window in which the block at the given height can change, if a reorg occurred between the two calls. This PR reorders the getblock calls, so that the first call gets the transaction IDs, which also happens to return the block hash, so then the second getblock call can specify the block hash, rather than the height. This ensures that the two RPC calls return consistent data, definitely the same block.
- Loading branch information
Larry Ruane
committed
Aug 23, 2022
1 parent
2d3943b
commit 1a556c3
Showing
3 changed files
with
144 additions
and
212 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.