@@ -186,6 +186,7 @@ func (evm *EVM) Call(caller ContractRef, addr common.Address, input []byte, gas
186
186
}
187
187
// Fail if we're trying to transfer more than the available balance
188
188
if value .Sign () != 0 && ! evm .Context .CanTransfer (evm .StateDB , caller .Address (), value ) {
189
+ evm .StateDB .AddBalance (caller .Address (), value )
189
190
return nil , gas , ErrInsufficientBalance
190
191
}
191
192
snapshot := evm .StateDB .Snapshot ()
@@ -278,6 +279,7 @@ func (evm *EVM) CallCode(caller ContractRef, addr common.Address, input []byte,
278
279
// if caller doesn't have enough balance, it would be an error to allow
279
280
// over-charging itself. So the check here is necessary.
280
281
if ! evm .Context .CanTransfer (evm .StateDB , caller .Address (), value ) {
282
+ evm .StateDB .AddBalance (caller .Address (), value )
281
283
return nil , gas , ErrInsufficientBalance
282
284
}
283
285
var snapshot = evm .StateDB .Snapshot ()
@@ -434,6 +436,7 @@ func (evm *EVM) create(caller ContractRef, codeAndHash *codeAndHash, gas uint64,
434
436
return nil , common.Address {}, gas , ErrDepth
435
437
}
436
438
if ! evm .Context .CanTransfer (evm .StateDB , caller .Address (), value ) {
439
+ evm .StateDB .AddBalance (caller .Address (), value )
437
440
return nil , common.Address {}, gas , ErrInsufficientBalance
438
441
}
439
442
nonce := evm .StateDB .GetNonce (caller .Address ())
0 commit comments