mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-06-06 06:06:49 +00:00
[NOD-1095] RLock the dagLock in SelectedTipHeader. (#893)
This commit is contained in:
parent
83e7c9e8e4
commit
5fd164bf66
@ -211,6 +211,8 @@ func (dag *BlockDAG) selectedTip() *blockNode {
|
||||
//
|
||||
// This function is safe for concurrent access.
|
||||
func (dag *BlockDAG) SelectedTipHeader() *appmessage.BlockHeader {
|
||||
dag.dagLock.RLock()
|
||||
defer dag.dagLock.RUnlock()
|
||||
selectedTip := dag.selectedTip()
|
||||
if selectedTip == nil {
|
||||
return nil
|
||||
|
Loading…
x
Reference in New Issue
Block a user