mirror of
https://github.com/kaspanet/kaspad.git
synced 2026-03-18 06:09:10 +00:00
[NOD-1095] RLock the dagLock in SelectedTipHeader. (#893)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user