Skip to content

Commit b924af7

Browse files
committed
Fix debug setting in tobin tax code
1 parent 2166ca7 commit b924af7

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

core/vm/vmcontext/context.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -147,16 +147,16 @@ func VerifySealFn(ref *types.Header, chain chainContext) func(*types.Header) boo
147147
// If the calculation or transfer of the tax amount fails for any reason, the regular transfer goes ahead.
148148
// NB: Gas is not charged or accounted for this calculation.
149149
func TobinTransfer(evm *vm.EVM, sender, recipient common.Address, amount *big.Int) {
150+
// Run only primary evm.Call() with tracer
151+
if evm.GetDebug() {
152+
evm.SetDebug(false)
153+
defer func() { evm.SetDebug(true) }()
154+
}
155+
150156
// Only deduct tobin tax before the g hardfork
151157
if evm.ChainConfig().IsGFork(evm.Context.BlockNumber) {
152158
Transfer(evm.StateDB, sender, recipient, amount)
153159
} else {
154-
// Run only primary evm.Call() with tracer
155-
if evm.GetDebug() {
156-
evm.SetDebug(false)
157-
defer func() { evm.SetDebug(true) }()
158-
}
159-
160160
if amount.Cmp(big.NewInt(0)) != 0 {
161161
caller := &SharedEVMRunner{evm}
162162
tax, taxRecipient, err := reserve.ComputeTobinTax(caller, sender, amount)

0 commit comments

Comments
 (0)