Skip to content

Commit a3358e8

Browse files
committed
Fix debug setting in tobin tax code
1 parent 17bd8aa commit a3358e8

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
@@ -142,16 +142,16 @@ func VerifySealFn(ref *types.Header, chain chainContext) func(*types.Header) boo
142142
// If the calculation or transfer of the tax amount fails for any reason, the regular transfer goes ahead.
143143
// NB: Gas is not charged or accounted for this calculation.
144144
func TobinTransfer(evm *vm.EVM, sender, recipient common.Address, amount *big.Int) {
145+
// Run only primary evm.Call() with tracer
146+
if evm.GetDebug() {
147+
evm.SetDebug(false)
148+
defer func() { evm.SetDebug(true) }()
149+
}
150+
145151
// Only deduct tobin tax before the g hardfork
146152
if evm.ChainConfig().IsGFork(evm.Context.BlockNumber) {
147153
Transfer(evm.StateDB, sender, recipient, amount)
148154
} else {
149-
// Run only primary evm.Call() with tracer
150-
if evm.GetDebug() {
151-
evm.SetDebug(false)
152-
defer func() { evm.SetDebug(true) }()
153-
}
154-
155155
if amount.Cmp(big.NewInt(0)) != 0 {
156156
caller := &SharedEVMRunner{evm}
157157
tax, taxRecipient, err := reserve.ComputeTobinTax(caller, sender, amount)

0 commit comments

Comments
 (0)