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);