mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Missing function Ledger::writeBack
This commit is contained in:
@@ -3,6 +3,27 @@
|
||||
|
||||
#include "boost/make_shared.hpp"
|
||||
|
||||
LedgerStateParms Ledger::writeBack(LedgerStateParms parms, SerializedLedgerEntry::pointer entry)
|
||||
{
|
||||
ScopedLock l(mAccountStateMap->Lock());
|
||||
bool create = false;
|
||||
|
||||
if (!mAccountStateMap->hasItem(entry->getIndex()))
|
||||
{
|
||||
if ((parms & lepCREATE) == 0)
|
||||
return lepMISSING;
|
||||
create = true;
|
||||
}
|
||||
|
||||
SHAMapItem::pointer item = boost::make_shared<SHAMapItem>(entry->getIndex());
|
||||
entry->add(item->peekSerializer());
|
||||
|
||||
if (!mAccountStateMap->updateGiveItem(item, false))
|
||||
return lepERROR;
|
||||
|
||||
return create ? lepCREATED : lepOKAY;
|
||||
}
|
||||
|
||||
SerializedLedgerEntry::pointer Ledger::getAccountRoot(LedgerStateParms& parms, const uint160& accountID)
|
||||
{
|
||||
uint256 nodeID=getAccountRootIndex(accountID);
|
||||
|
||||
Reference in New Issue
Block a user