- tokio::time::timeout(POSTGRES_INSERT_TIMEOUT, client
- .execute("INSERT INTO channel_announcements (\
+ if cfg!(test) && seen_override.is_some() {
+ tokio::time::timeout(POSTGRES_INSERT_TIMEOUT, client
+ .execute("INSERT INTO channel_announcements (\
+ short_channel_id, \
+ announcement_signed, \
+ seen \
+ ) VALUES ($1, $2, TO_TIMESTAMP($3)) ON CONFLICT (short_channel_id) DO NOTHING", &[
+ &scid,
+ &announcement_signed,
+ &(seen_override.unwrap() as f64)
+ ])).await.unwrap().unwrap();
+ } else {
+ tokio::time::timeout(POSTGRES_INSERT_TIMEOUT, client
+ .execute("INSERT INTO channel_announcements (\