Revert "Reduce use of global pzcashParams with private member variable"

This reverts commit 4d71ba58d37eb4f93d68b5e437086ce14fb24825.
This commit is contained in:
Simon 2016-09-07 08:29:13 -07:00
parent 4b32c16ba5
commit 5f8118c8a4
2 changed files with 6 additions and 8 deletions

View File

@ -71,8 +71,6 @@ AsyncRPCOperation_sendmany::AsyncRPCOperation_sendmany(
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, string("runtime error: ") + e.what());
}
}
zcashParams_ = pzcashParams; // global
}
AsyncRPCOperation_sendmany::~AsyncRPCOperation_sendmany() {
@ -449,7 +447,7 @@ bool AsyncRPCOperation_sendmany::main_impl() {
// Decrypt the change note's ciphertext to retrieve some data we need
ZCNoteDecryption decryptor(spendingkey_.viewing_key());
auto hSig = prevJoinSplit.h_sig(*zcashParams_, tx_.joinSplitPubKey);
auto hSig = prevJoinSplit.h_sig(*pzcashParams, tx_.joinSplitPubKey);
try {
NotePlaintext plaintext = NotePlaintext::decrypt(
decryptor,
@ -731,7 +729,7 @@ bool AsyncRPCOperation_sendmany::find_unspent_notes() {
}
// determine amount of funds in the note
auto hSig = wtx.vjoinsplit[i].h_sig(*zcashParams_, wtx.joinSplitPubKey);
auto hSig = wtx.vjoinsplit[i].h_sig(*pzcashParams, wtx.joinSplitPubKey);
try {
NotePlaintext plaintext = NotePlaintext::decrypt(
decryptor,
@ -834,7 +832,7 @@ Object AsyncRPCOperation_sendmany::perform_joinsplit(
);
// Generate the proof, this can take over a minute.
JSDescription jsdesc(*zcashParams_,
JSDescription jsdesc(*pzcashParams,
joinSplitPubKey_,
anchor,
{info.vjsin[0], info.vjsin[1]},
@ -885,7 +883,7 @@ Object AsyncRPCOperation_sendmany::perform_joinsplit(
ss2 << ((unsigned char) 0x00);
ss2 << jsdesc.ephemeralKey;
ss2 << jsdesc.ciphertexts[0];
ss2 << jsdesc.h_sig(*zcashParams_, joinSplitPubKey_);
ss2 << jsdesc.h_sig(*pzcashParams, joinSplitPubKey_);
encryptedNote1 = HexStr(ss2.begin(), ss2.end());
}
@ -894,7 +892,7 @@ Object AsyncRPCOperation_sendmany::perform_joinsplit(
ss2 << ((unsigned char) 0x01);
ss2 << jsdesc.ephemeralKey;
ss2 << jsdesc.ciphertexts[1];
ss2 << jsdesc.h_sig(*zcashParams_, joinSplitPubKey_);
ss2 << jsdesc.h_sig(*pzcashParams, joinSplitPubKey_);
encryptedNote2 = HexStr(ss2.begin(), ss2.end());
}

View File

@ -69,7 +69,7 @@ private:
uint256 joinSplitPubKey_;
unsigned char joinSplitPrivKey_[crypto_sign_SECRETKEYBYTES];
ZCJoinSplit *zcashParams_;
std::vector<SendManyRecipient> t_outputs_;
std::vector<SendManyRecipient> z_outputs_;