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
cc6c5846
Commit
cc6c5846
authored
Aug 03, 2015
by
Jeffrey Wilcke
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1568 from obscuren/issue-1559
core: added a running flag to prevent panics in the chainmanager
parents
db988a46
acd2c4e5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
chain_manager.go
core/chain_manager.go
+5
-1
No files found.
core/chain_manager.go
View file @
cc6c5846
...
...
@@ -76,7 +76,8 @@ type ChainManager struct {
cache
*
lru
.
Cache
// cache is the LRU caching
futureBlocks
*
lru
.
Cache
// future blocks are blocks added for later processing
quit
chan
struct
{}
quit
chan
struct
{}
running
int32
// running must be called automically
// procInterrupt must be atomically called
procInterrupt
int32
// interrupt signaler for block processing
wg
sync
.
WaitGroup
...
...
@@ -451,6 +452,9 @@ func (bc *ChainManager) setTotalDifficulty(td *big.Int) {
}
func
(
bc
*
ChainManager
)
Stop
()
{
if
!
atomic
.
CompareAndSwapInt32
(
&
bc
.
running
,
0
,
1
)
{
return
}
close
(
bc
.
quit
)
atomic
.
StoreInt32
(
&
bc
.
procInterrupt
,
1
)
...
...
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