From ef53197e1fe48fbec1696d906909e74fdafcd747 Mon Sep 17 00:00:00 2001 From: Miguel Portilla Date: Thu, 22 Oct 2020 08:55:32 -0400 Subject: [PATCH] Fix ledger sequence on copynode --- src/ripple/app/misc/SHAMapStoreImp.cpp | 3 +-- src/ripple/app/misc/SHAMapStoreImp.h | 2 +- src/ripple/nodestore/Database.h | 5 +++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ripple/app/misc/SHAMapStoreImp.cpp b/src/ripple/app/misc/SHAMapStoreImp.cpp index ef8ce21f3..3e96bbc27 100644 --- a/src/ripple/app/misc/SHAMapStoreImp.cpp +++ b/src/ripple/app/misc/SHAMapStoreImp.cpp @@ -304,8 +304,7 @@ SHAMapStoreImp::copyNode( SHAMapAbstractNode const& node) { // Copy a single record from node to dbRotating_ - dbRotating_->fetchNodeObject( - node.getNodeHash().as_uint256(), node.getSeq()); + dbRotating_->fetchNodeObject(node.getNodeHash().as_uint256()); if (!(++nodeCount % checkHealthInterval_)) { if (health()) diff --git a/src/ripple/app/misc/SHAMapStoreImp.h b/src/ripple/app/misc/SHAMapStoreImp.h index 7200f7eba..ea75eedb9 100644 --- a/src/ripple/app/misc/SHAMapStoreImp.h +++ b/src/ripple/app/misc/SHAMapStoreImp.h @@ -211,7 +211,7 @@ private: for (auto const& key : cache.getKeys()) { - dbRotating_->fetchNodeObject(key, 0); + dbRotating_->fetchNodeObject(key); if (!(++check % checkHealthInterval_) && health()) return true; } diff --git a/src/ripple/nodestore/Database.h b/src/ripple/nodestore/Database.h index b1a788843..45e536fe3 100644 --- a/src/ripple/nodestore/Database.h +++ b/src/ripple/nodestore/Database.h @@ -128,7 +128,7 @@ public: std::shared_ptr fetchNodeObject( uint256 const& hash, - std::uint32_t ledgerSeq, + std::uint32_t ledgerSeq = 0, FetchType fetchType = FetchType::synchronous); /** Fetch an object without waiting. @@ -139,7 +139,8 @@ public: @note This can be called concurrently. @param hash The key of the object to retrieve - @param ledgerSeq The sequence of the ledger where the object is stored. + @param ledgerSeq The sequence of the ledger where the + object is stored, used by the shard store. @param nodeObject The object retrieved @return Whether the operation completed */