Skip to content

Commit d2629cb

Browse files
committed
chore(chain): document insert_descriptor invariants better
1 parent fd8322a commit d2629cb

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

crates/chain/src/keychain/txout_index.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,11 @@ pub const DEFAULT_LOOKAHEAD: u32 = 25;
2727
///
2828
/// There is a strict 1-to-1 relationship between descriptors and keychains. Each keychain has one
2929
/// and only one descriptor and each descriptor has one and only one keychain. The
30-
/// [`insert_descriptor`] method will return an error if you try and violate this invariant.
30+
/// [`insert_descriptor`] method will return an error if you try and violate this invariant. This
31+
/// rule is a proxy for a stronger rule: no two descriptors should produce the same script pubkey.
32+
/// Having two descriptors produce the same script pubkey should cause whichever keychain derives the
33+
/// script pubkey first to be the effective owner of it but you should not rely on this behaviour.
34+
/// ⚠ It is up you, the developer, not to violate this invariant.
3135
///
3236
/// # Revealed script pubkeys
3337
///

0 commit comments

Comments
 (0)