mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 15:16:43 +00:00
Skip looking up interruptedTxCache if it is not initialized
This commit is contained in:
parent
01dd019c5e
commit
badb574b25
1 changed files with 9 additions and 0 deletions
|
|
@ -278,6 +278,10 @@ func (in *EVMInterpreter) Run(contract *Contract, input []byte, readOnly bool, i
|
||||||
txHash, _ := GetCurrentTxFromContext(interruptCtx)
|
txHash, _ := GetCurrentTxFromContext(interruptCtx)
|
||||||
interruptedTxCache, _ := GetCache(interruptCtx)
|
interruptedTxCache, _ := GetCache(interruptCtx)
|
||||||
|
|
||||||
|
if interruptedTxCache == nil {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
// if the tx is already in the cache, it means that it has been interrupted before and we will not interrupt it again
|
// if the tx is already in the cache, it means that it has been interrupted before and we will not interrupt it again
|
||||||
found, _ := interruptedTxCache.Cache.ContainsOrAdd(txHash, true)
|
found, _ := interruptedTxCache.Cache.ContainsOrAdd(txHash, true)
|
||||||
if found {
|
if found {
|
||||||
|
|
@ -437,6 +441,11 @@ func (in *EVMInterpreter) RunWithDelay(contract *Contract, input []byte, readOnl
|
||||||
case <-interruptCtx.Done():
|
case <-interruptCtx.Done():
|
||||||
txHash, _ := GetCurrentTxFromContext(interruptCtx)
|
txHash, _ := GetCurrentTxFromContext(interruptCtx)
|
||||||
interruptedTxCache, _ := GetCache(interruptCtx)
|
interruptedTxCache, _ := GetCache(interruptCtx)
|
||||||
|
|
||||||
|
if interruptedTxCache == nil {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
// if the tx is already in the cache, it means that it has been interrupted before and we will not interrupt it again
|
// if the tx is already in the cache, it means that it has been interrupted before and we will not interrupt it again
|
||||||
found, _ := interruptedTxCache.Cache.ContainsOrAdd(txHash, true)
|
found, _ := interruptedTxCache.Cache.ContainsOrAdd(txHash, true)
|
||||||
log.Info("FOUND", "found", found, "txHash", txHash)
|
log.Info("FOUND", "found", found, "txHash", txHash)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue