refactor(chain): calculate DescriptorId as sha256 hash of spk at index 0

Also update docs to explain how KeychainTxOutIndex handles descriptors that
generate the same spks.
This commit is contained in:
Steve Myers
2024-06-25 10:51:51 -05:00
parent 6dab68d35b
commit 46c6f18cc3
3 changed files with 16 additions and 12 deletions

View File

@@ -91,6 +91,9 @@ const COINBASE_MATURITY: u32 = 100;
/// [`ChangeSet`]s (see [`take_staged`]). Also see individual functions and example for instructions
/// on when [`Wallet`] state needs to be persisted.
///
/// The `Wallet` descriptor (external) and change descriptor (internal) must not derive the same
/// script pubkeys. See [`KeychainTxOutIndex::insert_descriptor()`] for more details.
///
/// [`signer`]: crate::signer
/// [`take_staged`]: Wallet::take_staged
#[derive(Debug)]