mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Fix the 'getAccountHash() == mAccountStateMap->getHash()' bug.
'getNeededHashes' can do the wrong thing (report no needed hashes when we need them all) if we have a ledger's root node but not the root node of the tree we're querying.
This commit is contained in:
@@ -1614,6 +1614,32 @@ uint64 Ledger::scaleFeeLoad(uint64 fee)
|
||||
return theApp->getFeeTrack().scaleFeeLoad(fee, mBaseFee, mReferenceFeeUnits);
|
||||
}
|
||||
|
||||
std::vector<uint256> Ledger::getNeededTransactionHashes(int max)
|
||||
{
|
||||
std::vector<uint256> ret;
|
||||
if (mTransHash.isNonZero())
|
||||
{
|
||||
if (mTransactionMap->getHash().isZero())
|
||||
ret.push_back(mTransHash);
|
||||
else
|
||||
ret = mTransactionMap->getNeededHashes(max);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
std::vector<uint256> Ledger::getNeededAccountStateHashes(int max)
|
||||
{
|
||||
std::vector<uint256> ret;
|
||||
if (mAccountHash.isNonZero())
|
||||
{
|
||||
if (mAccountStateMap->getHash().isZero())
|
||||
ret.push_back(mAccountHash);
|
||||
else
|
||||
ret = mAccountStateMap->getNeededHashes(max);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_SUITE(quality)
|
||||
|
||||
BOOST_AUTO_TEST_CASE( getquality )
|
||||
|
||||
Reference in New Issue
Block a user