Browse Source
Use the correct empty memo for Sapling outputs
pull/4/head
Jack Grigg
6 years ago
No known key found for this signature in database
GPG Key ID: 1B8D649257DB0829
2 changed files with
3 additions and
3 deletions
-
src/transaction_builder.cpp
-
src/transaction_builder.h
|
|
@ -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; |
|
|
|
} |
|
|
|
|
|
@ -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); |
|
|
|