kaspad/domain/consensus/model/block_heap.go
stasatdaglabs 12f1c3dfab
Fix a crash in GetMissingBlockBodyHashes (#1289)
* Remove the limit on the amount of hashes returned from antiPastHashesBetween.

* Guard against requests with a non-existing block hash.

* Move missing-block-hash guards to consensus.go.

* Ban a peer that doesn't send us all the requested headers during IBD.

* Extract blockHeap.ToSlice.

* Re-request headers in requestHeaders if we didn't receive the highHash.
2020-12-27 17:03:21 +02:00

12 lines
331 B
Go

package model
import "github.com/kaspanet/kaspad/domain/consensus/model/externalapi"
// BlockHeap represents a heap of block hashes, providing a priority-queue functionality
type BlockHeap interface {
Push(blockHash *externalapi.DomainHash) error
Pop() *externalapi.DomainHash
Len() int
ToSlice() []*externalapi.DomainHash
}