Skip to content

Commit

Permalink
feat(chain): debug_assert non-wildcard desc. to only cache index 0
Browse files Browse the repository at this point in the history
  • Loading branch information
evanlinjin committed Jan 9, 2024
1 parent 132f91a commit a28bbb2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion crates/chain/src/keychain/txout_index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,11 @@ impl<K: Clone + Ord + Debug> KeychainTxOutIndex<K> {
let _inserted = self
.inner
.insert_spk((keychain.clone(), new_index), new_spk);
debug_assert!(_inserted, "must not have existing spk",);
debug_assert!(_inserted, "must not have existing spk");
debug_assert!(
has_wildcard || new_index == 0,
"non-wildcard descriptors must not iterate past index 0"
);
}

let _old_index = self.last_revealed.insert(keychain.clone(), target_index);
Expand Down

0 comments on commit a28bbb2

Please sign in to comment.