Skip to content

Commit c8de5fe

Browse files
committed
wallet: print error, don't just abort, on unknown tags.
Lisa *told* me about this on review, and I ignored it. Fool: took an extra day to get the account.db which was triggering this so I could see the problem. Signed-off-by: Rusty Russell <[email protected]>
1 parent 293a65b commit c8de5fe

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

wallet/account_migration.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,8 @@ void migrate_from_account_db(struct lightningd *ld, struct db *db)
435435
id = chain_mvt_index_created(ld, db, account, ev->credit, ev->debit);
436436
db_bind_u64(stmt, id);
437437
if (!mvt_tag_parse(ev->tag, strlen(ev->tag), &tag))
438-
abort();
438+
db_fatal(db, "Unknown tag '%s' in chain_moves migration!",
439+
ev->tag);
439440
tags = tag_to_mvt_tags(tag);
440441
if (tag == MVT_CHANNEL_OPEN && ev->we_opened)
441442
mvt_tag_set(&tags, MVT_OPENER);
@@ -521,7 +522,8 @@ void migrate_from_account_db(struct lightningd *ld, struct db *db)
521522
db_bind_mvt_account_id(stmt, db, account);
522523
db_bind_credit_debit(stmt, ev->credit, ev->debit);
523524
if (!mvt_tag_parse(ev->tag, strlen(ev->tag), &tag))
524-
abort();
525+
db_fatal(db, "Unknown tag '%s' in channel_moves migration!",
526+
ev->tag);
525527
db_bind_mvt_tags(stmt, tag_to_mvt_tags(tag));
526528
db_bind_u64(stmt, ev->timestamp);
527529
if (ev->payment_id)

0 commit comments

Comments
 (0)