forked from PIVX-Project/PIVX
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge PIVX-Project#2223: [BUG] Fix some chainstate-init-order bugs
4749d52 [Refactoring][BUG] Unchecked LoadGenesisBlock return value (random-zebra) 43cc880 Fix segfault when shutting down before fully loading (Matt Corallo) 5f1f014 Order chainstate init more logically. (random-zebra) 9b87537 More user-friendly error message if UTXO DB runs ahead of block DB (Matt Corallo) 9bcc942 Fix some LoadChainTip-related init-order bugs. (random-zebra) Pull request description: Had this segfault when trying to shut down the wallet before the coins cache is loaded. ``` CCoinsViewCache::DynamicMemoryUsage (this=0x0) at coins.cpp:60 60 return memusage::DynamicUsage(cacheCoins) + (gdb) bt #0 0x0000555555bb8b44 in CCoinsViewCache::DynamicMemoryUsage() const (this=0x0) at coins.cpp:60 #1 0x0000555555996bc1 in FlushStateToDisk(CValidationState&, FlushStateMode) (state=..., mode=mode@entry=FLUSH_STATE_ALWAYS) at validation.cpp:1730 PIVX-Project#2 0x0000555555997540 in FlushStateToDisk() () at validation.cpp:1806 PIVX-Project#3 0x000055555582516c in PrepareShutdown() () at init.cpp:266 PIVX-Project#4 0x0000555555826005 in Shutdown() () at init.cpp:339 ``` This is due to a bug introduced in 64c525b (we should null-check `pcoinsTip` before calling `FlushStateToDisk` at line 266, same as we do at line 283). Upstream fixed it in bitcoin#10758 among few other things. Backported here without ff3a219 (as we don't have `RewindBlockIndex` or `reindex-chainstate` yet). ACKs for top commit: Fuzzbawls: ACK 4749d52 furszy: ACK 4749d52 and merging.. Tree-SHA512: 23f27c4a9422a72794054698313259f89ad22a58dba2809901653e08c964c73e4eaeab872ada42380e76eb46ddd7e57f08b65f22812c791d0c2b274e5f0202a7
- Loading branch information
Showing
4 changed files
with
112 additions
and
56 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
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
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
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