Use ValueFromAmount instead of double arithmetic, and improve variable names.

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
This commit is contained in:
Daira Hopwood 2020-07-10 01:55:05 +01:00
parent 9228c3113d
commit 9161071b02
1 changed files with 5 additions and 5 deletions

View File

@ -902,11 +902,11 @@ UniValue getblocksubsidy(const UniValue& params, bool fHelp)
UniValue result(UniValue::VOBJ);
if (canopyActive) {
UniValue fundingstreams(UniValue::VOBJ);
auto elems = Consensus::GetActiveFundingStreams(nHeight, consensus);
for (auto elem : elems) {
CAmount value = elem.Value(nBlockSubsidy);
fundingstreams.pushKV(elem.recipient, (double) value / COIN);
nMinerReward -= value;
auto fsinfos = Consensus::GetActiveFundingStreams(nHeight, consensus);
for (auto fsinfo : fsinfos) {
CAmount nStreamAmount = fsinfo.Value(nBlockSubsidy);
fundingstreams.pushKV(fsinfo.recipient, ValueFromAmount(nStreamAmount));
nMinerReward -= nStreamAmount;
}
result.pushKV("fundingstreams", fundingstreams);
} else if (nHeight > 0 && nHeight <= consensus.GetLastFoundersRewardBlockHeight(nHeight)) {