Fix bugs in excluding multiple zsweep zaddrs and report all excluded zsweep zaddrs in z_sweepstatus
This commit is contained in:
@@ -80,15 +80,16 @@ bool IsExcludedAddress(libzcash::SaplingPaymentAddress zaddr) {
|
|||||||
auto zAddressExclude = DecodePaymentAddress(sweepExcludeAddress);
|
auto zAddressExclude = DecodePaymentAddress(sweepExcludeAddress);
|
||||||
|
|
||||||
if (boost::get<libzcash::SaplingPaymentAddress>(&zAddressExclude) != nullptr) {
|
if (boost::get<libzcash::SaplingPaymentAddress>(&zAddressExclude) != nullptr) {
|
||||||
sweepExcludeAddress = boost::get<libzcash::SaplingPaymentAddress>(zAddressExclude);
|
auto excludeAddress = boost::get<libzcash::SaplingPaymentAddress>(zAddressExclude);
|
||||||
|
if (excludeAddress == zaddr) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// This is an invalid sapling zaddr
|
// This is an invalid sapling zaddr
|
||||||
LogPrintf("%s: Invalid zsweepexclude zaddr %s, ignoring\n", opid, sweepExcludeAddress);
|
LogPrintf("%s: Invalid zsweepexclude zaddr %s, ignoring\n", sweepExcludeAddress);
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sweepExcludeAddress == entry.address) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
@@ -142,7 +143,7 @@ bool AsyncRPCOperation_sweep::main_impl() {
|
|||||||
// Map all notes (zutxos) by address
|
// Map all notes (zutxos) by address
|
||||||
for (auto & entry : saplingEntries) {
|
for (auto & entry : saplingEntries) {
|
||||||
// do not need to sweep Excluded Addresses
|
// do not need to sweep Excluded Addresses
|
||||||
if(IsExcludedAddress(entry.address) {
|
if(IsExcludedAddress(entry.address)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3370,10 +3370,9 @@ UniValue z_sweepstatus(const UniValue& params, bool fHelp, const CPubKey& mypk)
|
|||||||
ret.push_back(Pair("zsweepinterval", pwalletMain->sweepInterval));
|
ret.push_back(Pair("zsweepinterval", pwalletMain->sweepInterval));
|
||||||
ret.push_back(Pair("zsweepaddress", pwalletMain->sweepAddress));
|
ret.push_back(Pair("zsweepaddress", pwalletMain->sweepAddress));
|
||||||
UniValue excludes(UniValue::VARR);
|
UniValue excludes(UniValue::VARR);
|
||||||
// BOOST_FOREACH(const std::string& exclude, pwalletMain->sweepExcludeAddresses ) {
|
BOOST_FOREACH(const std::string& exclude, pwalletMain->sweepExcludeAddresses ) {
|
||||||
// excludes.push_back(exclude);
|
excludes.push_back(exclude);
|
||||||
// }
|
}
|
||||||
excludes.push_back( pwalletMain->sweepExcludeAddress );
|
|
||||||
ret.push_back(Pair("zsweepexclude", excludes));
|
ret.push_back(Pair("zsweepexclude", excludes));
|
||||||
ret.push_back(Pair("zsweepmaxinputs", pwalletMain->sweepMaxInputs));
|
ret.push_back(Pair("zsweepmaxinputs", pwalletMain->sweepMaxInputs));
|
||||||
ret.push_back(Pair("zsweepfee", pwalletMain->sweepFee));
|
ret.push_back(Pair("zsweepfee", pwalletMain->sweepFee));
|
||||||
|
|||||||
Reference in New Issue
Block a user