Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
f578d41e
Commit
f578d41e
authored
Jun 24, 2019
by
Martin Holst Swende
Committed by
Péter Szilágyi
Jun 24, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core/vm, internal/ethapi: fail on eth_call when it times out, fixes #19186 (#19737)
parent
cdadf57b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
0 deletions
+9
-0
evm.go
core/vm/evm.go
+5
-0
api.go
internal/ethapi/api.go
+4
-0
No files found.
core/vm/evm.go
View file @
f578d41e
...
...
@@ -169,6 +169,11 @@ func (evm *EVM) Cancel() {
atomic
.
StoreInt32
(
&
evm
.
abort
,
1
)
}
// Cancelled returns true if Cancel has been called
func
(
evm
*
EVM
)
Cancelled
()
bool
{
return
atomic
.
LoadInt32
(
&
evm
.
abort
)
==
1
}
// Interpreter returns the current interpreter
func
(
evm
*
EVM
)
Interpreter
()
Interpreter
{
return
evm
.
interpreter
...
...
internal/ethapi/api.go
View file @
f578d41e
...
...
@@ -802,6 +802,10 @@ func DoCall(ctx context.Context, b Backend, args CallArgs, blockNr rpc.BlockNumb
if
err
:=
vmError
();
err
!=
nil
{
return
nil
,
0
,
false
,
err
}
// If the timer caused an abort, return an appropriate error message
if
evm
.
Cancelled
()
{
return
nil
,
0
,
false
,
fmt
.
Errorf
(
"execution aborted (timeout = %v)"
,
timeout
)
}
return
res
,
gas
,
failed
,
err
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment