Change transaction builder and miner to use v2 Sapling note plaintexts after Canopy activates.
Co-authored by Ying Tong (yingtong@electriccoin.co)
This commit is contained in:
parent
8770a5c532
commit
bf9baf2cb6
|
@ -157,7 +157,11 @@ public:
|
|||
mtx.valueBalance = -value;
|
||||
|
||||
uint256 ovk;
|
||||
auto note = libzcash::SaplingNote(pa, value, 0x01); // TODO
|
||||
unsigned char leadByte = 0x01;
|
||||
if (Params().GetConsensus().NetworkUpgradeActive(nHeight, Consensus::UPGRADE_CANOPY)) {
|
||||
leadByte = 0x02;
|
||||
}
|
||||
auto note = libzcash::SaplingNote(pa, value, leadByte);
|
||||
auto output = OutputDescriptionInfo(ovk, note, {{0xF6}});
|
||||
|
||||
auto ctx = librustzcash_sapling_proving_ctx_init();
|
||||
|
|
|
@ -162,7 +162,11 @@ void TransactionBuilder::AddSaplingOutput(
|
|||
throw std::runtime_error("TransactionBuilder cannot add Sapling output to pre-Sapling transaction");
|
||||
}
|
||||
|
||||
auto note = libzcash::SaplingNote(to, value, 0x01); // TODO
|
||||
unsigned char leadByte = 0x01;
|
||||
if (Params().GetConsensus().NetworkUpgradeActive(nHeight, Consensus::UPGRADE_CANOPY)) {
|
||||
leadByte = 0x02;
|
||||
}
|
||||
auto note = libzcash::SaplingNote(to, value, leadByte);
|
||||
outputs.emplace_back(ovk, note, memo);
|
||||
mtx.valueBalance -= value;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue