|
@ -878,13 +878,12 @@ UniValue getblocksubsidy(const UniValue& params, bool fHelp) |
|
|
if (fHelp || params.size() > 1) |
|
|
if (fHelp || params.size() > 1) |
|
|
throw runtime_error( |
|
|
throw runtime_error( |
|
|
"getblocksubsidy height\n" |
|
|
"getblocksubsidy height\n" |
|
|
"\nReturns block subsidy reward, taking into account the mining slow start and the founders reward, of block at index provided.\n" |
|
|
"\nReturns block subsidy reward, taking into account the mining slow start, of a block at index provided.\n" |
|
|
"\nArguments:\n" |
|
|
"\nArguments:\n" |
|
|
"1. height (numeric, optional) The block height. If not provided, defaults to the current height of the chain.\n" |
|
|
"1. height (numeric, optional) The block height. If not provided, defaults to the current height of the chain.\n" |
|
|
"\nResult:\n" |
|
|
"\nResult:\n" |
|
|
"{\n" |
|
|
"{\n" |
|
|
" \"miner\" : x.xxx (numeric) The mining reward amount in HUSH.\n" |
|
|
" \"miner\" : x.xxx (numeric) The mining reward amount in HUSH.\n" |
|
|
" \"founders\" : x.xxx (numeric) The founders reward amount in HUSH.\n" |
|
|
|
|
|
"}\n" |
|
|
"}\n" |
|
|
"\nExamples:\n" |
|
|
"\nExamples:\n" |
|
|
+ HelpExampleCli("getblocksubsidy", "1000") |
|
|
+ HelpExampleCli("getblocksubsidy", "1000") |
|
@ -897,13 +896,8 @@ UniValue getblocksubsidy(const UniValue& params, bool fHelp) |
|
|
throw JSONRPCError(RPC_INVALID_PARAMETER, "Block height out of range"); |
|
|
throw JSONRPCError(RPC_INVALID_PARAMETER, "Block height out of range"); |
|
|
|
|
|
|
|
|
CAmount nReward = GetBlockSubsidy(nHeight, Params().GetConsensus()); |
|
|
CAmount nReward = GetBlockSubsidy(nHeight, Params().GetConsensus()); |
|
|
CAmount nFoundersReward = 0; |
|
|
|
|
|
if ((nHeight > 0) && (nHeight <= Params().GetConsensus().GetLastFoundersRewardBlockHeight())) { |
|
|
|
|
|
nFoundersReward = 0; |
|
|
|
|
|
nReward -= nFoundersReward; |
|
|
|
|
|
} |
|
|
|
|
|
UniValue result(UniValue::VOBJ); |
|
|
UniValue result(UniValue::VOBJ); |
|
|
result.push_back(Pair("miner", ValueFromAmount(nReward))); |
|
|
result.push_back(Pair("miner", ValueFromAmount(nReward))); |
|
|
result.push_back(Pair("founders", ValueFromAmount(nFoundersReward))); |
|
|
|
|
|
return result; |
|
|
return result; |
|
|
} |
|
|
} |
|
|