aboutsummaryrefslogtreecommitdiff
path: root/src/node
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2022-01-06 13:55:47 +0100
committerMarcoFalke <falke.marco@gmail.com>2022-01-06 13:55:53 +0100
commit3917dff732b48e1b994dc199f91d11e9074e449f (patch)
tree08487dcd9e2ee2860786464778734752d8c2f263 /src/node
parent06209574da794e949ed2515516326cf38d89d43e (diff)
parente3544c864e3e56867de25b8db7b012d58b378050 (diff)
downloadbitcoin-3917dff732b48e1b994dc199f91d11e9074e449f.tar.xz
Merge bitcoin/bitcoin#23855: refactor: Post-"Chainstate loading sequence coalescence" fixups
e3544c864e3e56867de25b8db7b012d58b378050 init: Use clang-tidy named args syntax (Carl Dong) 3401630417d994b53ff3a89db2ea759ab1ec6f0f style-only: Rename *Chainstate return values (Carl Dong) 1dd582782d3c182aa952f23ec577f6a0a8672e7b docs: Make LoadChainstate comment more accurate (Carl Dong) 6b83576388e205116a0ebc67b9949f309eea1207 node/chainstate: Use MAX_FUTURE_BLOCK_TIME (Carl Dong) Pull request description: There are 2 proposed fixups in discussions in #23280 which I have not implemented: 1. An overhaul to return types and an option type for the two `*Chainstate` functions: https://github.com/bitcoin/bitcoin/pull/23280#issuecomment-984149564 - The change reintroduces stringy return types and is quite involved. It could be discussed in a separate PR. 2. Passing in the unix time to `VerifyChainstate` instead of a callback to get the time: https://github.com/bitcoin/bitcoin/pull/23280#discussion_r765051533 - I'm not sure it matters much whether it's a callback or just the actual unix time. Also, I think `VerifyDB` can take quite a while, and I don't want to impose that the function have to "run quickly" in order to have it be correct. If reviewers feel strongly about either of the two fixups listed above, please feel free to open a PR based on mine and I'll close this one! ACKs for top commit: ryanofsky: Code review ACK e3544c864e3e56867de25b8db7b012d58b378050 MarcoFalke: ACK e3544c864e3e56867de25b8db7b012d58b378050 🐸 Tree-SHA512: dd1de0265b6785eef306e724b678ce03d7c54ea9f4b5ea0ccd7af59cce2ea3aba73fd4af0c15e2dca9265807dc4075f9afa2ec103672677b6638b1a4fc090904
Diffstat (limited to 'src/node')
-rw-r--r--src/node/chainstate.cpp2
-rw-r--r--src/node/chainstate.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/node/chainstate.cpp b/src/node/chainstate.cpp
index abeebad1a6..0274587e17 100644
--- a/src/node/chainstate.cpp
+++ b/src/node/chainstate.cpp
@@ -141,7 +141,7 @@ std::optional<ChainstateLoadVerifyError> VerifyLoadedChainstate(ChainstateManage
for (CChainState* chainstate : chainman.GetAll()) {
if (!is_coinsview_empty(chainstate)) {
const CBlockIndex* tip = chainstate->m_chain.Tip();
- if (tip && tip->nTime > get_unix_time_seconds() + 2 * 60 * 60) {
+ if (tip && tip->nTime > get_unix_time_seconds() + MAX_FUTURE_BLOCK_TIME) {
return ChainstateLoadVerifyError::ERROR_BLOCK_FROM_FUTURE;
}
diff --git a/src/node/chainstate.h b/src/node/chainstate.h
index 11278a0991..4df917a281 100644
--- a/src/node/chainstate.h
+++ b/src/node/chainstate.h
@@ -50,7 +50,7 @@ enum class ChainstateLoadingError {
* this sequence, when we explicitly checked shutdown_requested() at
* arbitrary points, one of those calls returned true". Therefore, a
* return value other than SHUTDOWN_PROBED does not guarantee that
- * shutdown_requested() hasn't been called indirectly.
+ * shutdown hasn't been called indirectly.
* - else
* - Success!
*/