channel_id: save to database, dont derive from funding_txid

v2 channel open uses a different method to derive the channel_id, so now
we save it to the database so that we dont have to remember how to
derive it for each.

includes a migration for existing channels
This commit is contained in:
niftynei
2020-09-09 16:50:53 +09:30
committed by Rusty Russell
parent b2170cf3f4
commit 864f2f3e21
33 changed files with 564 additions and 437 deletions

View File

@@ -1,4 +1,5 @@
#include <bitcoin/tx.h>
#include <common/channel_id.h>
#include <common/cryptomsg.h>
#include <common/htlc_wire.h>
#include <common/per_peer_state.h>
@@ -6,6 +7,7 @@
msgtype,closingd_init,2001
msgdata,closingd_init,chainparams,chainparams,
msgdata,closingd_init,pps,per_peer_state,
msgdata,closingd_init,channel_id,channel_id,
msgdata,closingd_init,funding_txid,bitcoin_txid,
msgdata,closingd_init,funding_txout,u16,
msgdata,closingd_init,funding_satoshi,amount_sat,
1 #include <bitcoin/tx.h>
2 #include <common/channel_id.h>
3 #include <common/cryptomsg.h>
4 #include <common/htlc_wire.h>
5 #include <common/per_peer_state.h>
7 msgtype,closingd_init,2001
8 msgdata,closingd_init,chainparams,chainparams,
9 msgdata,closingd_init,pps,per_peer_state,
10 msgdata,closingd_init,channel_id,channel_id,
11 msgdata,closingd_init,funding_txid,bitcoin_txid,
12 msgdata,closingd_init,funding_txout,u16,
13 msgdata,closingd_init,funding_satoshi,amount_sat,