From 359febb2e2bcc8a0e62bde540f7d4fb7f4102748 Mon Sep 17 00:00:00 2001 From: teor Date: Wed, 22 Jul 2020 22:10:36 +1000 Subject: [PATCH] doc: Update a CheckpointList comment --- zebra-consensus/src/checkpoint/list.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zebra-consensus/src/checkpoint/list.rs b/zebra-consensus/src/checkpoint/list.rs index 14aecf34..b1642f08 100644 --- a/zebra-consensus/src/checkpoint/list.rs +++ b/zebra-consensus/src/checkpoint/list.rs @@ -25,12 +25,15 @@ const TESTNET_CHECKPOINTS: &str = include_str!("test-checkpoints.txt"); // TODO(jlusby): Error = Report ? type Error = Box; -/// Checkpoint lists are implemented using a BTreeMap. +/// A list of block height and hash checkpoints. /// /// Checkpoints should be chosen to avoid forks or chain reorganizations, /// which only happen in the last few hundred blocks in the chain. /// (zcashd allows chain reorganizations up to 99 blocks, and prunes /// orphaned side-chains after 288 blocks.) +/// +/// This is actually a bijective map, but since it is read-only, we use a +/// BTreeMap, and do the value uniqueness check on initialisation. #[derive(Debug)] pub(crate) struct CheckpointList(BTreeMap);