skip excluded address from zsweep
This commit is contained in:
@@ -88,12 +88,18 @@ bool AsyncRPCOperation_sweep::main_impl() {
|
|||||||
|
|
||||||
std::vector<SaplingNoteEntry> saplingEntries;
|
std::vector<SaplingNoteEntry> saplingEntries;
|
||||||
libzcash::SaplingPaymentAddress sweepAddress;
|
libzcash::SaplingPaymentAddress sweepAddress;
|
||||||
|
libzcash::SaplingPaymentAddress sweepExcludeAddress;
|
||||||
std::map<libzcash::SaplingPaymentAddress, std::vector<SaplingNoteEntry>> mapAddresses;
|
std::map<libzcash::SaplingPaymentAddress, std::vector<SaplingNoteEntry>> mapAddresses;
|
||||||
|
|
||||||
{
|
{
|
||||||
LOCK2(cs_main, pwalletMain->cs_wallet);
|
LOCK2(cs_main, pwalletMain->cs_wallet);
|
||||||
pwalletMain->GetFilteredNotes(saplingEntries, "", 11);
|
pwalletMain->GetFilteredNotes(saplingEntries, "", 11);
|
||||||
|
|
||||||
if (!fromRPC_) {
|
if (!fromRPC_) {
|
||||||
|
auto zAddressExclude = DecodePaymentAddress(pwalletMain->sweepExcludeAddress);
|
||||||
|
if (boost::get<libzcash::SaplingPaymentAddress>(&zAddressExclude) != nullptr) {
|
||||||
|
sweepExcludeAddress = boost::get<libzcash::SaplingPaymentAddress>(zAddressExclude);
|
||||||
|
}
|
||||||
if (fSweepMapUsed) {
|
if (fSweepMapUsed) {
|
||||||
const vector<string>& v = mapMultiArgs["-zsweepaddress"];
|
const vector<string>& v = mapMultiArgs["-zsweepaddress"];
|
||||||
for(int i = 0; i < v.size(); i++) {
|
for(int i = 0; i < v.size(); i++) {
|
||||||
@@ -115,8 +121,11 @@ bool AsyncRPCOperation_sweep::main_impl() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Map all notes by address
|
||||||
for (auto & entry : saplingEntries) {
|
for (auto & entry : saplingEntries) {
|
||||||
//Map all notes by address
|
// do not need to sweep Excluded Address
|
||||||
|
if (sweepExcludeAddress == entry.address) { continue; }
|
||||||
|
// do not need to sweep the sweepAddress as that is the destination
|
||||||
if (sweepAddress == entry.address) {
|
if (sweepAddress == entry.address) {
|
||||||
continue;
|
continue;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user