// make sure the node exists and force its type BOOST_FOREACH (STObject & it, mNodes) { if (it.getFieldH256 (sfLedgerIndex) == node) { it.setFName (type); it.setFieldU16 (sfLedgerEntryType, nodeType); return; } }
bool TransactionMetaSet::thread (STObject& node, uint256 const& prevTxID, std::uint32_t prevLgrID) { if (node.getFieldIndex (sfPreviousTxnID) == -1) { assert (node.getFieldIndex (sfPreviousTxnLgrSeq) == -1); node.setFieldH256 (sfPreviousTxnID, prevTxID); node.setFieldU32 (sfPreviousTxnLgrSeq, prevLgrID); return true; } assert (node.getFieldH256 (sfPreviousTxnID) == prevTxID); assert (node.getFieldU32 (sfPreviousTxnLgrSeq) == prevLgrID); return false; }
static bool compare (const STObject& o1, const STObject& o2) { return o1.getFieldH256 (sfLedgerIndex) < o2.getFieldH256 (sfLedgerIndex); }