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
69044fe5
Commit
69044fe5
authored
Jun 10, 2014
by
Maran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor to use new method
parent
753f7494
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
13 deletions
+1
-13
block_chain.go
ethchain/block_chain.go
+1
-13
No files found.
ethchain/block_chain.go
View file @
69044fe5
...
...
@@ -72,19 +72,7 @@ func (bc *BlockChain) NewBlock(coinbase []byte) *Block {
block
.
Number
=
new
(
big
.
Int
)
.
Add
(
bc
.
CurrentBlock
.
Number
,
ethutil
.
Big1
)
// max(10000, (parent gas limit * (1024 - 1) + (parent gas used * 6 / 5)) / 1024)
base
:=
new
(
big
.
Int
)
base2
:=
new
(
big
.
Int
)
parentGL
:=
bc
.
CurrentBlock
.
GasLimit
parentUsed
:=
bc
.
CurrentBlock
.
GasUsed
base
.
Mul
(
parentGL
,
big
.
NewInt
(
1024
-
1
))
base2
.
Mul
(
parentUsed
,
big
.
NewInt
(
6
))
base2
.
Div
(
base2
,
big
.
NewInt
(
5
))
base
.
Add
(
base
,
base2
)
base
.
Div
(
base
,
big
.
NewInt
(
1024
))
block
.
GasLimit
=
ethutil
.
BigMax
(
big
.
NewInt
(
10000
),
base
)
block
.
GasLimit
=
block
.
CalcGasLimit
(
bc
.
CurrentBlock
)
}
return
block
...
...
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