Skip to content

Commit e68243a

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 d16bd9e commit e68243a

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
@@ -201,7 +201,7 @@ impl<L: Deref + Clone + Send + Sync + 'static> GossipPersister<L> where L::Targe
201201
short_channel_id, \
202202
funding_amount_sats, \
203203
announcement_signed \
204-
) VALUES ($1, $2, $3) ON CONFLICT (short_channel_id) DO NOTHING", &[
204+
) VALUES ($1, $2, $3) ON CONFLICT (short_channel_id) DO UPDATE", &[
205205
&scid,
206206
&(funding_value as i64),
207207
&announcement_signed

0 commit comments

Comments
 (0)