Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/rawtransaction.cpp
Show First 20 Lines • Show All 174 Lines • ▼ Show 20 Lines | static UniValue getrawtransaction(const Config &config, | ||||
if (!request.params[1].isNull()) { | if (!request.params[1].isNull()) { | ||||
fVerbose = request.params[1].isNum() | fVerbose = request.params[1].isNum() | ||||
? (request.params[1].get_int() != 0) | ? (request.params[1].get_int() != 0) | ||||
: request.params[1].get_bool(); | : request.params[1].get_bool(); | ||||
} | } | ||||
if (!request.params[2].isNull()) { | if (!request.params[2].isNull()) { | ||||
uint256 blockhash = ParseHashV(request.params[2], "parameter 3"); | uint256 blockhash = ParseHashV(request.params[2], "parameter 3"); | ||||
if (!blockhash.IsNull()) { | |||||
BlockMap::iterator it = mapBlockIndex.find(blockhash); | BlockMap::iterator it = mapBlockIndex.find(blockhash); | ||||
if (it == mapBlockIndex.end()) { | if (it == mapBlockIndex.end()) { | ||||
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, | throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, | ||||
"Block hash not found"); | "Block hash not found"); | ||||
} | } | ||||
blockindex = it->second; | blockindex = it->second; | ||||
in_active_chain = chainActive.Contains(blockindex); | in_active_chain = chainActive.Contains(blockindex); | ||||
} | } | ||||
} | |||||
CTransactionRef tx; | CTransactionRef tx; | ||||
uint256 hash_block; | uint256 hash_block; | ||||
if (!GetTransaction(config, txid, tx, hash_block, true, blockindex)) { | if (!GetTransaction(config, txid, tx, hash_block, true, blockindex)) { | ||||
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"); | ||||
▲ Show 20 Lines • Show All 1,159 Lines • Show Last 20 Lines |