Use the correct empty memo for Sapling outputs

This commit is contained in:
Jack Grigg 2018-09-13 22:04:00 +01:00
parent bcdb4344f0
commit ba63dacbbb
No known key found for this signature in database
GPG Key ID: 1B8D649257DB0829
2 changed files with 3 additions and 3 deletions

View File

@ -128,7 +128,7 @@ boost::optional<CTransaction> TransactionBuilder::Build()
// Send change to the specified change address. If no change address
// was set, send change to the first Sapling address given as input.
if (zChangeAddr) {
AddSaplingOutput(zChangeAddr->first, zChangeAddr->second, change, {});
AddSaplingOutput(zChangeAddr->first, zChangeAddr->second, change);
} else if (tChangeAddr) {
// tChangeAddr has already been validated.
assert(AddTransparentOutput(tChangeAddr.value(), change));
@ -136,7 +136,7 @@ boost::optional<CTransaction> TransactionBuilder::Build()
auto fvk = spends[0].expsk.full_viewing_key();
auto note = spends[0].note;
libzcash::SaplingPaymentAddress changeAddr(note.d, note.pk_d);
AddSaplingOutput(fvk.ovk, changeAddr, change, {});
AddSaplingOutput(fvk.ovk, changeAddr, change);
} else {
return boost::none;
}

View File

@ -86,7 +86,7 @@ public:
uint256 ovk,
libzcash::SaplingPaymentAddress to,
CAmount value,
std::array<unsigned char, ZC_MEMO_SIZE> memo);
std::array<unsigned char, ZC_MEMO_SIZE> memo = {{0xF6}});
// Assumes that the value correctly corresponds to the provided UTXO.
void AddTransparentInput(COutPoint utxo, CScript scriptPubKey, CAmount value);