Commit graph

24 commits

Author SHA1 Message Date
Elias Rohrer
85a82045fe
rustfmt: Reformat lightning-transaction-sync/src/lib.rs 2024-06-07 11:35:15 +02:00
Elias Rohrer
915fe195ca
rustfmt: Reformat lightning-transaction-sync/src/error.rs 2024-06-07 11:35:15 +02:00
Elias Rohrer
c5cd801f87
rustfmt: Reformat lightning-transaction-sync/src/esplora.rs 2024-06-07 11:35:15 +02:00
Elias Rohrer
470085aa2f
rustfmt: Reformat lightning-transaction-sync/src/electrum.rs 2024-06-07 11:35:15 +02:00
Elias Rohrer
3ead26323e
rustfmt: Reformat lightning-transaction-sync/src/common.rs 2024-06-07 11:35:15 +02:00
Elias Rohrer
777ce7b059
Make confirmables Deref
.. the bindings branch needed a small patch as it doesn't support `dyn`
traits. Here, we opt to use `Deref` in the hopes this works with
bindings, rendering the patch unnecessary.
2024-06-06 09:18:04 +02:00
Matt Corallo
4ec286979c Mark BDK types exported from transaction-sync as no-export 2024-06-05 14:46:08 +00:00
Jiri Jakes
a8bd4c097f
Upgrade rust-bitcoin to 0.31 2024-05-30 18:35:29 +08:00
Elias Rohrer
b71c6e2f67
Dedup confirmed_txs Vec
Previously, we would just push to the `confirmed_txs` `Vec`, leading to
redundant `Confirm::transactions_confirmed` calls, especially now that
we re-confirm previously disconnected spends.

Here, we ensure that we don't push additional `ConfirmedTx` entries if
already one with matching `Txid` is present. This not only gets rid of
the spurious `transactions_confirmed` calls (which are harmless), but
more importantly saves us from issuing unnecessary network calls, which
improves latency.
2024-03-21 17:41:26 +01:00
Elias Rohrer
2f581104b2
Track spent WatchedOutputs and re-add if unconfirmed
Previously, we would track a spending transaction but wouldn't account
for it being reorged out of the chain, in which case we wouldn't monitor
the `WatchedOutput`s until they'd be reloaded on restart.

Here, we keep any `WatchedOutput`s around until their spends are
sufficiently confirmed and only prune them after `ANTI_REORG_DELAY`.
2024-03-19 15:55:28 +01:00
Elias Rohrer
2bd12137a4
Feature-gate time use also in ElectrumSyncClient
A previous commit introduced the `time` feature to gate the use of
`SystemTime` dependent APIs in `EsploraSyncClient`. It however omitted
doing the same for the Electrum side of things. Here, we address this
oversight.
2024-01-09 09:37:14 +01:00
benthecarman
f836794e98
Don't call system time in unless feature enabled 2023-12-19 13:22:17 -06:00
Elias Rohrer
ddf2509227
Bump MSRV to rustc 1.63.0 and edition to 2021
.. which is a reasonable common ground, also supported by Debian stable.
2023-12-08 14:03:45 +01:00
Elias Rohrer
4dd5ccbe49
Implement ElectrumSyncClient 2023-11-23 09:30:57 +01:00
Elias Rohrer
d2ecf0766c
Set pending_sync when last-minute check fails in Esplora 2023-11-23 09:30:57 +01:00
Elias Rohrer
82f4c10e18
Move sync_ methods to SyncState 2023-11-23 09:30:57 +01:00
Elias Rohrer
48c46bf772
Improve EsploraSyncClient logging
We give some more information while reducing the log levels to make the
logging less spammy.

We also convert one safe-to-unwrap case from returning an error to
unwrapping the value.
2023-11-23 09:30:57 +01:00
Elias Rohrer
c8ff32197a
Return confirmation height via Confirm::get_relevant_txids
We previously included the block hash, but it's also useful to include
the height under which we expect the respective transaction to be
confirmed.
2023-11-23 09:30:56 +01:00
Wilmer Paulino
ec928d55b4
Bump rust-bitcoin to v0.30.2 2023-11-22 15:58:01 -08:00
Elias Rohrer
ff865eb685
Make lightning-transaction-sync compat notice a bit more explicit
As `lightning-transaction-sync` was introduced with 0.0.114 and depended
on prior changes in the same release cycle we deemed it reasonable to
omit the implicitly limited backwards compatibility.

It however turns out this might be confusing to users copy/pasting the
codebase. Here we therefore spell out the implicit dependency on 0.0.114
and above.
2023-05-09 10:44:48 +02:00
Elias Rohrer
09038ee478
Remove unnecessary logging imports 2023-03-08 19:25:28 +01:00
Elias Rohrer
7a30f3e118
Support HTTPS Esplora endpoints via new feature
To support HTTPS endpoints, the async HTTP library `reqwest` needs one of
the `-tls` features enabled. While the users could specify this in their
own cargo dependencies, we here provide a new `esplora-async-https`
feature for conveinience.
2023-03-08 19:25:23 +01:00
benthecarman
53788913c9
Fix typos in lightning-transaction-sync 2023-03-02 23:36:54 -06:00
Elias Rohrer
fa77f34327
Add transaction sync crate
This crate provides utilities for syncing LDK via the transaction-based
`Confirm` interface. The initial implementation facilitates
synchronization with an Esplora backend server.
2023-02-09 15:28:34 -06:00