Auto merge of #4662 - therealyingtong:zip-211-ncc-fixes, r=daira

ZIP 211 NCC fixes

Fixes to the ZIP 211 implementation as suggested in the NCC audit.
This commit is contained in:
Homu 2020-08-13 13:43:33 +00:00
commit ddae981525
1 changed files with 2 additions and 1 deletions

View File

@ -3041,11 +3041,12 @@ UniValue zc_raw_joinsplit(const UniValue& params, bool fHelp)
const bool canopyActive = Params().GetConsensus().NetworkUpgradeActive(nextBlockHeight, Consensus::UPGRADE_CANOPY);
if (params[3].get_real() != 0.0)
if (params[3].get_real() != 0.0) {
if (canopyActive) {
throw JSONRPCError(RPC_VERIFY_REJECTED, "Sprout shielding is not supported after Canopy");
}
vpub_old = AmountFromValue(params[3]);
}
if (params[4].get_real() != 0.0)
vpub_new = AmountFromValue(params[4]);