Skip to content

Commit

Permalink
Move AutoCombineDust functionality to the wallet background thread
Browse files Browse the repository at this point in the history
  • Loading branch information
furszy committed Mar 10, 2021
1 parent fcb20c2 commit fcc4c83
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
12 changes: 0 additions & 12 deletions src/validation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3297,18 +3297,6 @@ bool ProcessNewBlock(CValidationState& state, CNode* pfrom, const std::shared_pt
}
}

if (pwalletMain) {
/* disable multisend
// If turned on MultiSend will send a transaction (or more) on the after maturity of a stake
if (pwalletMain->isMultiSendEnabled())
pwalletMain->MultiSend();
*/

// If turned on Auto Combine will scan wallet for dust to combine
if (pwalletMain->fCombineDust)
pwalletMain->AutoCombineDust(g_connman.get());
}

LogPrintf("%s : ACCEPTED Block %ld in %ld milliseconds with size=%d\n", __func__, newHeight, GetTimeMillis() - nStartTime,
GetSerializeSize(*pblock, SER_DISK, CLIENT_VERSION));

Expand Down
6 changes: 6 additions & 0 deletions src/wallet/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1318,6 +1318,12 @@ void CWallet::BlockConnected(const std::shared_ptr<const CBlock>& pblock, const

// Sapling: Update cached incremental witnesses
ChainTipAdded(pindex, pblock.get(), oldSaplingTree);

// Auto-combine functionality
// If turned on Auto Combine will scan wallet for dust to combine
if (fCombineDust) {
AutoCombineDust(g_connman.get());
}
}

void CWallet::BlockDisconnected(const std::shared_ptr<const CBlock>& pblock, const uint256& blockHash, int nBlockHeight, int64_t blockTime)
Expand Down

0 comments on commit fcc4c83

Please sign in to comment.