Skip to content

Commit

Permalink
Merge pull request #85 from TheBlueMatt/main
Browse files Browse the repository at this point in the history
Add an index over `node_announcements(seen, public_key)`
  • Loading branch information
arik-so authored Nov 21, 2024
2 parents dcb1d49 + 20a039c commit 5d48711
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ edition = "2021"
[dependencies]
bitcoin = "0.32.2"
hex-conservative = "0.2.1"
lightning = { version = "0.0.124" }
lightning-block-sync = { version = "0.0.124", features=["rest-client"] }
lightning-net-tokio = { version = "0.0.124" }
lightning = { version = "0.0.125" }
lightning-block-sync = { version = "0.0.125", features=["rest-client"] }
lightning-net-tokio = { version = "0.0.125" }
tokio = { version = "1.25", features = ["full"] }
tokio-postgres = { version = "=0.7.5" }
futures = "0.3"

[dev-dependencies]
lightning = { version = "0.0.124", features = ["_test_utils"] }
lightning-rapid-gossip-sync = { version = "0.0.124" }
lightning = { version = "0.0.125", features = ["_test_utils"] }
lightning-rapid-gossip-sync = { version = "0.0.125" }

[profile.dev]
panic = "abort"
Expand Down
1 change: 1 addition & 0 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ pub(crate) fn db_index_creation_query() -> &'static str {
CREATE UNIQUE INDEX IF NOT EXISTS channel_updates_key ON channel_updates (short_channel_id, direction, timestamp);
CREATE INDEX IF NOT EXISTS channel_updates_seen ON channel_updates(seen);
CREATE INDEX IF NOT EXISTS channel_updates_scid_asc_timestamp_desc ON channel_updates(short_channel_id ASC, timestamp DESC);
CREATE INDEX IF NOT EXISTS node_announcements_seen_pubkey ON node_announcements(seen, public_key);
"
}

Expand Down
2 changes: 1 addition & 1 deletion src/lookup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ pub(super) async fn fetch_node_updates<L: Deref + Clone>(network_graph: Arc<Netw
latest_mutation_timestamp = None;

// this is the highest timestamp value, so set the seen timestamp accordingly
current_node_delta.latest_details.as_mut().map(|mut d| d.seen.replace(current_seen_timestamp));
current_node_delta.latest_details.as_mut().map(|d| d.seen.replace(current_seen_timestamp));
}

if let Some(last_seen_update) = current_node_delta.last_details_before_seen.as_ref() {
Expand Down
2 changes: 1 addition & 1 deletion src/verifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ impl<L: Deref + Clone + Send + Sync + 'static> ChainVerifier<L> where L::Target:
}
let mut transaction = block.txdata.swap_remove(transaction_index as usize);
if output_index as usize >= transaction.output.len() {
log_error!(logger, "Could't find output {} in transaction {}", output_index, transaction.txid());
log_error!(logger, "Could't find output {} in transaction {}", output_index, transaction.compute_txid());
return Err(UtxoLookupError::UnknownTx);
}
Ok(transaction.output.swap_remove(output_index as usize))
Expand Down

0 comments on commit 5d48711

Please sign in to comment.