Generate an ovk to encrypt outCiphertext for t-addr senders

Closes #3506.
This commit is contained in:
Jack Grigg
2018-09-19 00:51:30 +01:00
parent bd3c860cb4
commit bb4b6982e3
4 changed files with 143 additions and 1 deletions

View File

@@ -386,7 +386,17 @@ bool AsyncRPCOperation_sendmany::main_impl() {
expsk = sk.expsk;
ovk = expsk.full_viewing_key().ovk;
} else {
// TODO: Set "from" to something!
// Sending from a t-address, which we don't have an ovk for. Instead,
// generate a common one from the HD seed. This ensures the data is
// recoverable, while keeping it logically separate from the ZIP 32
// Sapling key hierarchy, which the user might not be using.
HDSeed seed;
if (!pwalletMain->GetHDSeed(seed)) {
throw JSONRPCError(
RPC_WALLET_ERROR,
"CWallet::GenerateNewSaplingZKey(): HD seed not found");
}
ovk = ovkForShieldingFromTaddr(seed);
}
// Set change address if we are using transparent funds