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
b695c825
Commit
b695c825
authored
May 28, 2014
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes #60
parent
a98e35d7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
4 deletions
+7
-4
state_manager.go
ethchain/state_manager.go
+5
-2
transaction_pool.go
ethchain/transaction_pool.go
+2
-2
No files found.
ethchain/state_manager.go
View file @
b695c825
...
...
@@ -105,8 +105,11 @@ func (sm *StateManager) ApplyTransactions(state *State, block *Block, txs []*Tra
for
_
,
tx
:=
range
txs
{
usedGas
,
err
:=
sm
.
ApplyTransaction
(
state
,
block
,
tx
)
if
err
!=
nil
{
if
IsNonceErr
(
err
)
{
continue
}
ethutil
.
Config
.
Log
.
Infoln
(
err
)
//continue
}
accumelative
:=
new
(
big
.
Int
)
.
Set
(
totalUsedGas
.
Add
(
totalUsedGas
,
usedGas
))
...
...
@@ -116,7 +119,7 @@ func (sm *StateManager) ApplyTransactions(state *State, block *Block, txs []*Tra
validTxs
=
append
(
validTxs
,
tx
)
}
return
receipts
,
t
xs
return
receipts
,
validT
xs
}
func
(
sm
*
StateManager
)
ApplyTransaction
(
state
*
State
,
block
*
Block
,
tx
*
Transaction
)
(
totalGasUsed
*
big
.
Int
,
err
error
)
{
...
...
ethchain/transaction_pool.go
View file @
b695c825
...
...
@@ -106,7 +106,7 @@ func (pool *TxPool) ProcessTransaction(tx *Transaction, state *State, toContract
sender
:=
state
.
GetAccount
(
tx
.
Sender
())
if
sender
.
Nonce
!=
tx
.
Nonce
{
err
=
fmt
.
Errorf
(
"[TXPL] Invalid account nonce, state nonce is %d transaction nonce is %d instead"
,
sender
.
Nonce
,
tx
.
Nonce
)
err
=
NonceError
(
tx
.
Nonce
,
sender
.
Nonce
)
return
}
...
...
@@ -235,7 +235,7 @@ func (pool *TxPool) RemoveInvalid(state *State) {
tx
:=
e
.
Value
.
(
*
Transaction
)
sender
:=
state
.
GetAccount
(
tx
.
Sender
())
err
:=
pool
.
ValidateTransaction
(
tx
)
if
err
!=
nil
||
sender
.
Nonce
!
=
tx
.
Nonce
{
if
err
!=
nil
||
sender
.
Nonce
>
=
tx
.
Nonce
{
pool
.
pool
.
Remove
(
e
)
}
}
...
...
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