mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-20 02:55:50 +00:00
Fix the crashing bug
This commit is contained in:
@@ -29,6 +29,8 @@
|
|||||||
#include <xrpl/beast/container/aged_unordered_map.h>
|
#include <xrpl/beast/container/aged_unordered_map.h>
|
||||||
#include <xrpl/protocol/PublicKey.h>
|
#include <xrpl/protocol/PublicKey.h>
|
||||||
|
|
||||||
|
#include "xrpld/shamap/SHAMapMissingNode.h"
|
||||||
|
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
#include <optional>
|
#include <optional>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
@@ -386,8 +388,16 @@ private:
|
|||||||
{
|
{
|
||||||
for (auto it = acquiring_.begin(); it != acquiring_.end();)
|
for (auto it = acquiring_.begin(); it != acquiring_.end();)
|
||||||
{
|
{
|
||||||
if (std::optional<Ledger> ledger =
|
std::optional<Ledger> ledger;
|
||||||
adaptor_.acquire(it->first.second))
|
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)
|
for (NodeID const& nodeID : it->second)
|
||||||
updateTrie(lock, nodeID, *ledger);
|
updateTrie(lock, nodeID, *ledger);
|
||||||
|
|||||||
Reference in New Issue
Block a user