Quick fix for the bug that was causing ledgers to diverge.

LES used an unordered map, causing the traverse of modified ledger nodes to
be in random order. This meant different nodes would thread transactions
differently, causing ledger divergence. This change switches the LES code to
use a standard map. This adds more overhead to LES search functions (because
ordered map operations like search and insert are more expensive than
unordered map opreations, so it may be worth a separate ordering step just
for calcRawMeta instead.
This commit is contained in:
JoelKatz
2012-10-12 17:01:37 -07:00
parent b2481f3c49
commit 19b518a0af
4 changed files with 22 additions and 20 deletions

View File

@@ -18,7 +18,7 @@ SETUP_LOG();
void TransactionEngine::txnWrite()
{
// Write back the account states
for (boost::unordered_map<uint256, LedgerEntrySetEntry>::iterator it = mNodes.begin(), end = mNodes.end();
for (std::map<uint256, LedgerEntrySetEntry>::iterator it = mNodes.begin(), end = mNodes.end();
it != end; ++it)
{
const SLE::pointer& sleEntry = it->second.mEntry;