Rule out the SHAMap snapShot code as the cause of the duplicate Txn bug.

Add unit test for the SHAMap snapShot code.
Add some extra asserts for attempts to modify immutable maps.
This commit is contained in:
JoelKatz
2012-06-02 15:34:49 -07:00
parent a8e65ce045
commit 866ead228b
3 changed files with 35 additions and 21 deletions

View File

@@ -182,7 +182,7 @@ void LedgerConsensus::takeInitialPosition(Ledger::pointer initialLedger)
CKey::pointer nodePrivKey = boost::make_shared<CKey>();
nodePrivKey->MakeNewKey(); // FIXME
SHAMap::pointer initialSet = initialLedger->peekTransactionMap()->snapShot();
SHAMap::pointer initialSet = initialLedger->peekTransactionMap()->snapShot(false);
uint256 txSet = initialSet->getHash();
mOurPosition = boost::make_shared<LedgerProposal>(nodePrivKey, initialLedger->getParentHash(), txSet);
mapComplete(txSet, initialSet);
@@ -377,7 +377,7 @@ bool LedgerConsensus::updateOurPositions(int sinceClose)
{
if (!changes)
{
ourPosition = mComplete[mOurPosition->getCurrentHash()]->snapShot();
ourPosition = mComplete[mOurPosition->getCurrentHash()]->snapShot(true);
changes = true;
stable = false;
}