From 0dbacedb58eb9a08a6f9a4c48adaf43c1cb85910 Mon Sep 17 00:00:00 2001 From: Howard Hinnant Date: Mon, 30 Nov 2015 16:02:31 -0500 Subject: [PATCH] Change signature of SHAMap::getFetchPack to use SHAMapHash --- src/ripple/app/ledger/impl/LedgerMaster.cpp | 4 ++-- src/ripple/shamap/SHAMap.h | 2 +- src/ripple/shamap/impl/SHAMapSync.cpp | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ripple/app/ledger/impl/LedgerMaster.cpp b/src/ripple/app/ledger/impl/LedgerMaster.cpp index 267ede2b5f..ac6e38e601 100644 --- a/src/ripple/app/ledger/impl/LedgerMaster.cpp +++ b/src/ripple/app/ledger/impl/LedgerMaster.cpp @@ -1915,12 +1915,12 @@ void LedgerMasterImp::makeFetchPack ( auto fpAppender = []( protocol::TMGetObjectByHash* reply, std::uint32_t ledgerSeq, - uint256 const& hash, + SHAMapHash const& hash, const Blob& blob) { protocol::TMIndexedObject& newObj = * (reply->add_objects ()); newObj.set_ledgerseq (ledgerSeq); - newObj.set_hash (hash.begin (), 256 / 8); + newObj.set_hash (hash.as_uint256().begin (), 256 / 8); newObj.set_data (&blob[0], blob.size ()); }; diff --git a/src/ripple/shamap/SHAMap.h b/src/ripple/shamap/SHAMap.h index eeb36ef981..b6e0d83e32 100644 --- a/src/ripple/shamap/SHAMap.h +++ b/src/ripple/shamap/SHAMap.h @@ -215,7 +215,7 @@ public: void visitDifferences(SHAMap* have, std::function) const; void getFetchPack (SHAMap * have, bool includeLeaves, int max, - std::function) const; + std::function) const; void setUnbacked (); diff --git a/src/ripple/shamap/impl/SHAMapSync.cpp b/src/ripple/shamap/impl/SHAMapSync.cpp index d1647bd395..eeb1b22e04 100644 --- a/src/ripple/shamap/impl/SHAMapSync.cpp +++ b/src/ripple/shamap/impl/SHAMapSync.cpp @@ -711,7 +711,7 @@ Note: a caller should set includeLeaves to false for transaction trees. There's no point in including the leaves of transaction trees. */ void SHAMap::getFetchPack (SHAMap* have, bool includeLeaves, int max, - std::function func) const + std::function func) const { visitDifferences (have, [includeLeaves, &max, &func] (SHAMapAbstractNode& smn) -> bool @@ -720,7 +720,7 @@ void SHAMap::getFetchPack (SHAMap* have, bool includeLeaves, int max, { Serializer s; smn.addRaw (s, snfPREFIX); - func (smn.getNodeHash().as_uint256(), s.peekData()); + func (smn.getNodeHash(), s.peekData()); if (--max <= 0) return false;