mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Fix ledger acquire node handling bug.
This commit is contained in:
@@ -243,7 +243,12 @@ bool LedgerAcquire::takeTxNode(const std::list<SHAMapNode>& nodeIDs,
|
|||||||
std::list<std::vector<unsigned char> >::const_iterator nodeDatait = data.begin();
|
std::list<std::vector<unsigned char> >::const_iterator nodeDatait = data.begin();
|
||||||
while (nodeIDit != nodeIDs.end())
|
while (nodeIDit != nodeIDs.end())
|
||||||
{
|
{
|
||||||
if (!mLedger->peekTransactionMap()->addKnownNode(*nodeIDit, *nodeDatait))
|
if (nodeIDit->isRoot())
|
||||||
|
{
|
||||||
|
if (!mLedger->peekTransactionMap()->addRootNode(mLedger->getTransHash(), *nodeDatait))
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
else if (!mLedger->peekTransactionMap()->addKnownNode(*nodeIDit, *nodeDatait))
|
||||||
return false;
|
return false;
|
||||||
++nodeIDit;
|
++nodeIDit;
|
||||||
++nodeDatait;
|
++nodeDatait;
|
||||||
@@ -263,7 +268,12 @@ bool LedgerAcquire::takeAsNode(const std::list<SHAMapNode>& nodeIDs,
|
|||||||
std::list<std::vector<unsigned char> >::const_iterator nodeDatait = data.begin();
|
std::list<std::vector<unsigned char> >::const_iterator nodeDatait = data.begin();
|
||||||
while (nodeIDit != nodeIDs.end())
|
while (nodeIDit != nodeIDs.end())
|
||||||
{
|
{
|
||||||
if (!mLedger->peekAccountStateMap()->addKnownNode(*nodeIDit, *nodeDatait))
|
if (nodeIDit->isRoot())
|
||||||
|
{
|
||||||
|
if (!mLedger->peekAccountStateMap()->addRootNode(mLedger->getAccountHash(), *nodeDatait))
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
else if (!mLedger->peekAccountStateMap()->addKnownNode(*nodeIDit, *nodeDatait))
|
||||||
return false;
|
return false;
|
||||||
++nodeIDit;
|
++nodeIDit;
|
||||||
++nodeDatait;
|
++nodeDatait;
|
||||||
|
|||||||
Reference in New Issue
Block a user