mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-09-14 13:30:11 +00:00

* Remove BlockHexes from GetBlocks request and response * Add GetBlocks RPC * Include the selectedTip's anticone in GetBlocks * Add Anticone to fakeRelayInvsContext * Include verbose data only if it was requested + Add comments to HandleGetBlocks * Allow antiPastHashesBetween to receive unrelated low and high hashes * Convert to/from protowire GetBlocksResponse with no verbose data correctly * Removed NextLowHash * Update GetBlocks in rpc_client * Validate in consensus.Anticone that blockHash exists Co-authored-by: stasatdaglabs <39559713+stasatdaglabs@users.noreply.github.com>
20 lines
1012 B
Go
20 lines
1012 B
Go
package model
|
|
|
|
import "github.com/kaspanet/kaspad/domain/consensus/model/externalapi"
|
|
|
|
// DAGTraversalManager exposes methods for traversing blocks
|
|
// in the DAG
|
|
type DAGTraversalManager interface {
|
|
BlockAtDepth(highHash *externalapi.DomainHash, depth uint64) (*externalapi.DomainHash, error)
|
|
LowestChainBlockAboveOrEqualToBlueScore(highHash *externalapi.DomainHash, blueScore uint64) (*externalapi.DomainHash, error)
|
|
// SelectedChildIterator should return a BlockIterator that iterates
|
|
// from lowHash (exclusive) to highHash (inclusive) over highHash's selected parent chain
|
|
SelectedChildIterator(highHash, lowHash *externalapi.DomainHash) (BlockIterator, error)
|
|
Anticone(blockHash *externalapi.DomainHash) ([]*externalapi.DomainHash, error)
|
|
BlueWindow(highHash *externalapi.DomainHash, windowSize int) ([]*externalapi.DomainHash, error)
|
|
NewDownHeap() BlockHeap
|
|
NewUpHeap() BlockHeap
|
|
CalculateChainPath(
|
|
fromBlockHash, toBlockHash *externalapi.DomainHash) (*externalapi.SelectedChainPath, error)
|
|
}
|