Example #1
0
SerializedTransaction::pointer TransactionMaster::fetch (SHAMapItem::ref item, SHAMapTreeNode::TNType type,
        bool checkDisk, uint32 uCommitLedger)
{
    SerializedTransaction::pointer  txn;
    Transaction::pointer            iTx = getApp().getMasterTransaction ().fetch (item->getTag (), false);

    if (!iTx)
    {

        if (type == SHAMapTreeNode::tnTRANSACTION_NM)
        {
            SerializerIterator sit (item->peekSerializer ());
            txn = boost::make_shared<SerializedTransaction> (boost::ref (sit));
        }
        else if (type == SHAMapTreeNode::tnTRANSACTION_MD)
        {
            Serializer s;
            int length;
            item->peekSerializer ().getVL (s.modData (), 0, length);
            SerializerIterator sit (s);

            txn = boost::make_shared<SerializedTransaction> (boost::ref (sit));
        }
    }
    else
    {
        if (uCommitLedger)
            iTx->setStatus (COMMITTED, uCommitLedger);

        txn = iTx->getSTransaction ();
    }

    return txn;
}
Example #2
0
static void addLeaf (std::vector <uint256> &vec, SHAMapItem::ref item)
{
    vec.push_back (item->getTag ());
}