Small changes to improve transaction benchmarking:

* Set transaction valid in hash router correctly
* Properly account for root nodes in walkLedger
* If loaded ledger is insane, log details
* Extra logging while loading replay ledger
* Don't test unsigned transactions expecting them to succeed
* Don't be too noisy about signature failures
This commit is contained in:
JoelKatz
2015-03-26 17:25:41 -07:00
committed by Tom Ritchford
parent b27e152ead
commit b4058a813b
5 changed files with 31 additions and 10 deletions

View File

@@ -1549,7 +1549,16 @@ bool Ledger::walkLedger () const
std::vector <SHAMapMissingNode> missingNodes1;
std::vector <SHAMapMissingNode> missingNodes2;
mAccountStateMap->walkMap (missingNodes1, 32);
if (mAccountStateMap->getHash().isZero() &&
! mAccountHash.isZero() &&
! mAccountStateMap->fetchRoot (mAccountHash, nullptr))
{
missingNodes1.emplace_back (SHAMapType::STATE, mAccountHash);
}
else
{
mAccountStateMap->walkMap (missingNodes1, 32);
}
if (ShouldLog (lsINFO, Ledger) && !missingNodes1.empty ())
{
@@ -1559,7 +1568,16 @@ bool Ledger::walkLedger () const
<< "First: " << missingNodes1[0];
}
mTransactionMap->walkMap (missingNodes2, 32);
if (mTransactionMap->getHash().isZero() &&
mTransHash.isNonZero() &&
! mTransactionMap->fetchRoot (mTransHash, nullptr))
{
missingNodes2.emplace_back (SHAMapType::TRANSACTION, mTransHash);
}
else
{
mTransactionMap->walkMap (missingNodes2, 32);
}
if (ShouldLog (lsINFO, Ledger) && !missingNodes2.empty ())
{
@@ -1584,13 +1602,13 @@ bool Ledger::assertSane () const
return true;
}
WriteLog (lsFATAL, Ledger) << "ledger is not sane";
Json::Value j = getJson (*this);
j [jss::accountTreeHash] = to_string (mAccountHash);
j [jss::transTreeHash] = to_string (mTransHash);
WriteLog (lsFATAL, Ledger) << "ledger is not sane" << j;
assert (false);
return false;