Skip to content

Commit 5d48711

Browse files
authored
Merge pull request #85 from TheBlueMatt/main
Add an index over `node_announcements(seen, public_key)`
2 parents dcb1d49 + 20a039c commit 5d48711

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

Cargo.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@ edition = "2021"
66
[dependencies]
77
bitcoin = "0.32.2"
88
hex-conservative = "0.2.1"
9-
lightning = { version = "0.0.124" }
10-
lightning-block-sync = { version = "0.0.124", features=["rest-client"] }
11-
lightning-net-tokio = { version = "0.0.124" }
9+
lightning = { version = "0.0.125" }
10+
lightning-block-sync = { version = "0.0.125", features=["rest-client"] }
11+
lightning-net-tokio = { version = "0.0.125" }
1212
tokio = { version = "1.25", features = ["full"] }
1313
tokio-postgres = { version = "=0.7.5" }
1414
futures = "0.3"
1515

1616
[dev-dependencies]
17-
lightning = { version = "0.0.124", features = ["_test_utils"] }
18-
lightning-rapid-gossip-sync = { version = "0.0.124" }
17+
lightning = { version = "0.0.125", features = ["_test_utils"] }
18+
lightning-rapid-gossip-sync = { version = "0.0.125" }
1919

2020
[profile.dev]
2121
panic = "abort"

src/config.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ pub(crate) fn db_index_creation_query() -> &'static str {
163163
CREATE UNIQUE INDEX IF NOT EXISTS channel_updates_key ON channel_updates (short_channel_id, direction, timestamp);
164164
CREATE INDEX IF NOT EXISTS channel_updates_seen ON channel_updates(seen);
165165
CREATE INDEX IF NOT EXISTS channel_updates_scid_asc_timestamp_desc ON channel_updates(short_channel_id ASC, timestamp DESC);
166+
CREATE INDEX IF NOT EXISTS node_announcements_seen_pubkey ON node_announcements(seen, public_key);
166167
"
167168
}
168169

src/lookup.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -602,7 +602,7 @@ pub(super) async fn fetch_node_updates<L: Deref + Clone>(network_graph: Arc<Netw
602602
latest_mutation_timestamp = None;
603603

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

608608
if let Some(last_seen_update) = current_node_delta.last_details_before_seen.as_ref() {

src/verifier.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ impl<L: Deref + Clone + Send + Sync + 'static> ChainVerifier<L> where L::Target:
5454
}
5555
let mut transaction = block.txdata.swap_remove(transaction_index as usize);
5656
if output_index as usize >= transaction.output.len() {
57-
log_error!(logger, "Could't find output {} in transaction {}", output_index, transaction.txid());
57+
log_error!(logger, "Could't find output {} in transaction {}", output_index, transaction.compute_txid());
5858
return Err(UtxoLookupError::UnknownTx);
5959
}
6060
Ok(transaction.output.swap_remove(output_index as usize))

0 commit comments

Comments
 (0)