mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-06-12 00:56:42 +00:00

* [NOD-1225] Rename wire to domainmessage * [NOD-1225] Get rid of references to package wire in the code, and get rid of InvType
29 lines
730 B
Go
29 lines
730 B
Go
package protowire
|
|
|
|
import "github.com/kaspanet/kaspad/domainmessage"
|
|
|
|
func (x *KaspadMessage_RequestIBDBlocks) toDomainMessage() (domainmessage.Message, error) {
|
|
lowHash, err := x.RequestIBDBlocks.LowHash.toWire()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
highHash, err := x.RequestIBDBlocks.HighHash.toWire()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return &domainmessage.MsgRequestIBDBlocks{
|
|
LowHash: lowHash,
|
|
HighHash: highHash,
|
|
}, nil
|
|
}
|
|
|
|
func (x *KaspadMessage_RequestIBDBlocks) fromDomainMessage(msgGetBlocks *domainmessage.MsgRequestIBDBlocks) error {
|
|
x.RequestIBDBlocks = &RequestIBDBlocksMessage{
|
|
LowHash: wireHashToProto(msgGetBlocks.LowHash),
|
|
HighHash: wireHashToProto(msgGetBlocks.HighHash),
|
|
}
|
|
return nil
|
|
}
|