SHAMap improvements:

* Run key SHAMap unit tests on both backed and unbacked maps
* Remove obsolete version of SHAMapTree::addRootNode
* Our position maps should be unbacked and immutable
* Minimize hash operations for unbacked SHAMaps
  Not setting the sequence numbers to zero in
  SHAMap::walkSubTree causes extra hashes to be
  performed on subsequent operations
This commit is contained in:
JoelKatz
2015-12-23 11:09:28 -08:00
committed by Nik Bougalis
parent 6dab1657b1
commit 44fcab1081
7 changed files with 56 additions and 54 deletions

View File

@@ -1386,6 +1386,7 @@ void LedgerConsensusImp::takeInitialPosition (
{
std::shared_ptr<SHAMap> initialSet = std::make_shared <SHAMap> (
SHAMapType::TRANSACTION, app_.family());
initialSet->setUnbacked ();
// Build SHAMap containing all transactions in our open ledger
for (auto const& tx : initialLedger->txs)
@@ -1629,6 +1630,8 @@ void LedgerConsensusImp::updateOurPositions ()
if (changes)
{
ourPosition = ourPosition->snapShot (false);
auto newHash = ourPosition->getHash ().as_uint256();
JLOG (j_.info)
<< "Position change: CTime "