mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-03-30 15:08:33 +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
32 lines
1.0 KiB
Go
32 lines
1.0 KiB
Go
package appmessage
|
|
|
|
import (
|
|
"github.com/kaspanet/kaspad/domain/consensus/model/externalapi"
|
|
)
|
|
|
|
// MaxRequestRelayBlocksHashes is the maximum number of hashes that can
|
|
// be in a single RequestRelayBlocks message.
|
|
const MaxRequestRelayBlocksHashes = MaxInvPerMsg
|
|
|
|
// MsgRequestRelayBlocks implements the Message interface and represents a kaspa
|
|
// RequestRelayBlocks message. It is used to request blocks as part of the block
|
|
// relay protocol.
|
|
type MsgRequestRelayBlocks struct {
|
|
baseMessage
|
|
Hashes []*externalapi.DomainHash
|
|
}
|
|
|
|
// Command returns the protocol command string for the message. This is part
|
|
// of the Message interface implementation.
|
|
func (msg *MsgRequestRelayBlocks) Command() MessageCommand {
|
|
return CmdRequestRelayBlocks
|
|
}
|
|
|
|
// NewMsgRequestRelayBlocks returns a new kaspa RequestRelayBlocks message that conforms to
|
|
// the Message interface. See MsgRequestRelayBlocks for details.
|
|
func NewMsgRequestRelayBlocks(hashes []*externalapi.DomainHash) *MsgRequestRelayBlocks {
|
|
return &MsgRequestRelayBlocks{
|
|
Hashes: hashes,
|
|
}
|
|
}
|