mirror of
https://github.com/XRPLF/rippled.git
synced 2026-04-29 15:37:57 +00:00
Complete the handler for received ledger data.
This commit is contained in:
19
Ledger.cpp
19
Ledger.cpp
@@ -65,6 +65,25 @@ Ledger::Ledger(const std::vector<unsigned char>& rawLedger) : mFeeHeld(0), mTime
|
||||
}
|
||||
}
|
||||
|
||||
Ledger::Ledger(const std::string& rawLedger) : mFeeHeld(0), mTimeStamp(0),
|
||||
mLedgerSeq(0), mClosed(false), mValidHash(false), mAccepted(false), mImmutable(true)
|
||||
{
|
||||
Serializer s(rawLedger);
|
||||
// 32seq, 64fee, 256phash, 256thash, 256ahash, 64ts
|
||||
if(!s.get32(mLedgerSeq, BLgPIndex)) return;
|
||||
if(!s.get64(mFeeHeld, BLgPFeeHeld)) return;
|
||||
if(!s.get256(mParentHash, BLgPPrevLg)) return;
|
||||
if(!s.get256(mTransHash, BLgPTxT)) return;
|
||||
if(!s.get256(mAccountHash, BLgPAcT)) return;
|
||||
if(!s.get64(mTimeStamp, BLgPClTs)) return;
|
||||
updateHash();
|
||||
if(mValidHash)
|
||||
{
|
||||
mTransactionMap=boost::make_shared<SHAMap>();
|
||||
mAccountStateMap=boost::make_shared<SHAMap>();
|
||||
}
|
||||
}
|
||||
|
||||
void Ledger::updateHash()
|
||||
{
|
||||
if(!mImmutable)
|
||||
|
||||
Reference in New Issue
Block a user