rgb-cln/wallet
Christian Decker 7b899da801 db: Retrieve peer ID if it exists or create the peer if not
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.
2020-07-01 09:22:29 +09:30
..
test psbt: database migration for converting last_tx to a psbt 2020-06-11 13:13:13 +02:00
.gitignore wallet: Create and manage a sqlite3 database for the wallet 2017-06-06 09:16:10 +09:30
Makefile wallet/Makefile: fix dependency line. 2019-11-28 11:50:13 +01:00
db.c psbt: don't crash if we can't add a partial sig 2020-06-23 14:49:32 +02:00
db.h psbt: database migration for converting last_tx to a psbt 2020-06-11 13:13:13 +02:00
db_common.h db: Track the data_version in the database 2020-01-02 14:12:59 -06:00
db_postgres.c db: Implement postgres driver primitives 2019-09-22 02:03:43 +00:00
db_sqlite3.c db: unregister sqlite3 trace callback also in error case 2020-05-07 10:41:16 +09:30
invoices.c sort listinvoices and listsendpays by order of creation. 2020-05-29 15:30:59 +02:00
invoices.h wallet: add invoice features into db. 2019-11-24 23:33:17 +00:00
txfilter.c common: tal_dup_talarr() helper. 2020-02-27 14:16:16 +10:30
txfilter.h pubkey: rename PUBKEY_DER_LEN to PUBKEY_CMPR_LEN. 2019-04-09 12:37:16 -07:00
wallet.c db: Retrieve peer ID if it exists or create the peer if not 2020-07-01 09:22:29 +09:30
wallet.h wallet: have wallet_extract_outputs take wally_tx, not bitcoin_tx 2020-06-29 16:10:05 +02:00
walletrpc.c wallet/walletrpc.c: Show input annotations for inputs. 2020-06-30 17:59:17 +02:00
walletrpc.h Use expected LIGHTNING_DIR_FILE_H define 2018-03-25 23:54:21 +00:00