Skip to content

Commit 991c787

Browse files
fix(dot/core): fix the race condition in TrieState
fix the race condition in TrieState(nil) and GetRuntime(nil) Fixes #2402
1 parent f521c97 commit 991c787

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

dot/core/service.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -495,12 +495,14 @@ func (s *Service) HandleSubmittedExtrinsic(ext types.Extrinsic) error {
495495
return nil
496496
}
497497

498-
ts, err := s.storageState.TrieState(nil)
498+
bestBlockHash := s.blockState.BestBlockHash()
499+
500+
ts, err := s.storageState.TrieState(&bestBlockHash)
499501
if err != nil {
500502
return err
501503
}
502504

503-
rt, err := s.blockState.GetRuntime(nil)
505+
rt, err := s.blockState.GetRuntime(&bestBlockHash)
504506
if err != nil {
505507
logger.Critical("failed to get runtime")
506508
return err

0 commit comments

Comments
 (0)