Do not add to amountConsolidated until we successfully create the tx and only do it once
This commit is contained in:
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user