From: merge-script Date: Sun, 18 Oct 2026 09:32:32 +0000 (+1100) Subject: Merge bitcoindevkit/bdk#2335: fix(chain): reject an occupied index in insert_spk X-Git-Url: http://internal-gitweb-vhost/-client-interface/%22https:/node.html?a=commitdiff_plain;h=HEAD;p=bdk Merge bitcoindevkit/bdk#2335: fix(chain): reject an occupied index in insert_spk ee1909efdbe53261e268819cf7d1cd9260a03df0 fix(chain): reject an occupied index in insert_spk (hassan) Pull request description: ### Description Fixes #2279. SpkTxOutIndex::insert_spk currently accepts a different script at an existing index. The forward lookup is overwritten while the old reverse lookup remains, so the two maps disagree. This returns false without changing state when the index is already occupied, matching the existing behavior for an occupied script. The method documentation now covers both cases. ### Notes to the reviewers Added regressions for both lookup directions, unused scripts and previously scanned outputs. A rejected insertion preserves the old output and used status, and the rejected script is not tracked. Testing on the refreshed master base: - Rust 1.85: bdk_chain with all features, 99 tests/doctests pass, 1 ignored. - Changed-crate clippy with all targets and features passes with warnings denied. - Workspace formatting check passes. - Full workspace pre-push suite has not been rerun on this base. ### Changelog notice Reject duplicate indices in SpkTxOutIndex::insert_spk without changing existing script or output state. ACKs for top commit: evanlinjin: ACK ee1909efdbe53261e268819cf7d1cd9260a03df0 Tree-SHA512: 21c1220dabc4c36cc8161eeb7f8b0284baac6c575b64aac5802dfec04416dbdf964f672b0aad36f3cfe53271709c9f698ba644c3f018bb149848866896e7c43f --- 7f7f653b760f083b98beb94a5aaaa047f2c0288c