mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 09:54:16 +01:00
7b899da801
We were assuming `wallet_channel_insert` that there cannot be a matching peer if our in-memory representation isn't bound to it (`dbid == 0`). If we then attempt to create the peer, and we already had one it'd cause a unique constraint violation. As far as I can tell this could end up happening if we have an uncommitted channel, and then exited without cleanup (`tal_destructor` on the uncommitted channel not running). This could then leave the peer in the DB. This is because the constraint that every peer has at least one channel is not enforce at DB level, but rather in destructors that may or may not run. Changelog-Fixed: Fixed a failing assertion if we reconnect to a peer that we had a channel with before, and then attempt to insert the peer into the DB twice. |
||
---|---|---|
.. | ||
test | ||
.gitignore | ||
db_common.h | ||
db_postgres.c | ||
db_sqlite3.c | ||
db.c | ||
db.h | ||
invoices.c | ||
invoices.h | ||
Makefile | ||
txfilter.c | ||
txfilter.h | ||
wallet.c | ||
wallet.h | ||
walletrpc.c | ||
walletrpc.h |