Skip to content

Commit d1912c1

Browse files
committed
Fix debug setting in tobin tax code
1 parent ad4f46f commit d1912c1

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

0 commit comments

Comments
 (0)