From 7968e112cbaba184e2dda9eaa36da4f1dd94565a Mon Sep 17 00:00:00 2001 From: DanB Date: Tue, 4 Jul 2017 11:59:05 +0200 Subject: [PATCH] Warning for going negative for *data balance, only when not dryRun --- engine/balances.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 {