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
e859f369
Commit
e859f369
authored
Sep 26, 2016
by
Péter Szilágyi
Committed by
GitHub
Sep 26, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3035 from Gustav-Simonsson/zero_value_transfer_noop
core/state: short-circuit balance change if zero value
parents
3778f1bf
25ed5fed
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
state_object.go
core/state/state_object.go
+6
-0
No files found.
core/state/state_object.go
View file @
e859f369
...
...
@@ -152,6 +152,9 @@ func (self *StateObject) Update() {
}
func
(
c
*
StateObject
)
AddBalance
(
amount
*
big
.
Int
)
{
if
amount
.
Cmp
(
common
.
Big0
)
==
0
{
return
}
c
.
SetBalance
(
new
(
big
.
Int
)
.
Add
(
c
.
balance
,
amount
))
if
glog
.
V
(
logger
.
Core
)
{
...
...
@@ -160,6 +163,9 @@ func (c *StateObject) AddBalance(amount *big.Int) {
}
func
(
c
*
StateObject
)
SubBalance
(
amount
*
big
.
Int
)
{
if
amount
.
Cmp
(
common
.
Big0
)
==
0
{
return
}
c
.
SetBalance
(
new
(
big
.
Int
)
.
Sub
(
c
.
balance
,
amount
))
if
glog
.
V
(
logger
.
Core
)
{
...
...
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