Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/mining.cpp
Show First 20 Lines • Show All 287 Lines • ▼ Show 20 Lines | if (request.fHelp || request.params.size() != 3) { | ||||
"true (boolean) Returns true\n" | "true (boolean) Returns true\n" | ||||
"\nExamples:\n" + | "\nExamples:\n" + | ||||
HelpExampleCli("prioritisetransaction", "\"txid\" 0.0 10000") + | HelpExampleCli("prioritisetransaction", "\"txid\" 0.0 10000") + | ||||
HelpExampleRpc("prioritisetransaction", "\"txid\", 0.0, 10000")); | HelpExampleRpc("prioritisetransaction", "\"txid\", 0.0, 10000")); | ||||
} | } | ||||
LOCK(cs_main); | LOCK(cs_main); | ||||
TxId txid(ParseHashStr(request.params[0].get_str(), "txid")); | TxId txid(ParseHashV(request.params[0], "txid")); | ||||
Amount nAmount = request.params[2].get_int64() * SATOSHI; | Amount nAmount = request.params[2].get_int64() * SATOSHI; | ||||
if (!(request.params[1].isNull() || request.params[1].get_real() == 0)) { | if (!(request.params[1].isNull() || request.params[1].get_real() == 0)) { | ||||
throw JSONRPCError(RPC_INVALID_PARAMETER, | throw JSONRPCError(RPC_INVALID_PARAMETER, | ||||
"Priority is no longer supported, dummy argument to " | "Priority is no longer supported, dummy argument to " | ||||
"prioritisetransaction must be 0."); | "prioritisetransaction must be 0."); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 223 Lines • ▼ Show 20 Lines | if (!lpval.isNull()) { | ||||
uint256 hashWatchedChain; | uint256 hashWatchedChain; | ||||
std::chrono::steady_clock::time_point checktxtime; | std::chrono::steady_clock::time_point checktxtime; | ||||
unsigned int nTransactionsUpdatedLastLP; | unsigned int nTransactionsUpdatedLastLP; | ||||
if (lpval.isStr()) { | if (lpval.isStr()) { | ||||
// Format: <hashBestChain><nTransactionsUpdatedLast> | // Format: <hashBestChain><nTransactionsUpdatedLast> | ||||
std::string lpstr = lpval.get_str(); | std::string lpstr = lpval.get_str(); | ||||
hashWatchedChain.SetHex(lpstr.substr(0, 64)); | hashWatchedChain = ParseHashV(lpstr.substr(0, 64), "longpollid"); | ||||
nTransactionsUpdatedLastLP = atoi64(lpstr.substr(64)); | nTransactionsUpdatedLastLP = atoi64(lpstr.substr(64)); | ||||
} else { | } else { | ||||
// NOTE: Spec does not specify behaviour for non-string longpollid, | // NOTE: Spec does not specify behaviour for non-string longpollid, | ||||
// but this makes testing easier | // but this makes testing easier | ||||
hashWatchedChain = chainActive.Tip()->GetBlockHash(); | hashWatchedChain = chainActive.Tip()->GetBlockHash(); | ||||
nTransactionsUpdatedLastLP = nTransactionsUpdatedLast; | nTransactionsUpdatedLastLP = nTransactionsUpdatedLast; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 299 Lines • Show Last 20 Lines |