File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -245,13 +245,15 @@ func (p *TxPool) loop(head *types.Header) {
245
245
// Try to inject a busy marker and start a reset if successful
246
246
select {
247
247
case resetBusy <- struct {}{}:
248
- statedb , err := p .chain .StateAt (newHead .Root )
249
- if err != nil {
250
- log .Crit ("Failed to reset txpool state" , "err" , err )
248
+ // Updates the statedb with the new chain head. The head state may be
249
+ // unavailable if the initial state sync has not yet completed.
250
+ if statedb , err := p .chain .StateAt (newHead .Root ); err != nil {
251
+ log .Error ("Failed to reset txpool state" , "err" , err )
252
+ } else {
253
+ p .stateLock .Lock ()
254
+ p .state = statedb
255
+ p .stateLock .Unlock ()
251
256
}
252
- p .stateLock .Lock ()
253
- p .state = statedb
254
- p .stateLock .Unlock ()
255
257
256
258
// Busy marker injected, start a new subpool reset
257
259
go func (oldHead , newHead * types.Header ) {
You can’t perform that action at this time.
0 commit comments