mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-05-29 18:26:41 +00:00

* Add a new message: BlockLocatorHighestHash. * Add a new message: IBDBlockLocator. * Implement HandleIBDBlockLocator. * Reimplement findHighestSharedBlockHash. * Make HandleIBDBlockLocator only return hashes that are in the selected parent chain of the target hash. * Increase the cache sizes of blockRelationStore, reachabilityDataStore, and ghostdagDataStore. * Fix wrong initial highHash in findHighestSharedBlockHash. * Make go vet happy. * Protect against receiving wrong messages when expecting MsgIBDBlockLocatorHighestHash.
27 lines
827 B
Go
27 lines
827 B
Go
package appmessage
|
|
|
|
import (
|
|
"github.com/kaspanet/kaspad/domain/consensus/model/externalapi"
|
|
)
|
|
|
|
// MsgIBDRootHashMessage implements the Message interface and represents a kaspa
|
|
// IBDRootHash message. It is used as a reply to IBD root hash requests.
|
|
type MsgIBDRootHashMessage struct {
|
|
baseMessage
|
|
Hash *externalapi.DomainHash
|
|
}
|
|
|
|
// Command returns the protocol command string for the message. This is part
|
|
// of the Message interface implementation.
|
|
func (msg *MsgIBDRootHashMessage) Command() MessageCommand {
|
|
return CmdIBDRootHash
|
|
}
|
|
|
|
// NewMsgIBDRootHashMessage returns a new kaspa IBDRootHash message that conforms to
|
|
// the Message interface. See MsgIBDRootHashMessage for details.
|
|
func NewMsgIBDRootHashMessage(hash *externalapi.DomainHash) *MsgIBDRootHashMessage {
|
|
return &MsgIBDRootHashMessage{
|
|
Hash: hash,
|
|
}
|
|
}
|