fix(electrum)!: Remove seen_at param from into_tx_graph

and `into_confirmation_time_tx_graph`, since now it makes
sense to use `TxGraph::update_last_seen_unconfirmed`.

Also, use `update_last_seen_unconfirmed` in examples for
electrum/esplora. We show how to update the last seen
time for transactions by calling `update_last_seen_unconfirmed`
on the graph update returned from a blockchain source, passing
in the current time, before applying it to another `TxGraph`.
This commit is contained in:
valued mammal
2024-04-02 10:19:56 -04:00
parent 37fca35dde
commit a2a64ffb6e
7 changed files with 27 additions and 17 deletions

View File

@@ -53,8 +53,11 @@ fn main() -> Result<(), anyhow::Error> {
})
.collect();
let (update_graph, last_active_indices) =
let (mut update_graph, last_active_indices) =
client.full_scan(keychain_spks, STOP_GAP, PARALLEL_REQUESTS)?;
let now = std::time::UNIX_EPOCH.elapsed().unwrap().as_secs();
let _ = update_graph.update_last_seen_unconfirmed(now);
let missing_heights = update_graph.missing_heights(wallet.local_chain());
let chain_update = client.update_local_chain(prev_tip, missing_heights)?;
let update = Update {