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
51c3290b
Unverified
Commit
51c3290b
authored
Nov 11, 2019
by
Martin Holst Swende
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
internal/ethapi: don't query wallets at every execution of gas estimation
parent
93422e9d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
api.go
internal/ethapi/api.go
+12
-0
No files found.
internal/ethapi/api.go
View file @
51c3290b
...
...
@@ -906,6 +906,18 @@ func DoEstimateGas(ctx context.Context, b Backend, args CallArgs, blockNrOrHash
}
cap
=
hi
// Set sender address or use a default if none specified
if
args
.
From
==
nil
{
if
wallets
:=
b
.
AccountManager
()
.
Wallets
();
len
(
wallets
)
>
0
{
if
accounts
:=
wallets
[
0
]
.
Accounts
();
len
(
accounts
)
>
0
{
args
.
From
=
&
accounts
[
0
]
.
Address
}
}
}
// Use zero-address if none other is available
if
args
.
From
==
nil
{
args
.
From
=
&
common
.
Address
{}
}
// Create a helper to check if a gas allowance results in an executable transaction
executable
:=
func
(
gas
uint64
)
bool
{
args
.
Gas
=
(
*
hexutil
.
Uint64
)(
&
gas
)
...
...
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