]> Untitled Git - bdk/commit
refactor(electrum)!: put the tx cache in electrum
authorLLFourn <lloyd.fourn@gmail.com>
Fri, 31 May 2024 03:52:49 +0000 (13:52 +1000)
committer志宇 <hello@evanlinjin.me>
Tue, 4 Jun 2024 04:23:01 +0000 (12:23 +0800)
commit53fa35096fbeea2b82b28987e8ef6f7d39ffc80b
treeb9f092f954fd1e0f0126b3daad8a659f539e49c3
parent4a8452f9b8f8128affbb60665016fedb48f07cd6
refactor(electrum)!: put the tx cache in electrum

Previously there was a tx cache that you passed in as part of the sync
request. This seems bad and the example show'd that you should copy all
your transactions from the transaction graph into the sync request every
time you sync'd. If you forgot to do this then you would always download everything.

Instead just do a plain old simple cache inside the electrum client.
This way at least you only download transactions once. You can
pre-populate the cache with a method also and I did this in the examples.
crates/chain/src/indexed_tx_graph.rs
crates/chain/src/spk_client.rs
crates/electrum/src/bdk_electrum_client.rs [new file with mode: 0644]
crates/electrum/src/electrum_ext.rs [deleted file]
crates/electrum/src/lib.rs
crates/electrum/tests/test_electrum.rs
crates/wallet/src/wallet/mod.rs
example-crates/example_electrum/src/main.rs
example-crates/wallet_electrum/src/main.rs