]> Untitled Git - bdk/commit
Changed `inflate_update` logic to not depend on `Cow`
author志宇 <hello@evanlinjin.me>
Tue, 7 Mar 2023 12:53:09 +0000 (01:53 +1300)
committer志宇 <hello@evanlinjin.me>
Tue, 7 Mar 2023 12:53:09 +0000 (01:53 +1300)
commitde9457fce67f5bdc7a128f68d2e14ec4d4f8947b
tree44f2e9d682bbf1277d519b03a3479d1f9e60fc18
parent69cf6d7924c4599e6a4fd4cd52c291e640324a8f
Changed `inflate_update` logic to not depend on `Cow`

As mentioned by @LLFourn:

1. We have a "sparse chain" from which there is a subset of txids M that are missing from graph.
2. There is also another subset C that are in the graph but their positions have changed.
3. We used the Cow to avoid copying/duplicating in memory transactions in subset C and M

Instead in inflate_update we could remove transactions in subset M and just clone data in subset C (which is usually tiny).
crates/chain/src/chain_graph.rs
crates/electrum/src/lib.rs