fix: add back in network_epoch

This commit is contained in:
Jude Nelson
2021-11-15 23:50:12 -05:00
parent ce6f6c48aa
commit 4b5cea104c
2 changed files with 7 additions and 1 deletions

View File

@@ -7034,12 +7034,14 @@ pub mod test {
start_height: 0,
end_height: 0,
block_limit: ExecutionCost::max_value(),
network_epoch: PEER_VERSION_EPOCH_1_0,
},
StacksEpoch {
epoch_id: StacksEpochId::Epoch20,
start_height: 0,
end_height: 30, // NOTE: the first 25 burnchain blocks have no sortition
block_limit: ExecutionCost::max_value(),
network_epoch: PEER_VERSION_EPOCH_2_0,
},
StacksEpoch {
epoch_id: StacksEpochId::Epoch2_05,
@@ -7052,6 +7054,7 @@ pub mod test {
read_count: 205205,
runtime: 205205,
},
network_epoch: PEER_VERSION_EPOCH_2_05,
},
];
peer_config.epochs = Some(epochs);
@@ -7272,12 +7275,14 @@ pub mod test {
start_height: 0,
end_height: 0,
block_limit: ExecutionCost::max_value(),
network_epoch: PEER_VERSION_EPOCH_1_0,
},
StacksEpoch {
epoch_id: StacksEpochId::Epoch20,
start_height: 0,
end_height: 30, // NOTE: the first 25 burnchain blocks have no sortition
block_limit: ExecutionCost::max_value(),
network_epoch: PEER_VERSION_EPOCH_2_0,
},
StacksEpoch {
epoch_id: StacksEpochId::Epoch2_05,
@@ -7290,6 +7295,7 @@ pub mod test {
read_count: 205205,
runtime: 205205,
},
network_epoch: PEER_VERSION_EPOCH_2_05,
},
];
peer_config.epochs = Some(epochs);

View File

@@ -1352,7 +1352,7 @@ impl PeerNetwork {
let inbound_recipients =
if inbound_recipients_unshuffled.len() > MAX_BROADCAST_INBOUND_RECEIVERS {
&mut inbound_recipients_unshuffled[..].shuffle(&mut thread_rng());
let _ = &mut inbound_recipients_unshuffled[..].shuffle(&mut thread_rng());
inbound_recipients_unshuffled[0..MAX_BROADCAST_INBOUND_RECEIVERS].to_vec()
} else {
inbound_recipients_unshuffled