Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/mining.cpp
Show First 20 Lines • Show All 698 Lines • ▼ Show 20 Lines | for (const auto &it : pblock->vtx) { | ||||
for (const CTxIn &in : tx.vin) { | for (const CTxIn &in : tx.vin) { | ||||
if (setTxIndex.count(in.prevout.hash)) | if (setTxIndex.count(in.prevout.hash)) | ||||
deps.push_back(setTxIndex[in.prevout.hash]); | deps.push_back(setTxIndex[in.prevout.hash]); | ||||
} | } | ||||
entry.push_back(Pair("depends", deps)); | entry.push_back(Pair("depends", deps)); | ||||
int index_in_template = i - 1; | int index_in_template = i - 1; | ||||
entry.push_back( | entry.push_back( | ||||
Pair("fee", pblocktemplate->vTxFees[index_in_template])); | Pair("fee", (int64_t)pblocktemplate->vTxFees[index_in_template])); | ||||
int64_t nTxSigOps = pblocktemplate->vTxSigOpsCount[index_in_template]; | int64_t nTxSigOps = pblocktemplate->vTxSigOpsCount[index_in_template]; | ||||
entry.push_back(Pair("sigops", nTxSigOps)); | entry.push_back(Pair("sigops", nTxSigOps)); | ||||
transactions.push_back(entry); | transactions.push_back(entry); | ||||
} | } | ||||
UniValue aux(UniValue::VOBJ); | UniValue aux(UniValue::VOBJ); | ||||
aux.push_back( | aux.push_back( | ||||
▲ Show 20 Lines • Show All 257 Lines • ▼ Show 20 Lines | static UniValue estimatepriority(const Config &config, | ||||
RPCTypeCheck(request.params, {UniValue::VNUM}); | RPCTypeCheck(request.params, {UniValue::VNUM}); | ||||
int nBlocks = request.params[0].get_int(); | int nBlocks = request.params[0].get_int(); | ||||
if (nBlocks < 1) { | if (nBlocks < 1) { | ||||
nBlocks = 1; | nBlocks = 1; | ||||
} | } | ||||
return mempool.estimatePriority(nBlocks); | return UniValue(mempool.estimatePriority(nBlocks)); | ||||
} | } | ||||
static UniValue estimatesmartfee(const Config &config, | static UniValue estimatesmartfee(const Config &config, | ||||
const JSONRPCRequest &request) { | const JSONRPCRequest &request) { | ||||
if (request.fHelp || request.params.size() != 1) { | if (request.fHelp || request.params.size() != 1) { | ||||
throw std::runtime_error( | throw std::runtime_error( | ||||
"estimatesmartfee nblocks\n" | "estimatesmartfee nblocks\n" | ||||
"\nWARNING: This interface is unstable and may disappear or " | "\nWARNING: This interface is unstable and may disappear or " | ||||
▲ Show 20 Lines • Show All 104 Lines • Show Last 20 Lines |