lightningd: fix name of chainmoves journal entry.
What changed, and why it matters
This commit fixes a simple naming mismatch that could crash Core Lightning when upgrading from older versions. The internal code expected the tag 'journal_entry', but one place still used 'journal'. The result was an automatic abort (fatal crash) during database migration, not a security vulnerability that an attacker could exploit.
Treat as a reliability/availability fix rather than a security patch. Users upgrading across affected versions should ensure this fix is included so migration does not abort. No immediate incident-response action is required.
Security signals we found
Fatal abort() during database migration
String-tag mismatch between migration data and enum table
No input validation bypass or memory corruption
Evidence from the diff
The patch changes the coin-movement tag string from ‘journal’ to ‘journal_entry’ in common/coin_mvt.c, two JSON schemas, and related tests. The commit message shows that migrate_from_account_db() calls abort() when it encounters an unexpected tag during account database migration; the gdb output reveals ev->tag was ‘journal_entry’ while the mvt_tags table still contained ‘journal’. This is a consistency fix for a migration-time fatal assertion, not a code-execution or privilege-escalation bug.
Changed components
common/coin_mvt.cwallet/account_migration.c (migration logic affected at runtime)contrib/msggen/msggen/schema.jsondoc/schemas/listchannelmoves.jsontests/test_bookkeeper.pytests/test_coinmoves.pyInspect captured patch +7 / −7
diff --git a/common/coin_mvt.c b/common/coin_mvt.c
index 20168317..4a306334 100644
--- a/common/coin_mvt.c
+++ b/common/coin_mvt.c
@@ -34,7 +34,7 @@ static const char *mvt_tags[] = {
"channel_proposed",
"splice",
"penalty_adj",
- "journal",
+ "journal_entry",
"foreign",
};
diff --git a/contrib/msggen/msggen/schema.json b/contrib/msggen/msggen/schema.json
index 68a5a44c..b948a0c3 100644
--- a/contrib/msggen/msggen/schema.json
+++ b/contrib/msggen/msggen/schema.json
@@ -16855,7 +16855,7 @@
"lease_fee",
"channel_proposed",
"penalty_adj",
- "journal"
+ "journal_entry"
],
"description": [
"A set of one or more tags defining the nature of the change"
diff --git a/doc/schemas/listchannelmoves.json b/doc/schemas/listchannelmoves.json
index a803136c..d98a72b7 100644
--- a/doc/schemas/listchannelmoves.json
+++ b/doc/schemas/listchannelmoves.json
@@ -103,7 +103,7 @@
"lease_fee",
"channel_proposed",
"penalty_adj",
- "journal"
+ "journal_entry"
],
"description": [
"A set of one or more tags defining the nature of the change"
diff --git a/tests/test_bookkeeper.py b/tests/test_bookkeeper.py
index c80c03fb..edb57c0a 100644
--- a/tests/test_bookkeeper.py
+++ b/tests/test_bookkeeper.py
@@ -1126,7 +1126,7 @@ def test_migration_no_bkpr(node_factory, bitcoind):
'currency': 'bcrt',
'debit_msat': 12345678,
'is_rebalance': False,
- 'tag': 'journal',
+ 'tag': 'journal_entry',
'type': 'channel'}]
assert l2_events == [{'account': chan['channel_id'],
@@ -1142,5 +1142,5 @@ def test_migration_no_bkpr(node_factory, bitcoind):
'currency': 'bcrt',
'debit_msat': 0,
'is_rebalance': False,
- 'tag': 'journal',
+ 'tag': 'journal_entry',
'type': 'channel'}]
diff --git a/tests/test_coinmoves.py b/tests/test_coinmoves.py
index acf1c0d4..0cdefe83 100644
--- a/tests/test_coinmoves.py
+++ b/tests/test_coinmoves.py
@@ -2021,14 +2021,14 @@ def test_migration_no_bkpr(node_factory, bitcoind):
'credit_msat': 0,
'debit_msat': 12345678,
'fees_msat': 0,
- 'primary_tag': 'journal',
+ 'primary_tag': 'journal_entry',
}]
expected_channel2 = [{'account_id': chan['channel_id'],
'created_index': 1,
'credit_msat': 12345678,
'debit_msat': 0,
'fees_msat': 0,
- 'primary_tag': 'journal',
+ 'primary_tag': 'journal_entry',
}]
expected_chain1 = [{'account_id': 'wallet',
'blockheight': 103,
Why this scored 26/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.