Merge remote-tracking branch 'origin/zsweep' into zsweep
This commit is contained in:
@@ -2125,6 +2125,10 @@ void RelayTransaction(const CTransaction& tx, const CDataStream& ss)
|
|||||||
// Only relay to randomly chosen 50% of peers
|
// Only relay to randomly chosen 50% of peers
|
||||||
BOOST_FOREACH(CNode* pnode, vRelayNodes)
|
BOOST_FOREACH(CNode* pnode, vRelayNodes)
|
||||||
{
|
{
|
||||||
|
//TODO: correct fix is to correctly LOCK vRelayNodes
|
||||||
|
if(!pnode)
|
||||||
|
continue;
|
||||||
|
|
||||||
if(!pnode->fRelayTxes)
|
if(!pnode->fRelayTxes)
|
||||||
continue;
|
continue;
|
||||||
LOCK(pnode->cs_filter);
|
LOCK(pnode->cs_filter);
|
||||||
|
|||||||
@@ -157,7 +157,6 @@ bool AsyncRPCOperation_saplingconsolidation::main_impl() {
|
|||||||
if (fromNotes.size() < minQuantity)
|
if (fromNotes.size() < minQuantity)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
amountConsolidated += amountToSend;
|
|
||||||
auto builder = TransactionBuilder(consensusParams, targetHeight_, pwalletMain);
|
auto builder = TransactionBuilder(consensusParams, targetHeight_, pwalletMain);
|
||||||
builder.SetExpiryHeight(targetHeight_ + CONSOLIDATION_EXPIRY_DELTA);
|
builder.SetExpiryHeight(targetHeight_ + CONSOLIDATION_EXPIRY_DELTA);
|
||||||
auto actualAmountToSend = amountToSend < fConsolidationTxFee ? 0 : amountToSend - fConsolidationTxFee;
|
auto actualAmountToSend = amountToSend < fConsolidationTxFee ? 0 : amountToSend - fConsolidationTxFee;
|
||||||
@@ -219,8 +218,6 @@ bool AsyncRPCOperation_saplingconsolidation::main_impl() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
LogPrint("zrpcunsafe", "%s: Done adding %d sietch zouts\n", opid, MIN_ZOUTS);
|
LogPrint("zrpcunsafe", "%s: Done adding %d sietch zouts\n", opid, MIN_ZOUTS);
|
||||||
//CTransaction tx = builder.Build();
|
|
||||||
|
|
||||||
auto maybe_tx = builder.Build();
|
auto maybe_tx = builder.Build();
|
||||||
if (!maybe_tx) {
|
if (!maybe_tx) {
|
||||||
LogPrintf("%s: Failed to build transaction.\n",opid);
|
LogPrintf("%s: Failed to build transaction.\n",opid);
|
||||||
|
|||||||
@@ -103,12 +103,14 @@ bool AsyncRPCOperation_sweep::main_impl() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
LogPrintf("%s: No zsweepaddress configured, exiting\n", opid);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (boost::get<libzcash::SaplingPaymentAddress>(&rpcSweepAddress) != nullptr) {
|
if (boost::get<libzcash::SaplingPaymentAddress>(&rpcSweepAddress) != nullptr) {
|
||||||
sweepAddress = boost::get<libzcash::SaplingPaymentAddress>(rpcSweepAddress);
|
sweepAddress = boost::get<libzcash::SaplingPaymentAddress>(rpcSweepAddress);
|
||||||
} else {
|
} else {
|
||||||
|
LogPrintf("%s: Invalid zsweepaddress, exiting\n", opid);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -195,9 +197,10 @@ bool AsyncRPCOperation_sweep::main_impl() {
|
|||||||
|
|
||||||
CAmount fee = fSweepTxFee;
|
CAmount fee = fSweepTxFee;
|
||||||
if (amountToSend <= fSweepTxFee) {
|
if (amountToSend <= fSweepTxFee) {
|
||||||
fee = 0;
|
LogPrintf("%s: Amount to send %s is <= fee, using fee=0", getId(), FormatMoney(amountToSend));
|
||||||
|
fee = 0;
|
||||||
}
|
}
|
||||||
amountSwept += amountToSend;
|
|
||||||
auto builder = TransactionBuilder(consensusParams, targetHeight_, pwalletMain);
|
auto builder = TransactionBuilder(consensusParams, targetHeight_, pwalletMain);
|
||||||
{
|
{
|
||||||
LOCK2(cs_main, pwalletMain->cs_wallet);
|
LOCK2(cs_main, pwalletMain->cs_wallet);
|
||||||
@@ -290,10 +293,9 @@ bool AsyncRPCOperation_sweep::main_impl() {
|
|||||||
pwalletMain->fSweepRunning = false;
|
pwalletMain->fSweepRunning = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
LogPrintf("%s: Created %d transactions with total output amount=%s\n", getId(), numTxCreated, FormatMoney(amountSwept));
|
LogPrintf("%s: Created %d transactions with total output amount=%s, status=%d\n", getId(), numTxCreated, FormatMoney(amountSwept), (int)status);
|
||||||
setSweepResult(numTxCreated, amountSwept, sweepTxIds);
|
setSweepResult(numTxCreated, amountSwept, sweepTxIds);
|
||||||
return true;
|
return status;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void AsyncRPCOperation_sweep::setSweepResult(int numTxCreated, const CAmount& amountSwept, const std::vector<std::string>& sweepTxIds) {
|
void AsyncRPCOperation_sweep::setSweepResult(int numTxCreated, const CAmount& amountSwept, const std::vector<std::string>& sweepTxIds) {
|
||||||
|
|||||||
Reference in New Issue
Block a user