Skip to content

Commit 9ac2594

Browse files
committed
Ensure we set funding amounts on old channels still on the graph
In c02f2ec we added `funding_amount_sats` to `channel_announcements`, making it `NOT NULL` for new DBs, but `NULL` for old ones. When querying, however, we (indirectly) `unwrap`ed the values. Here, we try to backfill by looking at the local network graph on startup and updating the existing entries, rather than ignoring conflicting writes.
1 parent ceb355b commit 9ac2594

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/persistence.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ impl<L: Deref + Clone + Send + Sync + 'static> GossipPersister<L> where L::Targe
203203
short_channel_id, \
204204
funding_amount_sats, \
205205
announcement_signed \
206-
) VALUES ($1, $2, $3) ON CONFLICT (short_channel_id) DO NOTHING", &[
206+
) VALUES ($1, $2, $3) ON CONFLICT (short_channel_id) DO UPDATE SET funding_amount_sats = $2", &[
207207
&scid,
208208
&(funding_value as i64),
209209
&announcement_signed

0 commit comments

Comments
 (0)