mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-10-14 00:59:33 +00:00
Fix data race in GetBlockChildren (#1579)
This commit is contained in:
parent
3fd324ca28
commit
dd3b2cf7d1
@ -158,6 +158,8 @@ func (s *consensus) GetBlockInfo(blockHash *externalapi.DomainHash) (*externalap
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s *consensus) GetBlockChildren(blockHash *externalapi.DomainHash) ([]*externalapi.DomainHash, error) {
|
func (s *consensus) GetBlockChildren(blockHash *externalapi.DomainHash) ([]*externalapi.DomainHash, error) {
|
||||||
|
s.lock.Lock()
|
||||||
|
defer s.lock.Unlock()
|
||||||
blockRelation, err := s.blockRelationStore.BlockRelation(s.databaseContext, blockHash)
|
blockRelation, err := s.blockRelationStore.BlockRelation(s.databaseContext, blockHash)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
Loading…
x
Reference in New Issue
Block a user