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 authored and danielabrozzoni committed Jan 10, 2024
1 parent 887e112 commit 761189a
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 @@ -390,7 +390,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 761189a

Please sign in to comment.