mirror of
https://github.com/dashpay/dash.git
synced 2024-12-26 20:42:59 +01:00
fix(coinjoin): CreateDenominated crash (#4838)
We overshoot (intentionally) and nBalanceToDenominate can become negative because of that. It was fine with raw loops but irange throws an exception here.
This commit is contained in:
parent
e95655cd9f
commit
b582524939
@ -1697,6 +1697,7 @@ bool CCoinJoinClientSession::CreateDenominated(CAmount nBalanceToDenominate, con
|
|||||||
|
|
||||||
// Go big to small
|
// Go big to small
|
||||||
for (auto nDenomValue : denoms) {
|
for (auto nDenomValue : denoms) {
|
||||||
|
if (nBalanceToDenominate <= 0) break;
|
||||||
int nOutputs = 0;
|
int nOutputs = 0;
|
||||||
|
|
||||||
// Number of denoms we can create given our denom and the amount of funds we have left
|
// Number of denoms we can create given our denom and the amount of funds we have left
|
||||||
|
Loading…
Reference in New Issue
Block a user