diff --git a/engine/balances.go b/engine/balances.go index f886ab96a..c9a8d8592 100644 --- a/engine/balances.go +++ b/engine/balances.go @@ -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(" Going negative on account %s with AllowNegative: false", cd.GetAccountKey())) moneyBal = ub.GetDefaultMoneyBalance() } if (cost == 0 || moneyBal != nil) && b.GetValue() >= amount {