]> Untitled Git - bdk/commitdiff
doc(core): document panic for `CheckPoint::insert`
authorvalued mammal <valuedmammal@protonmail.com>
Thu, 12 Sep 2024 19:18:01 +0000 (15:18 -0400)
committervalued mammal <valuedmammal@protonmail.com>
Thu, 12 Sep 2024 19:18:01 +0000 (15:18 -0400)
crates/core/src/checkpoint.rs

index 089db230d84925519cb5ca04d516455e7ecf7cc9..10af13277135c7ab51dd7468e82ccf7bc6681292 100644 (file)
@@ -171,6 +171,10 @@ impl CheckPoint {
     /// it. If the height already existed and has a conflicting block hash then it will be purged
     /// along with all block followin it. The returned chain will have a tip of the `block_id`
     /// passed in. Of course, if the `block_id` was already present then this just returns `self`.
+    ///
+    /// # Panics
+    ///
+    /// This panics if called with a genesis block that differs from that of `self`.
     #[must_use]
     pub fn insert(self, block_id: BlockId) -> Self {
         let mut cp = self.clone();