mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 18:11:28 +01:00
72108f0cb9
We derive the seed from this, so it needs to be unique, but using rowid forced us to put the channel into the db early, before it was ready. Instead, use a counter to ensure uniqueness, initialized when we load existing peers. This doesn't need to touch the database at all. As we now have only two places where the channel is committed (the funder and fundee paths), so we create a new explicit 'wallet_channel_insert()' function: 'wallet_channel_save()' now just updates. Note that this also fixes some weirdness in wallet_channels_load_active: we strangely avoided loading channels in CLOSINGD_COMPLETE (which fortunately was a transient state, so unlikely anyone hit this). Note that since the lines above already delete all the OPENINGD channels, we now simply load them all. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> |
||
---|---|---|
.. | ||
.gitignore | ||
Makefile | ||
run-db.c | ||
run-wallet.c | ||
test_utils.h |