good morning!!!!
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
E
Erigon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
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
a
Erigon
Commits
2cccf6d0
Unverified
Commit
2cccf6d0
authored
Jul 14, 2020
by
Evgeny Danilenko
Committed by
GitHub
Jul 14, 2020
Browse files
Options
Downloads
Patches
Plain Diff
Tx pool: prevent double start or stop (#744)
* use isStarted * set on stop
parent
9da86a27
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
core/tx_pool.go
+11
-0
11 additions, 0 deletions
core/tx_pool.go
with
11 additions
and
0 deletions
core/tx_pool.go
+
11
−
0
View file @
2cccf6d0
...
@@ -507,6 +507,9 @@ func (pool *TxPool) Stop() {
...
@@ -507,6 +507,9 @@ func (pool *TxPool) Stop() {
if
pool
.
journal
!=
nil
{
if
pool
.
journal
!=
nil
{
pool
.
journal
.
close
()
pool
.
journal
.
close
()
}
}
pool
.
isStarted
=
false
log
.
Info
(
"Transaction pool stopped"
)
log
.
Info
(
"Transaction pool stopped"
)
}
}
...
@@ -1460,6 +1463,10 @@ func (pool *TxPool) RunInit() error {
...
@@ -1460,6 +1463,10 @@ func (pool *TxPool) RunInit() error {
return
errors
.
New
(
"can't init a nil transaction pool"
)
return
errors
.
New
(
"can't init a nil transaction pool"
)
}
}
if
pool
.
IsStarted
()
{
return
errors
.
New
(
"transaction pool is already started"
)
}
var
err
error
var
err
error
for
_
,
fn
:=
range
pool
.
initFns
{
for
_
,
fn
:=
range
pool
.
initFns
{
if
err
=
fn
();
err
!=
nil
{
if
err
=
fn
();
err
!=
nil
{
...
@@ -1482,6 +1489,10 @@ func (pool *TxPool) RunStop() error {
...
@@ -1482,6 +1489,10 @@ func (pool *TxPool) RunStop() error {
return
errors
.
New
(
"can't stop a nil transaction pool"
)
return
errors
.
New
(
"can't stop a nil transaction pool"
)
}
}
if
!
pool
.
IsStarted
()
{
return
errors
.
New
(
"transaction pool is already stopped"
)
}
var
err
error
var
err
error
for
_
,
fn
:=
range
pool
.
stopFns
{
for
_
,
fn
:=
range
pool
.
stopFns
{
if
err
=
fn
();
err
!=
nil
{
if
err
=
fn
();
err
!=
nil
{
...
...
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