Skip to content

Commit 1970641

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 b0c2bca commit 1970641

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/persistence.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ impl<L: Deref + Clone + Send + Sync + 'static> GossipPersister<L> where L::Targe
194194
short_channel_id, \
195195
funding_amount_sats, \
196196
announcement_signed \
197-
) VALUES ($1, $2, $3) ON CONFLICT (short_channel_id) DO NOTHING", &[
197+
) VALUES ($1, $2, $3) ON CONFLICT (short_channel_id) DO UPDATE SET funding_amount_sats = $2", &[
198198
&scid,
199199
&(funding_value as i64),
200200
&announcement_signed

0 commit comments

Comments
 (0)