mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-05-20 13:56:45 +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.
24 lines
714 B
Go
24 lines
714 B
Go
package appmessage
|
|
|
|
import (
|
|
"github.com/kaspanet/kaspad/domain/consensus/model/externalapi"
|
|
)
|
|
|
|
// MsgIBDBlockLocatorHighestHash represents a kaspa BlockLocatorHighestHash message
|
|
type MsgIBDBlockLocatorHighestHash struct {
|
|
baseMessage
|
|
HighestHash *externalapi.DomainHash
|
|
}
|
|
|
|
// Command returns the protocol command string for the message
|
|
func (msg *MsgIBDBlockLocatorHighestHash) Command() MessageCommand {
|
|
return CmdIBDBlockLocatorHighestHash
|
|
}
|
|
|
|
// NewMsgIBDBlockLocatorHighestHash returns a new BlockLocatorHighestHash message
|
|
func NewMsgIBDBlockLocatorHighestHash(highestHash *externalapi.DomainHash) *MsgIBDBlockLocatorHighestHash {
|
|
return &MsgIBDBlockLocatorHighestHash{
|
|
HighestHash: highestHash,
|
|
}
|
|
}
|