Skip to content

Commit dfebc25

Browse files
xdustinfaceUdjinM6
andauthored
Apply suggestions from code review
Co-authored-by: UdjinM6 <[email protected]>
1 parent a4620e4 commit dfebc25

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/privatesend/privatesend-client.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1653,7 +1653,7 @@ bool CPrivateSendClientSession::CreateDenominated(CAmount nBalanceToDenominate,
16531653
while(true) {
16541654
// Create an potential output
16551655
vecOutputs.push_back(nAmount);
1656-
if (!txBuilder.TryAddOutputs(vecOutputs) || txBuilder.CountOutputs() + vecOutputs.size() >= PRIVATESEND_DENOM_OUTPUTS_THRESHOLD) {
1656+
if (!txBuilder.TryAddOutputs(vecOutputs) || txBuilder.CountOutputs() + vecOutputs.size() > PRIVATESEND_DENOM_OUTPUTS_THRESHOLD) {
16571657
// If its not possible to add it due to insufficient amount left or total number of outputs exceeds
16581658
// PRIVATESEND_DENOM_OUTPUTS_THRESHOLD drop the output again and stop trying.
16591659
vecOutputs.pop_back();

src/wallet/wallet.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3975,7 +3975,7 @@ bool CWallet::CreateTransaction(const std::vector<CRecipient>& vecSend, CWalletT
39753975
// change output. Only try this once.
39763976
if (nChangePosInOut == -1 && nSubtractFeeFromAmount == 0 && pick_new_inputs) {
39773977
// Adding another output can change the serialized size of the vout size
3978-
unsigned int tx_size_with_change = nBytes + change_prototype_size + GetSizeOfCompactSizeDiff(0, txNew.vout.size() + 1);
3978+
unsigned int tx_size_with_change = nBytes + change_prototype_size + GetSizeOfCompactSizeDiff(txNew.vout.size(), txNew.vout.size() + 1);
39793979
CAmount fee_needed_with_change = GetMinimumFee(tx_size_with_change, coin_control, ::mempool, ::feeEstimator, nullptr);
39803980
CAmount minimum_value_for_change = GetDustThreshold(change_prototype_txout, discard_rate);
39813981
if (nFeeRet >= fee_needed_with_change + minimum_value_for_change) {

0 commit comments

Comments
 (0)