Rename Witnesses to include sprout or sapling

This commit is contained in:
Eirik Ogilvie-Wigley
2018-08-01 10:41:36 -06:00
parent 4fc309f0f5
commit 8ea8ef9850
14 changed files with 66 additions and 66 deletions

View File

@@ -419,7 +419,7 @@ bool AsyncRPCOperation_sendmany::main_impl() {
JSOutPoint jso = std::get<0>(t);
std::vector<JSOutPoint> vOutPoints = { jso };
uint256 inputAnchor;
std::vector<boost::optional<ZCIncrementalWitness>> vInputWitnesses;
std::vector<boost::optional<SproutWitness>> vInputWitnesses;
pwalletMain->GetSproutNoteWitnesses(vOutPoints, vInputWitnesses, inputAnchor);
jsopWitnessAnchorMap[ jso.ToString() ] = WitnessAnchorData{ vInputWitnesses[0], inputAnchor };
}
@@ -526,7 +526,7 @@ bool AsyncRPCOperation_sendmany::main_impl() {
CAmount jsInputValue = 0;
uint256 jsAnchor;
std::vector<boost::optional<ZCIncrementalWitness>> witnesses;
std::vector<boost::optional<SproutWitness>> witnesses;
JSDescription prevJoinSplit;
@@ -557,7 +557,7 @@ bool AsyncRPCOperation_sendmany::main_impl() {
}
assert(changeOutputIndex != -1);
boost::optional<ZCIncrementalWitness> changeWitness;
boost::optional<SproutWitness> changeWitness;
int n = 0;
for (const uint256& commitment : prevJoinSplit.commitments) {
tree.append(commitment);
@@ -606,7 +606,7 @@ bool AsyncRPCOperation_sendmany::main_impl() {
//
std::vector<SproutNote> vInputNotes;
std::vector<JSOutPoint> vOutPoints;
std::vector<boost::optional<ZCIncrementalWitness>> vInputWitnesses;
std::vector<boost::optional<SproutWitness>> vInputWitnesses;
uint256 inputAnchor;
int numInputsNeeded = (jsChange>0) ? 1 : 0;
while (numInputsNeeded++ < ZC_NUM_JS_INPUTS && zInputsDeque.size() > 0) {
@@ -663,7 +663,7 @@ bool AsyncRPCOperation_sendmany::main_impl() {
if (!optionalWitness) {
throw JSONRPCError(RPC_WALLET_ERROR, "Witness for note commitment is null");
}
ZCIncrementalWitness w = *optionalWitness; // could use .get();
SproutWitness w = *optionalWitness; // could use .get();
if (jsChange > 0) {
for (const uint256& commitment : previousCommitments) {
w.append(commitment);
@@ -920,7 +920,7 @@ bool AsyncRPCOperation_sendmany::find_unspent_notes() {
}
UniValue AsyncRPCOperation_sendmany::perform_joinsplit(AsyncJoinSplitInfo & info) {
std::vector<boost::optional < ZCIncrementalWitness>> witnesses;
std::vector<boost::optional < SproutWitness>> witnesses;
uint256 anchor;
{
LOCK(cs_main);
@@ -931,7 +931,7 @@ UniValue AsyncRPCOperation_sendmany::perform_joinsplit(AsyncJoinSplitInfo & info
UniValue AsyncRPCOperation_sendmany::perform_joinsplit(AsyncJoinSplitInfo & info, std::vector<JSOutPoint> & outPoints) {
std::vector<boost::optional < ZCIncrementalWitness>> witnesses;
std::vector<boost::optional < SproutWitness>> witnesses;
uint256 anchor;
{
LOCK(cs_main);
@@ -942,7 +942,7 @@ UniValue AsyncRPCOperation_sendmany::perform_joinsplit(AsyncJoinSplitInfo & info
UniValue AsyncRPCOperation_sendmany::perform_joinsplit(
AsyncJoinSplitInfo & info,
std::vector<boost::optional < ZCIncrementalWitness>> witnesses,
std::vector<boost::optional < SproutWitness>> witnesses,
uint256 anchor)
{
if (anchor.IsNull()) {