Skip to content

Commit

Permalink
Merge pull request #79 from PIVX-Labs/fix_subtract_from_amt
Browse files Browse the repository at this point in the history
Don't always subtract from amount
  • Loading branch information
Duddino authored Mar 6, 2024
2 parents 5a9278c + b187d01 commit f874963
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ fn choose_utxos(
}
}
if total < *amount + fee {
if total >= *amount {
if total >= *amount && *amount > fee {
*amount -= fee;
} else {
Err("Not enough balance")?;
Expand Down Expand Up @@ -537,7 +537,7 @@ fn choose_notes(
}

if total < *amount + fee {
if total >= *amount {
if total >= *amount && *amount > fee {
*amount -= fee
} else {
Err("Not enough balance")?;
Expand Down

0 comments on commit f874963

Please sign in to comment.