Fix compile issues in z_consolidationstatus
This commit is contained in:
@@ -2100,6 +2100,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
|
|||||||
if (pwalletMain->fSaplingConsolidationEnabled) {
|
if (pwalletMain->fSaplingConsolidationEnabled) {
|
||||||
//Validate 1 Consolidation address only that matches the sweep address
|
//Validate 1 Consolidation address only that matches the sweep address
|
||||||
vector<string>& vaddresses = mapMultiArgs["-consolidatesaplingaddress"];
|
vector<string>& vaddresses = mapMultiArgs["-consolidatesaplingaddress"];
|
||||||
|
pwalletMain->consolidationAddress = vaddresses[0];
|
||||||
if (vaddresses.size() == 0) {
|
if (vaddresses.size() == 0) {
|
||||||
fConsolidationMapUsed = true;
|
fConsolidationMapUsed = true;
|
||||||
mapMultiArgs["-consolidatesaplingaddress"] = vSweep;
|
mapMultiArgs["-consolidatesaplingaddress"] = vSweep;
|
||||||
|
|||||||
@@ -108,7 +108,6 @@ bool AsyncRPCOperation_saplingconsolidation::main_impl() {
|
|||||||
if (boost::get<libzcash::SaplingPaymentAddress>(&zAddress) != nullptr) {
|
if (boost::get<libzcash::SaplingPaymentAddress>(&zAddress) != nullptr) {
|
||||||
libzcash::SaplingPaymentAddress saplingAddress = boost::get<libzcash::SaplingPaymentAddress>(zAddress);
|
libzcash::SaplingPaymentAddress saplingAddress = boost::get<libzcash::SaplingPaymentAddress>(zAddress);
|
||||||
addresses.insert(saplingAddress);
|
addresses.insert(saplingAddress);
|
||||||
consolidationAddress = zAddress;
|
|
||||||
} else {
|
} else {
|
||||||
LogPrintf("%s: Invalid zaddr, exiting\n", opid);
|
LogPrintf("%s: Invalid zaddr, exiting\n", opid);
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -3334,12 +3334,13 @@ UniValue z_consolidationstatus(const UniValue& params, bool fHelp, const CPubKey
|
|||||||
LOCK2(cs_main, pwalletMain->cs_wallet);
|
LOCK2(cs_main, pwalletMain->cs_wallet);
|
||||||
|
|
||||||
UniValue ret(UniValue::VOBJ);
|
UniValue ret(UniValue::VOBJ);
|
||||||
ret.push_back(Pair("consolidation", pwalletMain->fConsolidationEnabled));
|
ret.push_back(Pair("consolidation", pwalletMain->fSaplingConsolidationEnabled));
|
||||||
ret.push_back(Pair("running", pwalletMain->fConsolidationRunning));
|
ret.push_back(Pair("running", pwalletMain->fConsolidationRunning));
|
||||||
ret.push_back(Pair("amount_consolidated", pwalletMain->amountConsolidated));
|
ret.push_back(Pair("amount_consolidated", pwalletMain->amountConsolidated));
|
||||||
|
|
||||||
if (pwalletMain->fConsolidationRunning) {
|
if (pwalletMain->fConsolidationRunning) {
|
||||||
ret.push_back(Pair("next_consolidation", pwalletMain->consolidationInterval + chainActive.Tip()->GetHeight()));
|
// TODO: set a static consolidationInterval instead of it being non-deterministic
|
||||||
|
// ret.push_back(Pair("next_consolidation", pwalletMain->consolidationInterval + chainActive.Tip()->GetHeight()));
|
||||||
} else {
|
} else {
|
||||||
if (pwalletMain->nextConsolidation == 0) {
|
if (pwalletMain->nextConsolidation == 0) {
|
||||||
ret.push_back(Pair("next_consolidation", chainActive.Tip()->GetHeight() + 1));
|
ret.push_back(Pair("next_consolidation", chainActive.Tip()->GetHeight() + 1));
|
||||||
@@ -3347,7 +3348,7 @@ UniValue z_consolidationstatus(const UniValue& params, bool fHelp, const CPubKey
|
|||||||
ret.push_back(Pair("next_consolidation", pwalletMain->nextConsolidation));
|
ret.push_back(Pair("next_consolidation", pwalletMain->nextConsolidation));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ret.push_back(Pair("consolidationinterval", pwalletMain->consolidationInterval));
|
// ret.push_back(Pair("consolidationinterval", pwalletMain->consolidationInterval));
|
||||||
ret.push_back(Pair("consolidationaddress", pwalletMain->consolidationAddress));
|
ret.push_back(Pair("consolidationaddress", pwalletMain->consolidationAddress));
|
||||||
ret.push_back(Pair("consolidationtxfee",(int)fConsolidationTxFee));
|
ret.push_back(Pair("consolidationtxfee",(int)fConsolidationTxFee));
|
||||||
|
|
||||||
|
|||||||
@@ -809,6 +809,7 @@ public:
|
|||||||
bool fSweepRunning = false;
|
bool fSweepRunning = false;
|
||||||
int nextSweep = 0;
|
int nextSweep = 0;
|
||||||
int amountSwept = 0;
|
int amountSwept = 0;
|
||||||
|
int amountConsolidated = 0;
|
||||||
int sweepInterval = 20;
|
int sweepInterval = 20;
|
||||||
int sweepFee = 10000;
|
int sweepFee = 10000;
|
||||||
int sweepMaxInputs = 200;
|
int sweepMaxInputs = 200;
|
||||||
|
|||||||
Reference in New Issue
Block a user