Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
exchain
nebula
Commits
30541800
Unverified
Commit
30541800
authored
Sep 28, 2021
by
George Hotz
Committed by
GitHub
Sep 28, 2021
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #14 from han0110/fix/missing-refund-change-journal
Fix: add missing `refundChange` to journal
parents
e7e3af9f
e9a62e24
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
0 deletions
+2
-0
statedb.go
minigeth/core/state/statedb.go
+2
-0
No files found.
minigeth/core/state/statedb.go
View file @
30541800
...
@@ -202,12 +202,14 @@ func (s *StateDB) Preimages() map[common.Hash][]byte {
...
@@ -202,12 +202,14 @@ func (s *StateDB) Preimages() map[common.Hash][]byte {
// AddRefund adds gas to the refund counter
// AddRefund adds gas to the refund counter
func
(
s
*
StateDB
)
AddRefund
(
gas
uint64
)
{
func
(
s
*
StateDB
)
AddRefund
(
gas
uint64
)
{
s
.
journal
.
append
(
refundChange
{
prev
:
s
.
refund
})
s
.
refund
+=
gas
s
.
refund
+=
gas
}
}
// SubRefund removes gas from the refund counter.
// SubRefund removes gas from the refund counter.
// This method will panic if the refund counter goes below zero
// This method will panic if the refund counter goes below zero
func
(
s
*
StateDB
)
SubRefund
(
gas
uint64
)
{
func
(
s
*
StateDB
)
SubRefund
(
gas
uint64
)
{
s
.
journal
.
append
(
refundChange
{
prev
:
s
.
refund
})
if
gas
>
s
.
refund
{
if
gas
>
s
.
refund
{
panic
(
fmt
.
Sprintf
(
"Refund counter below zero (gas: %d > refund: %d)"
,
gas
,
s
.
refund
))
panic
(
fmt
.
Sprintf
(
"Refund counter below zero (gas: %d > refund: %d)"
,
gas
,
s
.
refund
))
}
}
...
...
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