Skip to content

Commit 421487a

Browse files
committed
Change test-aware persistence modification to use f64 timestamps.
1 parent 42a8f13 commit 421487a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/persistence.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ impl<L: Deref> GossipPersister<L> where L::Target: Logger {
164164
fee_proportional_millionths, \
165165
htlc_maximum_msat, \
166166
blob_signed \
167-
) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12) ON CONFLICT DO NOTHING"
167+
) VALUES ($1, $2, TO_TIMESTAMP($3), $4, $5, $6, $7, $8, $9, $10, $11, $12) ON CONFLICT DO NOTHING"
168168
} else {
169169
"INSERT INTO channel_updates (\
170170
short_channel_id, \
@@ -183,7 +183,7 @@ impl<L: Deref> GossipPersister<L> where L::Target: Logger {
183183

184184
// this may not be used outside test cfg
185185
#[cfg(test)]
186-
let system_time: std::time::SystemTime = std::time::UNIX_EPOCH + Duration::from_secs(timestamp as u64);
186+
let system_time = timestamp as f64;
187187

188188
tokio::time::timeout(POSTGRES_INSERT_TIMEOUT, client
189189
.execute(insertion_statement, &[

0 commit comments

Comments
 (0)