Skip to content

Commit

Permalink
don't create outputs that are less than target amount
Browse files Browse the repository at this point in the history
  • Loading branch information
backpacker69 committed May 10, 2024
1 parent 89823cc commit f089eed
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/wallet/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3876,7 +3876,7 @@ bool CWallet::CreateCoinStake(ChainstateManager& chainman, const CWallet* pwalle
double ratio = current / nTargetOutputAmount;
// Obtain the optimal number of outputs and clamp it to maxOutputs to ensure the fee is not exceeded
int desiredOutputs = std::min(
int(std::floor((std::sqrt(4 * std::pow(ratio, 2) + 1) + 1) / 2)),
std::max(int(ratio), 1),
maxOutputs
);

Expand Down

0 comments on commit f089eed

Please sign in to comment.