Apply suggestions from code review
Co-authored-by: Larry Ruane <larry@z.cash>
This commit is contained in:
parent
4e50b700e9
commit
e60c2bf17c
|
@ -915,7 +915,7 @@ UniValue getblocksubsidy(const UniValue& params, bool fHelp)
|
|||
UniValue fundingstreams(UniValue::VARR);
|
||||
auto fsinfos = Consensus::GetActiveFundingStreams(nHeight, consensus);
|
||||
for (int idx = 0; idx < fsinfos.size(); idx++) {
|
||||
auto fsinfo = fsinfos[idx];
|
||||
const auto& fsinfo = fsinfos[idx];
|
||||
CAmount nStreamAmount = fsinfo.Value(nBlockSubsidy);
|
||||
nMinerReward -= nStreamAmount;
|
||||
|
||||
|
@ -929,16 +929,18 @@ UniValue getblocksubsidy(const UniValue& params, bool fHelp)
|
|||
auto address = fs.get().RecipientAddress(consensus, nHeight);
|
||||
|
||||
CScript* outpoint = boost::get<CScript>(&address);
|
||||
libzcash::SaplingPaymentAddress* zaddr = boost::get<libzcash::SaplingPaymentAddress>(&address);
|
||||
UniValue pubkey(UniValue::VOBJ);
|
||||
|
||||
if (outpoint != nullptr) {
|
||||
// For transparent funding stream addresses
|
||||
ScriptPubKeyToJSON(*outpoint, pubkey, true);
|
||||
} else if (zaddr != nullptr) {
|
||||
} else {
|
||||
libzcash::SaplingPaymentAddress* zaddr = boost::get<libzcash::SaplingPaymentAddress>(&address);
|
||||
if (zaddr != nullptr) {
|
||||
// For shielded funding stream addresses
|
||||
pubkey.pushKV("address", keyIO.EncodePaymentAddress(*zaddr));
|
||||
}
|
||||
}
|
||||
|
||||
fsobj.pushKV("pubkey", pubkey);
|
||||
fundingstreams.push_back(fsobj);
|
||||
|
|
Loading…
Reference in New Issue