Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/rawtransaction.cpp
Show First 20 Lines • Show All 148 Lines • ▼ Show 20 Lines | static UniValue getrawtransaction(const Config &config, | ||||
} | } | ||||
LOCK(cs_main); | LOCK(cs_main); | ||||
TxId txid = TxId(ParseHashV(request.params[0], "parameter 1")); | TxId txid = TxId(ParseHashV(request.params[0], "parameter 1")); | ||||
// Accept either a bool (true) or a num (>=1) to indicate verbose output. | // Accept either a bool (true) or a num (>=1) to indicate verbose output. | ||||
bool fVerbose = false; | bool fVerbose = false; | ||||
if (request.params.size() > 1) { | if (!request.params[1].isNull()) { | ||||
if (request.params[1].isNum()) { | if (request.params[1].isNum()) { | ||||
if (request.params[1].get_int() != 0) { | if (request.params[1].get_int() != 0) { | ||||
fVerbose = true; | fVerbose = true; | ||||
} | } | ||||
} else if (request.params[1].isBool()) { | } else if (request.params[1].isBool()) { | ||||
if (request.params[1].isTrue()) { | if (request.params[1].isTrue()) { | ||||
fVerbose = true; | fVerbose = true; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 78 Lines • ▼ Show 20 Lines | for (unsigned int idx = 0; idx < txids.size(); idx++) { | ||||
oneTxId = txid; | oneTxId = txid; | ||||
} | } | ||||
LOCK(cs_main); | LOCK(cs_main); | ||||
CBlockIndex *pblockindex = nullptr; | CBlockIndex *pblockindex = nullptr; | ||||
uint256 hashBlock; | uint256 hashBlock; | ||||
if (request.params.size() > 1) { | if (!request.params[1].isNull()) { | ||||
hashBlock = uint256S(request.params[1].get_str()); | hashBlock = uint256S(request.params[1].get_str()); | ||||
if (!mapBlockIndex.count(hashBlock)) { | if (!mapBlockIndex.count(hashBlock)) { | ||||
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Block not found"); | throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Block not found"); | ||||
} | } | ||||
pblockindex = mapBlockIndex[hashBlock]; | pblockindex = mapBlockIndex[hashBlock]; | ||||
} else { | } else { | ||||
// Loop through txids and try to find which block they're in. Exit loop | // Loop through txids and try to find which block they're in. Exit loop | ||||
// once a block is found. | // once a block is found. | ||||
▲ Show 20 Lines • Show All 1,057 Lines • Show Last 20 Lines |