mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 22:50:59 +01:00
Switch GetTransaction to returning a CTransactionRef
This commit is contained in:
@@ -218,19 +218,19 @@ UniValue getrawtransaction(const JSONRPCRequest& request)
|
||||
}
|
||||
}
|
||||
|
||||
CTransaction tx;
|
||||
CTransactionRef tx;
|
||||
uint256 hashBlock;
|
||||
if (!GetTransaction(hash, tx, Params().GetConsensus(), hashBlock, true))
|
||||
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "No information available about transaction");
|
||||
|
||||
string strHex = EncodeHexTx(tx);
|
||||
string strHex = EncodeHexTx(*tx);
|
||||
|
||||
if (!fVerbose)
|
||||
return strHex;
|
||||
|
||||
UniValue result(UniValue::VOBJ);
|
||||
result.push_back(Pair("hex", strHex));
|
||||
TxToJSON(tx, hashBlock, result);
|
||||
TxToJSON(*tx, hashBlock, result);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -289,7 +289,7 @@ UniValue gettxoutproof(const JSONRPCRequest& request)
|
||||
|
||||
if (pblockindex == NULL)
|
||||
{
|
||||
CTransaction tx;
|
||||
CTransactionRef tx;
|
||||
if (!GetTransaction(oneTxid, tx, Params().GetConsensus(), hashBlock, false) || hashBlock.IsNull())
|
||||
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Transaction not yet in block");
|
||||
if (!mapBlockIndex.count(hashBlock))
|
||||
|
||||
Reference in New Issue
Block a user