From 217a01719552b0a678cc55fca9aebdf6b5196410 Mon Sep 17 00:00:00 2001 From: JoelKatz Date: Mon, 30 Sep 2013 02:40:35 -0700 Subject: [PATCH] Reduce memory consumption while fetching. --- src/ripple_app/shamap/SHAMapSync.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/ripple_app/shamap/SHAMapSync.cpp b/src/ripple_app/shamap/SHAMapSync.cpp index d893f81501..c67f4e7add 100644 --- a/src/ripple_app/shamap/SHAMapSync.cpp +++ b/src/ripple_app/shamap/SHAMapSync.cpp @@ -92,7 +92,11 @@ void SHAMap::getMissingNodes (std::vector& nodeIDs, std::vectorsetFullBelow (); if (mType == smtSTATE) + { fullBelowCache.add (node->getNodeHash ()); + if (getConfig().NODE_SIZE <= 3) + dropBelow(node); + } } } @@ -159,7 +163,11 @@ std::vector SHAMap::getNeededHashes (int max, SHAMapSyncFilter* filter) { node->setFullBelow (); if (mType == smtSTATE) + { fullBelowCache.add (node->getNodeHash ()); + if (getConfig().NODE_SIZE <= 3) + dropBelow(node); + } } }