feat(chain): debug_assert non-wildcard desc. to only cache index 0

This commit is contained in:
志宇 authored and Daniela Brozzoni committed 2024-01-10 22:47:53 +01:00
1 parent 887e112e8f
commit 761189ab2b
1 file changed
+5 -1
+5 -1
View File
@@ -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);