good morning!!!!
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
bor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
open
bor
Commits
9f1520b4
Commit
9f1520b4
authored
Dec 13, 2016
by
Bas van Kervel
Browse files
Options
Downloads
Patches
Plain Diff
core: init pending state in tx pool on creation
parent
a98e8c08
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
core/tx_pool.go
+4
-10
4 additions, 10 deletions
core/tx_pool.go
with
4 additions
and
10 deletions
core/tx_pool.go
+
4
−
10
View file @
9f1520b4
...
@@ -124,6 +124,8 @@ func NewTxPool(config *params.ChainConfig, eventMux *event.TypeMux, currentState
...
@@ -124,6 +124,8 @@ func NewTxPool(config *params.ChainConfig, eventMux *event.TypeMux, currentState
quit
:
make
(
chan
struct
{}),
quit
:
make
(
chan
struct
{}),
}
}
pool
.
resetState
()
pool
.
wg
.
Add
(
2
)
pool
.
wg
.
Add
(
2
)
go
pool
.
eventLoop
()
go
pool
.
eventLoop
()
go
pool
.
expirationLoop
()
go
pool
.
expirationLoop
()
...
@@ -196,12 +198,8 @@ func (pool *TxPool) Stop() {
...
@@ -196,12 +198,8 @@ func (pool *TxPool) Stop() {
}
}
func
(
pool
*
TxPool
)
State
()
*
state
.
ManagedState
{
func
(
pool
*
TxPool
)
State
()
*
state
.
ManagedState
{
pool
.
mu
.
Lock
()
pool
.
mu
.
RLock
()
defer
pool
.
mu
.
Unlock
()
defer
pool
.
mu
.
RUnlock
()
if
pool
.
pendingState
==
nil
{
pool
.
resetState
()
}
return
pool
.
pendingState
return
pool
.
pendingState
}
}
...
@@ -381,10 +379,6 @@ func (pool *TxPool) enqueueTx(hash common.Hash, tx *types.Transaction) {
...
@@ -381,10 +379,6 @@ func (pool *TxPool) enqueueTx(hash common.Hash, tx *types.Transaction) {
//
//
// Note, this method assumes the pool lock is held!
// Note, this method assumes the pool lock is held!
func
(
pool
*
TxPool
)
promoteTx
(
addr
common
.
Address
,
hash
common
.
Hash
,
tx
*
types
.
Transaction
)
{
func
(
pool
*
TxPool
)
promoteTx
(
addr
common
.
Address
,
hash
common
.
Hash
,
tx
*
types
.
Transaction
)
{
// Init delayed since tx pool could have been started before any state sync
if
pool
.
pendingState
==
nil
{
pool
.
resetState
()
}
// Try to insert the transaction into the pending queue
// Try to insert the transaction into the pending queue
if
pool
.
pending
[
addr
]
==
nil
{
if
pool
.
pending
[
addr
]
==
nil
{
pool
.
pending
[
addr
]
=
newTxList
(
true
)
pool
.
pending
[
addr
]
=
newTxList
(
true
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment