From 5a8b23519ca8c909af2c40536a22f3f0c4f96dd7 Mon Sep 17 00:00:00 2001 From: JCW Date: Fri, 3 Oct 2025 13:48:21 +0100 Subject: [PATCH] Fix the crashing bug --- src/xrpld/consensus/Validations.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/xrpld/consensus/Validations.h b/src/xrpld/consensus/Validations.h index c333aeaefd..acfb82ba4b 100644 --- a/src/xrpld/consensus/Validations.h +++ b/src/xrpld/consensus/Validations.h @@ -29,6 +29,8 @@ #include #include +#include "xrpld/shamap/SHAMapMissingNode.h" + #include #include #include @@ -386,8 +388,16 @@ private: { for (auto it = acquiring_.begin(); it != acquiring_.end();) { - if (std::optional ledger = - adaptor_.acquire(it->first.second)) + std::optional ledger; + try + { + // Skip if we haven't finished acquiring this ledger, + // or the ledger we acquired isn't complete, which can happen + // because we're still trying to catch up. + ledger = adaptor_.acquire(it->first.second); + } + catch (SHAMapMissingNode const&) {} + if (ledger) { for (NodeID const& nodeID : it->second) updateTrie(lock, nodeID, *ledger);