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
60070fe5
Unverified
Commit
60070fe5
authored
1 year ago
by
Christopher Harrison
Committed by
GitHub
1 year ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
internal/ethapi, graphql: correct comments about gas price logic (#27752)
parent
5c30541c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
graphql.go
graphql/graphql.go
+1
-1
api.go
internal/ethapi/api.go
+1
-1
No files found.
graphql/graphql.go
View file @
60070fe5
...
...
@@ -277,7 +277,7 @@ func (t *Transaction) GasPrice(ctx context.Context) hexutil.Big {
case
types
.
DynamicFeeTxType
:
if
block
!=
nil
{
if
baseFee
,
_
:=
block
.
BaseFeePerGas
(
ctx
);
baseFee
!=
nil
{
// price = min(
tip, gasFeeCap - baseFee) + baseFee
// price = min(
gasTipCap + baseFee, gasFeeCap)
return
(
hexutil
.
Big
)(
*
math
.
BigMin
(
new
(
big
.
Int
)
.
Add
(
tx
.
GasTipCap
(),
baseFee
.
ToInt
()),
tx
.
GasFeeCap
()))
}
}
...
...
This diff is collapsed.
Click to expand it.
internal/ethapi/api.go
View file @
60070fe5
...
...
@@ -1428,7 +1428,7 @@ func newRPCTransaction(tx *types.Transaction, blockHash common.Hash, blockNumber
result
.
GasTipCap
=
(
*
hexutil
.
Big
)(
tx
.
GasTipCap
())
// if the transaction has been mined, compute the effective gas price
if
baseFee
!=
nil
&&
blockHash
!=
(
common
.
Hash
{})
{
// price = min(
tip, gasFeeCap - baseFee) + baseFee
// price = min(
gasTipCap + baseFee, gasFeeCap)
price
:=
math
.
BigMin
(
new
(
big
.
Int
)
.
Add
(
tx
.
GasTipCap
(),
baseFee
),
tx
.
GasFeeCap
())
result
.
GasPrice
=
(
*
hexutil
.
Big
)(
price
)
}
else
{
...
...
This diff is collapsed.
Click to expand it.
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