Skip to content

Commit 4430d8f

Browse files
authored
Merge pull request #446 from blinklabs-io/fix/blockfetch-msg-block-cbor
fix: block-fetch MsgBlock CBOR encoding
2 parents 288dc68 + 9601825 commit 4430d8f

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

protocol/blockfetch/messages.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,17 @@ func NewMsgBlock(wrappedBlock []byte) *MsgBlock {
128128
return m
129129
}
130130

131+
func (m MsgBlock) MarshalCBOR() ([]byte, error) {
132+
tmp := []any{
133+
m.MessageType,
134+
cbor.Tag{
135+
Number: cbor.CborTagCbor,
136+
Content: m.WrappedBlock,
137+
},
138+
}
139+
return cbor.Encode(&tmp)
140+
}
141+
131142
type MsgBatchDone struct {
132143
protocol.MessageBase
133144
}

0 commit comments

Comments
 (0)