good morning!!!!

Skip to content
Snippets Groups Projects
Unverified Commit 124e004b authored by Enrique Jose  Avila Asapche's avatar Enrique Jose Avila Asapche Committed by GitHub
Browse files

fixed stuck dev chain (#4261)

parent d4d4c2ec
No related branches found
No related tags found
No related merge requests found
......@@ -45,10 +45,21 @@ func StageLoop(
initialCycle := true
for {
select {
case <-ctx.Done():
return
default:
if !hd.POSSync() {
// Wait for delivery of any p2p headers here to resume the stage loop
// Since StageLoopStep creates RW database transaction, the mining loop can only do its work (it also requires creating RW transaction)
// when the control flow is outside StageLoopStep function. Therefore wait here to give mining loop this opportunity
select {
case <-ctx.Done():
return
case <-hd.DeliveryNotify:
}
} else {
select {
case <-ctx.Done():
return
default:
}
}
start := time.Now()
......@@ -102,16 +113,6 @@ func StageLoop(
case <-c:
}
}
if !hd.POSSync() {
// Wait for delivery of any p2p headers here to resume the stage loop
// Since StageLoopStep creates RW database transaction, the mining loop can only do its work (it also requires creating RW transaction)
// when the control flow is outside StageLoopStep function. Therefore wait here to give mining loop this opportunity
select {
case <-ctx.Done():
return
case <-hd.DeliveryNotify:
}
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment