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
093d6d50
Commit
093d6d50
authored
Apr 21, 2015
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core: removed nonce resetting from the block processor.
All nonce error handling has been moved to the worker
parent
1d6d4291
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
4 deletions
+7
-4
block_processor.go
core/block_processor.go
+2
-2
managed_state.go
core/state/managed_state.go
+1
-0
transaction_pool.go
core/transaction_pool.go
+4
-2
No files found.
core/block_processor.go
View file @
093d6d50
...
...
@@ -85,8 +85,8 @@ func (self *BlockProcessor) ApplyTransaction(coinbase *state.StateObject, stated
_
,
gas
,
err
:=
ApplyMessage
(
NewEnv
(
statedb
,
self
.
bc
,
tx
,
block
),
tx
,
cb
)
if
err
!=
nil
&&
(
IsNonceErr
(
err
)
||
state
.
IsGasLimitErr
(
err
)
||
IsInvalidTxErr
(
err
))
{
// If the account is managed, remove the invalid nonce.
from
,
_
:=
tx
.
From
()
self
.
bc
.
TxState
()
.
RemoveNonce
(
from
,
tx
.
Nonce
())
//
from, _ := tx.From()
//
self.bc.TxState().RemoveNonce(from, tx.Nonce())
return
nil
,
nil
,
err
}
...
...
core/state/managed_state.go
View file @
093d6d50
...
...
@@ -62,6 +62,7 @@ func (ms *ManagedState) NewNonce(addr common.Address) uint64 {
}
}
account
.
nonces
=
append
(
account
.
nonces
,
true
)
return
uint64
(
len
(
account
.
nonces
)
-
1
)
+
account
.
nstart
}
...
...
core/transaction_pool.go
View file @
093d6d50
...
...
@@ -28,6 +28,8 @@ const txPoolQueueSize = 50
type
TxPoolHook
chan
*
types
.
Transaction
type
TxMsg
struct
{
Tx
*
types
.
Transaction
}
type
stateFn
func
()
*
state
.
StateDB
const
(
minGasPrice
=
1000000
)
...
...
@@ -47,7 +49,7 @@ type TxPool struct {
// Quiting channel
quit
chan
bool
// The state function which will allow us to do some pre checkes
currentState
func
()
*
state
.
StateDB
currentState
stateFn
// The actual pool
txs
map
[
common
.
Hash
]
*
types
.
Transaction
invalidHashes
*
set
.
Set
...
...
@@ -57,7 +59,7 @@ type TxPool struct {
eventMux
*
event
.
TypeMux
}
func
NewTxPool
(
eventMux
*
event
.
TypeMux
,
currentStateFn
func
()
*
state
.
StateDB
)
*
TxPool
{
func
NewTxPool
(
eventMux
*
event
.
TypeMux
,
currentStateFn
stateFn
)
*
TxPool
{
return
&
TxPool
{
txs
:
make
(
map
[
common
.
Hash
]
*
types
.
Transaction
),
queueChan
:
make
(
chan
*
types
.
Transaction
,
txPoolQueueSize
),
...
...
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