Skip to content

Commit 7d2e4d8

Browse files
committed
Simplify logic
1 parent d1912c1 commit 7d2e4d8

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

core/vm/vmcontext/context.go

+4-7
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,7 @@ func TobinTransfer(evm *vm.EVM, sender, recipient common.Address, amount *big.In
155155
}
156156

157157
// Only deduct tobin tax before the g hardfork
158-
if evm.ChainConfig().IsGFork(evm.Context.BlockNumber) {
159-
Transfer(evm.StateDB, sender, recipient, amount)
160-
} else {
158+
if !evm.ChainConfig().IsGFork(evm.Context.BlockNumber) {
161159
if amount.Cmp(big.NewInt(0)) != 0 {
162160
caller := &SharedEVMRunner{evm}
163161
tax, taxRecipient, err := reserve.ComputeTobinTax(caller, sender, amount)
@@ -169,9 +167,8 @@ func TobinTransfer(evm *vm.EVM, sender, recipient common.Address, amount *big.In
169167
log.Error("Failed to get tobin tax", "error", err)
170168
}
171169
}
172-
173-
// Complete a normal transfer if the amount is 0 or the tobin tax value is unable to be fetched and parsed.
174-
// We transfer even when the amount is 0 because state trie clearing [EIP161] is necessary at the end of a transaction
175-
Transfer(evm.StateDB, sender, recipient, amount)
176170
}
171+
// Complete a normal transfer if we're past the g fork, the amount is 0 or the tobin tax value is unable to be fetched and parsed.
172+
// We transfer even when the amount is 0 because state trie clearing [EIP161] is necessary at the end of a transaction
173+
Transfer(evm.StateDB, sender, recipient, amount)
177174
}

0 commit comments

Comments
 (0)