mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-05-20 13:56:45 +00:00

* add p2p v5 which is currently identical to v4 * set all internal imports to v5 * wip * set default version to 5 * protobuf gen for new ibd chain locator * wire for new ibd chain locator types * new ibd shared block algo -- only basic test passing * address the case where pruning points disagree, now both IBD tests pass * protobuf gen for new past diff request message * wire for new request past diff message * handle and flow for new request past diff message - logic unimplemented yet * implement ibd sync past diff of relay and selected tip * go fmt * remove unused methods * missed one err check * addressing simple comments * apply the traversal limit logic and sort headers * rename pastdiff -> anticone * apply Don't relay blocks in virtual anticone #1970 to v5 * go fmt * Fixed minor comments * Limit the number of chain negotiation restarts
28 lines
912 B
Go
28 lines
912 B
Go
package appmessage
|
|
|
|
import (
|
|
"github.com/kaspanet/kaspad/domain/consensus/model/externalapi"
|
|
)
|
|
|
|
// MsgIBDChainBlockLocator implements the Message interface and represents a kaspa
|
|
// locator message. It is used to find the blockLocator of a peer that is
|
|
// syncing with you.
|
|
type MsgIBDChainBlockLocator struct {
|
|
baseMessage
|
|
BlockLocatorHashes []*externalapi.DomainHash
|
|
}
|
|
|
|
// Command returns the protocol command string for the message. This is part
|
|
// of the Message interface implementation.
|
|
func (msg *MsgIBDChainBlockLocator) Command() MessageCommand {
|
|
return CmdIBDChainBlockLocator
|
|
}
|
|
|
|
// NewMsgIBDChainBlockLocator returns a new kaspa locator message that conforms to
|
|
// the Message interface. See MsgBlockLocator for details.
|
|
func NewMsgIBDChainBlockLocator(locatorHashes []*externalapi.DomainHash) *MsgIBDChainBlockLocator {
|
|
return &MsgIBDChainBlockLocator{
|
|
BlockLocatorHashes: locatorHashes,
|
|
}
|
|
}
|