mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-05-25 16:26:48 +00:00

* [NOD-1525] Implement headers first IBD * [NOD-1525] Fix proto translators * [NOD-1525] Register missing flows * [NOD-1525] Rename SyncStateNormal->SyncStateRelay, simplifiy IBD peer selection code and get rid of panic in FinishIBD * [NOD-1525] Remove redundant methods from interface
31 lines
922 B
Go
31 lines
922 B
Go
package appmessage
|
|
|
|
import (
|
|
"github.com/kaspanet/kaspad/domain/consensus/model/externalapi"
|
|
)
|
|
|
|
// MaxRequestIBDBlocksHashes is the maximum number of hashes that can
|
|
// be in a single RequestIBDBlocks message.
|
|
const MaxRequestIBDBlocksHashes = MaxInvPerMsg
|
|
|
|
// MsgRequestIBDBlocks implements the Message interface and represents a kaspa
|
|
// RequestIBDBlocks message. It is used to request blocks as part of the IBD
|
|
// protocol.
|
|
type MsgRequestIBDBlocks struct {
|
|
baseMessage
|
|
Hashes []*externalapi.DomainHash
|
|
}
|
|
|
|
// Command returns the protocol command string for the message. This is part
|
|
// of the Message interface implementation.
|
|
func (msg *MsgRequestIBDBlocks) Command() MessageCommand {
|
|
return CmdRequestIBDBlocks
|
|
}
|
|
|
|
// NewMsgRequestIBDBlocks returns a new MsgRequestIBDBlocks.
|
|
func NewMsgRequestIBDBlocks(hashes []*externalapi.DomainHash) *MsgRequestIBDBlocks {
|
|
return &MsgRequestIBDBlocks{
|
|
Hashes: hashes,
|
|
}
|
|
}
|