Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/rawtransaction.cpp
Show First 20 Lines • Show All 226 Lines • ▼ Show 20 Lines | static UniValue getrawtransaction(const Config &config, | ||||
} | } | ||||
bool f_txindex_ready = false; | bool f_txindex_ready = false; | ||||
if (g_txindex && !blockindex) { | if (g_txindex && !blockindex) { | ||||
f_txindex_ready = g_txindex->BlockUntilSyncedToCurrentChain(); | f_txindex_ready = g_txindex->BlockUntilSyncedToCurrentChain(); | ||||
} | } | ||||
BlockHash hash_block; | BlockHash hash_block; | ||||
const CTransactionRef tx = GetTransaction( | const CTransactionRef tx = | ||||
blockindex, node.mempool, txid, params.GetConsensus(), hash_block); | GetTransaction(blockindex, node.mempool.get(), txid, | ||||
params.GetConsensus(), hash_block); | |||||
if (!tx) { | if (!tx) { | ||||
std::string errmsg; | std::string errmsg; | ||||
if (blockindex) { | if (blockindex) { | ||||
if (!blockindex->nStatus.hasData()) { | if (!blockindex->nStatus.hasData()) { | ||||
throw JSONRPCError(RPC_MISC_ERROR, "Block not available"); | throw JSONRPCError(RPC_MISC_ERROR, "Block not available"); | ||||
} | } | ||||
errmsg = "No such transaction found in the provided block"; | errmsg = "No such transaction found in the provided block"; | ||||
} else if (!g_txindex) { | } else if (!g_txindex) { | ||||
▲ Show 20 Lines • Show All 1,938 Lines • Show Last 20 Lines |