本文整理汇总了C++中ledger::pointer::setParentHash方法的典型用法代码示例。如果您正苦于以下问题:C++ pointer::setParentHash方法的具体用法?C++ pointer::setParentHash怎么用?C++ pointer::setParentHash使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ledger::pointer
的用法示例。
在下文中一共展示了pointer::setParentHash方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: in
//.........这里部分代码省略.........
// will start replay from.
require (app->loadOldLedger (getConfig ().START_LEDGER, false),
"Reloading old ledger failed.");
parentLedger = lm.getClosedLedger ();
}
auto const parentSeq = parentLedger->getLedgerSeq ();
auto seq = j["seq"].asUInt ();
while (parentSeq + 1 > seq)
{
// Fast-scan JSON records until we hit the right one.
WriteLog (lsINFO, LedgerDump) << "scanning past ledger: "
<< seq;
j = loadJsonRecord (in);
seq = j["seq"].asUInt ();
if (parentSeq + 1 <= seq)
{
require (parentSeq + 1 == seq,
"Missing ledgers between loaded and replay-start");
std::tie (deserializedLedger, txSet, txOrder) =
loadLedgerAndTransactionsFromJSON (*app, j);
}
}
gLedgerSeq = parentSeq;
require(parentLedger->getLedgerSeq () + 1 ==
deserializedLedger->getLedgerSeq (),
"Mismatched ledger-sequence prefix.");
}
Ledger::pointer currentLedger =
boost::make_shared<Ledger> (true, *parentLedger);
currentLedger->setCloseTime (deserializedLedger->getCloseTimeNC ());
currentLedger->setCloseFlags (deserializedLedger->getCloseFlags ());
currentLedger->setParentHash (deserializedLedger->getParentHash ());
WriteLog (lsINFO, LedgerDump) << "loading ledger: "
<< currentLedger->getLedgerSeq();
if (ShouldLog (lsTRACE, LedgerDump))
{
WriteLog (lsTRACE, LedgerDump) << "expecting next ledger:";
WriteLog (lsTRACE, LedgerDump) << deserializedLedger->getJson (0);
WriteLog (lsTRACE, LedgerDump) << "synthetic next ledger:";
WriteLog (lsTRACE, LedgerDump) << currentLedger->getJson (0);
}
gLedgerSeq++;
// Apply transactions, transitioning from one ledger state to next.
WriteLog (lsDEBUG, LedgerDump)
<< "Applying set of " << txOrder.size() << " transactions";
CanonicalTXSet retriableTransactions (txSet->getHash ());
std::set<uint256> failedTransactions;
LedgerConsensus::applyTransactions (txSet, currentLedger, currentLedger,
retriableTransactions, failedTransactions,
false, txOrder);
require (retriableTransactions.empty (), "failed retriable tx set is not empty");
require (failedTransactions.empty (), "failed tx set is not empty");
currentLedger->updateSkipList ();
currentLedger->setClosed ();
currentLedger->setCloseTime (deserializedLedger->getCloseTimeNC ());
int asf = currentLedger->peekAccountStateMap ()->flushDirty (
hotACCOUNT_NODE, currentLedger->getLedgerSeq());