MCPcopy Create free account
hub / github.com/DNAProject/DNA / getFlightBlock

Method getFlightBlock

p2pserver/block_sync.go:815–828  ·  view source on GitHub ↗
(blockHash common.Uint256, nodeId uint64)

Source from the content-addressed store, hash-verified

813}
814
815func (this *BlockSyncMgr) getFlightBlock(blockHash common.Uint256, nodeId uint64) *SyncFlightInfo {
816 this.lock.RLock()
817 defer this.lock.RUnlock()
818 infos, ok := this.flightBlocks[blockHash]
819 if !ok {
820 return nil
821 }
822 for _, info := range infos {
823 if info.GetNodeId() == nodeId {
824 return info
825 }
826 }
827 return nil
828}
829
830func (this *BlockSyncMgr) delFlightBlock(blockHash common.Uint256) bool {
831 this.lock.Lock()

Callers 1

OnBlockReceiveMethod · 0.95

Calls 1

GetNodeIdMethod · 0.80

Tested by

no test coverage detected