Skip to content

Commit 513e730

Browse files
committed
f use hard-coded values to break constant changes leading to ser break
1 parent ac4cfb0 commit 513e730

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

lightning/src/chain/mod.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,11 @@ impl BestBlock {
132132

133133
impl_writeable_tlv_based!(BestBlock, {
134134
(0, block_hash, required),
135-
(1, previous_blocks_read, (legacy, [Option<BlockHash>; ANTI_REORG_DELAY as usize * 2], |us: &BestBlock| Some(us.previous_blocks))),
135+
// Note that any change to the previous_blocks array length will change the serialization
136+
// format and thus it is specified without constants here.
137+
(1, previous_blocks_read, (legacy, [Option<BlockHash>; 6 * 2], |us: &BestBlock| Some(us.previous_blocks))),
136138
(2, height, required),
137-
(unused, previous_blocks, (static_value, previous_blocks_read.unwrap_or([None; ANTI_REORG_DELAY as usize * 2]))),
139+
(unused, previous_blocks, (static_value, previous_blocks_read.unwrap_or([None; 6 * 2]))),
138140
});
139141

140142
/// The `Listen` trait is used to notify when blocks have been connected or disconnected from the

0 commit comments

Comments
 (0)