From df67b7d94c56ef8f75994e02885bb5c78314ef13 Mon Sep 17 00:00:00 2001 From: Luke Parker Date: Mon, 10 Jul 2023 15:02:34 -0400 Subject: [PATCH] 3.13 Better document the offset mapping --- coins/bitcoin/src/wallet/mod.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/coins/bitcoin/src/wallet/mod.rs b/coins/bitcoin/src/wallet/mod.rs index 3997730e..ea91d2ae 100644 --- a/coins/bitcoin/src/wallet/mod.rs +++ b/coins/bitcoin/src/wallet/mod.rs @@ -114,6 +114,9 @@ impl Scanner { /// Due to Bitcoin's requirement that points are even, not every offset may be used. /// If an offset isn't usable, it will be incremented until it is. If this offset is already /// present, None is returned. Else, Some(offset) will be, with the used offset. + /// + /// This means offsets are surjective, not bijective, and the order offsets are registered in + /// may determine the validity of future offsets. pub fn register_offset(&mut self, mut offset: Scalar) -> Option { // This loop will terminate as soon as an even point is found, with any point having a ~50% // chance of being even