Changeset View
Changeset View
Standalone View
Standalone View
src/rest.cpp
Show First 20 Lines • Show All 389 Lines • ▼ Show 20 Lines | static bool rest_tx(Config &config, HTTPRequest *req, | ||||
const TxId txid(hash); | const TxId txid(hash); | ||||
if (g_txindex) { | if (g_txindex) { | ||||
g_txindex->BlockUntilSyncedToCurrentChain(); | g_txindex->BlockUntilSyncedToCurrentChain(); | ||||
} | } | ||||
CTransactionRef tx; | CTransactionRef tx; | ||||
uint256 hashBlock = uint256(); | BlockHash hashBlock; | ||||
if (!GetTransaction(config.GetChainParams().GetConsensus(), txid, tx, | if (!GetTransaction(txid, tx, config.GetChainParams().GetConsensus(), | ||||
hashBlock, true)) { | hashBlock, true)) { | ||||
return RESTERR(req, HTTP_NOT_FOUND, hashStr + " not found"); | return RESTERR(req, HTTP_NOT_FOUND, hashStr + " not found"); | ||||
} | } | ||||
CDataStream ssTx(SER_NETWORK, PROTOCOL_VERSION | RPCSerializationFlags()); | CDataStream ssTx(SER_NETWORK, PROTOCOL_VERSION | RPCSerializationFlags()); | ||||
ssTx << tx; | ssTx << tx; | ||||
switch (rf) { | switch (rf) { | ||||
▲ Show 20 Lines • Show All 282 Lines • Show Last 20 Lines |