aboutsummaryrefslogtreecommitdiff
path: root/src/policy
diff options
context:
space:
mode:
authorAva Chow <github@achow101.com>2024-09-30 17:01:05 -0400
committerAva Chow <github@achow101.com>2024-09-30 17:01:05 -0400
commitd7f956a309e36a18da6765d6ea852f557e6dc87b (patch)
tree634615e007c50bfcfea1a469f0da548d611d4a01 /src/policy
parentc33eb2360e2482eee94b55aef3b8ab2eeff1576e (diff)
parente9d60af9889c12b4d427adefa53fd234e417f8f6 (diff)
Merge bitcoin/bitcoin#30968: init: Remove retry for loop
e9d60af9889c12b4d427adefa53fd234e417f8f6 refactor: Replace init retry for loop with if statement (TheCharlatan) c1d8870ea4155c2766d30d38fc5b1afc63dcd364 refactor: Move most of init retry for loop to a function (TheCharlatan) 781c01f58066d375c14b1a717160f51c2f2ebe20 init: Check mempool arguments in AppInitParameterInteractions (TheCharlatan) Pull request description: The for loop around the chain loading logic in `init.cpp` allows users of the GUI to retry once on failure with reindexing without having to manually set the reindex flag on startup. However this current mechanism has problems: * It is badly documented and has led to confusion among developers and bugs making it into master. Examples: * https://github.com/bitcoin/bitcoin/pull/28830/files#r1598392660 * https://github.com/bitcoin/bitcoin/pull/30132#issuecomment-2120741121 * It can only ever iterate once, making the choice of a for loop questionable. * With its large scope it is easy for re-entry bugs to sneak in. Example: * https://github.com/bitcoin/bitcoin/pull/28830#discussion_r1601589963 Attempt to fix this by moving the bulk of the logic into a separate function and replacing the for loop with a simpler `if` statement. The diff's in this pull request are best reviewed with `--color-moved-ws=ignore-all-space --color-moved=dimmed-zebra`. The error behaviour can be tested by either manually making `LoadChainstate` return a failure, or deleting some of the block index database files. ACKs for top commit: maflcko: review ACK e9d60af9889c12b4d427adefa53fd234e417f8f6 🚸 josibake: crACK https://github.com/bitcoin/bitcoin/commit/e9d60af9889c12b4d427adefa53fd234e417f8f6 achow101: ACK e9d60af9889c12b4d427adefa53fd234e417f8f6 ryanofsky: Code review ACK e9d60af9889c12b4d427adefa53fd234e417f8f6. Nice change to make AppInitMain shorter and more understandable. Tree-SHA512: 5e5c0a5fd1b32225346450f8482f0ae8792e1557cdab1518112c1a3ec3a4400b64f5796692245cc5bf2f9010bb97b3a9558f07626a285ccd6ae525dd671ead13
Diffstat (limited to 'src/policy')
0 files changed, 0 insertions, 0 deletions