mirror of
https://github.com/mimblewimble/grin.git
synced 2025-01-21 11:31:08 +03:00
parent
9f890643b9
commit
aa984ed550
1 changed files with 4 additions and 0 deletions
|
@ -279,6 +279,10 @@ fn build_send_tx(
|
||||||
let mut total: u64 = coins.iter().map(|c| c.value).sum();
|
let mut total: u64 = coins.iter().map(|c| c.value).sum();
|
||||||
let mut amount_with_fee = amount + fee;
|
let mut amount_with_fee = amount + fee;
|
||||||
|
|
||||||
|
if total == 0 {
|
||||||
|
return Err(ErrorKind::NotEnoughFunds(total as u64))?;
|
||||||
|
}
|
||||||
|
|
||||||
// Check if we need to use a change address
|
// Check if we need to use a change address
|
||||||
if total > amount_with_fee {
|
if total > amount_with_fee {
|
||||||
fee = tx_fee(coins.len(), 2, coins_proof_count(&coins), None);
|
fee = tx_fee(coins.len(), 2, coins_proof_count(&coins), None);
|
||||||
|
|
Loading…
Reference in a new issue