From a45c81e13455d041ee3db58ad58503418a00966f Mon Sep 17 00:00:00 2001 From: Duke Leto Date: Thu, 23 Jan 2020 10:09:01 -0500 Subject: [PATCH] Create more data that is needed for making our fake Sapling SpendDescription --- src/wallet/asyncrpcoperation_sendmany.cpp | 1 + src/wallet/rpcwallet.cpp | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/wallet/asyncrpcoperation_sendmany.cpp b/src/wallet/asyncrpcoperation_sendmany.cpp index e4a34ab2d..f5bee70b0 100644 --- a/src/wallet/asyncrpcoperation_sendmany.cpp +++ b/src/wallet/asyncrpcoperation_sendmany.cpp @@ -1159,6 +1159,7 @@ bool AsyncRPCOperation_sendmany::find_unspent_notes() { } // sort in descending order, so big notes appear first + //TODO: what are the performance and metadata leakage implications of this? std::sort(z_sprout_inputs_.begin(), z_sprout_inputs_.end(), [](SendManyInputJSOP i, SendManyInputJSOP j) -> bool { return std::get<2>(i) > std::get<2>(j); diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 53347c2cd..77cac9070 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -913,10 +913,13 @@ UniValue z_signmessage(const UniValue& params, bool fHelp, const CPubKey& mypk) // Create data needed to make a SpendDescription SaplingExpandedSpendingKey expsk; + SpendingKey spendingkey_ = boost::apply_visitor(GetSpendingKeyForPaymentAddress(pwalletMain), res).get(); auto sk = boost::get(spendingkey_); expsk = sk.expsk; uint256 ovk = expsk.full_viewing_key().ovk; + SaplingNoteEntry noteEntry; + // TODO: get sig data, serialized, encode, return CHashWriter ss(SER_GETHASH, 0); // TODO: different magic? @@ -939,7 +942,10 @@ UniValue z_signmessage(const UniValue& params, bool fHelp, const CPubKey& mypk) vector vchSig; //TODO: Actually get sig data SpendDescription shieldedSpend; - SpendDescriptionInfo spend; + SaplingNote fakenote; + uint256 anchor; + SaplingWitness witness; + SpendDescriptionInfo spend = SpendDescriptionInfo(expsk, fakenote, anchor, witness); librustzcash_sapling_spend_sig( spend.expsk.ask.begin(), spend.alpha.begin(),