MCPcopy Create free account
hub / github.com/BitVM/BitVM / median

Function median

header-chain/src/header_chain.rs:286–290  ·  view source on GitHub ↗
(arr: [u32; 11])

Source from the content-addressed store, hash-verified

284}
285
286fn median(arr: [u32; 11]) -> u32 {
287 let mut sorted_arr = arr;
288 sorted_arr.sort_unstable();
289 sorted_arr[5]
290}
291
292fn validate_timestamp(block_time: u32, prev_11_timestamps: [u32; 11]) -> bool {
293 let median_time = median(prev_11_timestamps);

Callers 1

validate_timestampFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected