From 52a85f583e7554666f8c07728488d8b5b3d6e5ca Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 17 Dec 2018 02:55:47 -1100 Subject: [PATCH 1/3] Test merge --- src/wallet/rpcwallet.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index f8b507403..34035908d 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -4789,8 +4789,8 @@ UniValue z_mergetoaddress(const UniValue& params, bool fHelp) if (useAnySprout || useAnySapling || zaddrs.size() > 0) { // Get available notes std::vector sproutEntries; - std::vector saplingEntries; - pwalletMain->GetFilteredNotes(sproutEntries, saplingEntries, zaddrs); + std::vector saplingEntries,skipsapling; + pwalletMain->GetFilteredNotes(sproutEntries, useAnySprout != 0 ? saplingEntries : skipsapling, zaddrs); // If Sapling is not active, do not allow sending from a sapling addresses. if (!saplingActive && saplingEntries.size() > 0) { From 89c6763a8f1d3fae49b2fb1e38946ef076d20cd6 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 17 Dec 2018 03:25:44 -1100 Subject: [PATCH 2/3] Mutually exclude merging sprout vs sapling --- src/wallet/rpcwallet.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 34035908d..1d6f056da 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -4788,9 +4788,9 @@ UniValue z_mergetoaddress(const UniValue& params, bool fHelp) if (useAnySprout || useAnySapling || zaddrs.size() > 0) { // Get available notes - std::vector sproutEntries; + std::vector sproutEntries,skipsprout; std::vector saplingEntries,skipsapling; - pwalletMain->GetFilteredNotes(sproutEntries, useAnySprout != 0 ? saplingEntries : skipsapling, zaddrs); + pwalletMain->GetFilteredNotes(useAnySprout != 0 ? sproutEntries : skipsprout, useAnySapling != 0 ? saplingEntries : skipsapling, zaddrs); // If Sapling is not active, do not allow sending from a sapling addresses. if (!saplingActive && saplingEntries.size() > 0) { From 97fe83f4b3f969af56a0d4bded33c2b01d78750c Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 17 Dec 2018 04:12:47 -1100 Subject: [PATCH 3/3] Test any sprout --- src/wallet/rpcwallet.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 1d6f056da..bd1ae56d6 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -4790,7 +4790,7 @@ UniValue z_mergetoaddress(const UniValue& params, bool fHelp) // Get available notes std::vector sproutEntries,skipsprout; std::vector saplingEntries,skipsapling; - pwalletMain->GetFilteredNotes(useAnySprout != 0 ? sproutEntries : skipsprout, useAnySapling != 0 ? saplingEntries : skipsapling, zaddrs); + pwalletMain->GetFilteredNotes(sproutEntries, useAnySprout == 0 ? saplingEntries : skipsapling, zaddrs); // If Sapling is not active, do not allow sending from a sapling addresses. if (!saplingActive && saplingEntries.size() > 0) {