Skip to content

Commit

Permalink
fix: CoinbasePayload.best_cl_height as compactsize
Browse files Browse the repository at this point in the history
  • Loading branch information
ogabrielides committed Oct 30, 2024
1 parent 02c104c commit 46c9af8
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,14 @@ impl Decodable for CoinbasePayload {
let height = u32::consensus_decode(r)?;
let merkle_root_masternode_list = MerkleRootMasternodeList::consensus_decode(r)?;
let merkle_root_quorums = MerkleRootQuorums::consensus_decode(r)?;
let best_cl_height = if version >= 3 { Some(u32::consensus_decode(r)?) } else { None };
let best_cl_height = if version >= 3 {
let value = u8::consensus_decode(r)?;
match value {
253 => Some(u16::consensus_decode(r)? as u32),
254 => Some(u32::consensus_decode(r)?),
_ => Some(value as u32)
}
} else { None };
let best_cl_signature =
if version >= 3 { Some(BLSSignature::consensus_decode(r)?) } else { None };
let asset_locked_amount = if version >= 3 { Some(u64::consensus_decode(r)?) } else { None };
Expand Down

0 comments on commit 46c9af8

Please sign in to comment.