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
48bca30e
Commit
48bca30e
authored
Jun 16, 2014
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed minor issue with the gas pool
parent
9f62d441
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
9 deletions
+13
-9
state_manager.go
ethchain/state_manager.go
+1
-1
state_object.go
ethchain/state_object.go
+2
-2
state_transition.go
ethchain/state_transition.go
+8
-6
miner.go
ethminer/miner.go
+2
-0
No files found.
ethchain/state_manager.go
View file @
48bca30e
...
@@ -178,7 +178,7 @@ func (sm *StateManager) ProcessBlock(state *State, parent, block *Block, dontRea
...
@@ -178,7 +178,7 @@ func (sm *StateManager) ProcessBlock(state *State, parent, block *Block, dontRea
fmt
.
Println
(
block
.
Receipts
())
fmt
.
Println
(
block
.
Receipts
())
coinbase
:=
state
.
GetOrNewStateObject
(
block
.
Coinbase
)
coinbase
:=
state
.
GetOrNewStateObject
(
block
.
Coinbase
)
coinbase
.
gasPool
=
block
.
CalcGasLimit
(
parent
)
coinbase
.
SetGasPool
(
block
.
CalcGasLimit
(
parent
)
)
// Process the transactions on to current block
// Process the transactions on to current block
//sm.ApplyTransactions(block.Coinbase, state, parent, block.Transactions())
//sm.ApplyTransactions(block.Coinbase, state, parent, block.Transactions())
...
...
ethchain/state_object.go
View file @
48bca30e
...
@@ -120,13 +120,13 @@ func (c *StateObject) ReturnGas(gas, price *big.Int, state *State) {
...
@@ -120,13 +120,13 @@ func (c *StateObject) ReturnGas(gas, price *big.Int, state *State) {
func
(
c
*
StateObject
)
AddAmount
(
amount
*
big
.
Int
)
{
func
(
c
*
StateObject
)
AddAmount
(
amount
*
big
.
Int
)
{
c
.
SetAmount
(
new
(
big
.
Int
)
.
Add
(
c
.
Amount
,
amount
))
c
.
SetAmount
(
new
(
big
.
Int
)
.
Add
(
c
.
Amount
,
amount
))
ethutil
.
Config
.
Log
.
Debugf
(
"%x: #%d %v (+ %v)
"
,
c
.
Address
(),
c
.
Nonce
,
c
.
Amount
,
amount
)
ethutil
.
Config
.
Log
.
Printf
(
ethutil
.
LogLevelSystem
,
"%x: #%d %v (+ %v)
\n
"
,
c
.
Address
(),
c
.
Nonce
,
c
.
Amount
,
amount
)
}
}
func
(
c
*
StateObject
)
SubAmount
(
amount
*
big
.
Int
)
{
func
(
c
*
StateObject
)
SubAmount
(
amount
*
big
.
Int
)
{
c
.
SetAmount
(
new
(
big
.
Int
)
.
Sub
(
c
.
Amount
,
amount
))
c
.
SetAmount
(
new
(
big
.
Int
)
.
Sub
(
c
.
Amount
,
amount
))
ethutil
.
Config
.
Log
.
Debugf
(
"%x: #%d %v (- %v)
"
,
c
.
Address
(),
c
.
Nonce
,
c
.
Amount
,
amount
)
ethutil
.
Config
.
Log
.
Printf
(
ethutil
.
LogLevelSystem
,
"%x: #%d %v (- %v)
\n
"
,
c
.
Address
(),
c
.
Nonce
,
c
.
Amount
,
amount
)
}
}
func
(
c
*
StateObject
)
SetAmount
(
amount
*
big
.
Int
)
{
func
(
c
*
StateObject
)
SetAmount
(
amount
*
big
.
Int
)
{
...
...
ethchain/state_transition.go
View file @
48bca30e
...
@@ -113,12 +113,14 @@ func (self *StateTransition) BuyGas() error {
...
@@ -113,12 +113,14 @@ func (self *StateTransition) BuyGas() error {
func
(
self
*
StateTransition
)
TransitionState
()
(
err
error
)
{
func
(
self
*
StateTransition
)
TransitionState
()
(
err
error
)
{
//snapshot := st.state.Snapshot()
//snapshot := st.state.Snapshot()
defer
func
()
{
/*
if
r
:=
recover
();
r
!=
nil
{
defer func() {
ethutil
.
Config
.
Log
.
Infoln
(
r
)
if r := recover(); r != nil {
err
=
fmt
.
Errorf
(
"state transition err %v"
,
r
)
ethutil.Config.Log.Infoln(r)
}
err = fmt.Errorf("state transition err %v", r)
}()
}
}()
*/
var
(
var
(
tx
=
self
.
tx
tx
=
self
.
tx
...
...
ethminer/miner.go
View file @
48bca30e
...
@@ -139,7 +139,9 @@ func (self *Miner) mineNewBlock() {
...
@@ -139,7 +139,9 @@ func (self *Miner) mineNewBlock() {
// Accumulate all valid transaction and apply them to the new state
// Accumulate all valid transaction and apply them to the new state
// Error may be ignored. It's not important during mining
// Error may be ignored. It's not important during mining
parent
:=
self
.
ethereum
.
BlockChain
()
.
GetBlock
(
self
.
block
.
PrevHash
)
coinbase
:=
self
.
block
.
State
()
.
GetOrNewStateObject
(
self
.
block
.
Coinbase
)
coinbase
:=
self
.
block
.
State
()
.
GetOrNewStateObject
(
self
.
block
.
Coinbase
)
coinbase
.
SetGasPool
(
self
.
block
.
CalcGasLimit
(
parent
))
receipts
,
txs
,
unhandledTxs
,
err
:=
stateManager
.
ProcessTransactions
(
coinbase
,
self
.
block
.
State
(),
self
.
block
,
self
.
block
,
self
.
txs
)
receipts
,
txs
,
unhandledTxs
,
err
:=
stateManager
.
ProcessTransactions
(
coinbase
,
self
.
block
.
State
(),
self
.
block
,
self
.
block
,
self
.
txs
)
if
err
!=
nil
{
if
err
!=
nil
{
ethutil
.
Config
.
Log
.
Debugln
(
"[MINER]"
,
err
)
ethutil
.
Config
.
Log
.
Debugln
(
"[MINER]"
,
err
)
...
...
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