Create method for obtaining UTC-prepared Postgres client.
[rapid-gossip-sync-server] / src / lookup.rs
index eb0c8eed688bf7dc0690387a6a35d70795c3b32d..696b4d041ab508b53c7074884a63b89047d4957a 100644 (file)
@@ -7,8 +7,7 @@ use std::time::{Instant, SystemTime, UNIX_EPOCH};
 use lightning::ln::msgs::{ChannelAnnouncement, ChannelUpdate, UnsignedChannelAnnouncement, UnsignedChannelUpdate};
 use lightning::routing::gossip::NetworkGraph;
 use lightning::util::ser::Readable;
-use tokio_postgres::{Client, Connection, NoTls, Socket};
-use tokio_postgres::tls::NoTlsStream;
+use tokio_postgres::Client;
 
 use futures::StreamExt;
 use lightning::log_info;
@@ -68,11 +67,6 @@ impl Default for DirectedUpdateDelta {
        }
 }
 
-pub(super) async fn connect_to_db() -> (Client, Connection<Socket, NoTlsStream>) {
-       let connection_config = config::db_connection_config();
-       connection_config.connect(NoTls).await.unwrap()
-}
-
 /// Fetch all the channel announcements that are presently in the network graph, regardless of
 /// whether they had been seen before.
 /// Also include all announcements for which the first update was announced