Skip to content

Commit b57f792

Browse files
committed
fix: handle decoding of older block responses
1 parent bd45dd7 commit b57f792

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

libsigner/src/v0/messages.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1330,7 +1330,9 @@ impl StacksMessageCodec for RejectReason {
13301330
}
13311331

13321332
fn consensus_deserialize<R: Read>(fd: &mut R) -> Result<Self, CodecError> {
1333-
let type_prefix_byte = read_next::<u8, _>(fd)?;
1333+
let Ok(type_prefix_byte) = read_next::<u8, _>(fd) else {
1334+
return Ok(RejectReason::NotRejected);
1335+
};
13341336
let type_prefix = RejectReasonPrefix::from(type_prefix_byte);
13351337
let code = match type_prefix {
13361338
RejectReasonPrefix::ValidationFailed => RejectReason::ValidationFailed(

0 commit comments

Comments
 (0)