Warning for going negative for *data balance, only when not dryRun

This commit is contained in:
DanB
2017-07-04 11:59:05 +02:00
parent 2b1f5e1ff1
commit 7968e112cb

View File

@@ -482,7 +482,8 @@ func (b *Balance) debitUnits(cd *CallDescriptor, ub *Account, moneyBalances Bala
break
}
}
if cost != 0 && moneyBal == nil { // Fix for issue #685
if cost != 0 && moneyBal == nil && (!dryRun || ub.AllowNegative) { // Fix for issue #685
utils.Logger.Err(fmt.Sprintf("<RALs> Going negative on account %s with AllowNegative: false", cd.GetAccountKey()))
moneyBal = ub.GetDefaultMoneyBalance()
}
if (cost == 0 || moneyBal != nil) && b.GetValue() >= amount {