common: reintroduce "ignored" primary tag.

Prior to 23.05, we used this tag to mark onchain to-self inputs we didn't
wait for (because they were too small).  This fixes migration if that happened
(and we are debating whether we should re-introduce this!).

```
lightningd: FATAL SIGNAL 6 (version v25.09rc2)                      
0x100c8683 send_backtrace                                           
        common/daemon.c:33                                          
0x100c876f crashdump                                                
        common/daemon.c:78                                          
0x7fffb2080493 ???                                                  
        ???:0                                                       
0x7fffb1ab0cac ???                                                  
        __pthread_kill_implementation+0x1bc:0
0x7fffb1a48a5b ???                                                  
        __GI_raise+0x2b:0                                           
0x7fffb1a2a3db ???                                                  
        __GI_abort+0x153:0                                          
0x100935b7 migrate_from_account_db
        wallet/account_migration.c:424
0x10093ff7 db_migrate                                               
        wallet/db.c:1139                                            
0x10096763 db_setup                                                 
        wallet/db.c:1185                                            
0x100a1bcb wallet_new                                               
        wallet/wallet.c:223                                         
0x1004485f main                                                     
        lightningd/lightningd.c:1311
0x7fffb1a2aba3 ???                                                  
        __libc_start_call_main+0x93:0
0x7fffb1a2adeb ???                                                  
        __libc_start_main_alias_1+0x1ab:0
0xffffffffffffffff ???                                              
        ???:0                                                       
lightningd: Died with signal 6                                  
```

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Fixes: https://github.com/ElementsProject/lightning/issues/8484
This commit is contained in:
Rusty Russell
2025-08-28 10:10:37 +09:30
parent 0493b47814
commit 22a5e9e7e6
6 changed files with 13 additions and 2 deletions

View File

@@ -36,6 +36,7 @@ static const char *mvt_tags[] = {
"penalty_adj",
"journal_entry",
"foreign",
"ignored",
};
#define PRIMARY_TAG_BITS ((1ULL << MVT_DEPOSIT) | \
@@ -59,7 +60,8 @@ static const char *mvt_tags[] = {
(1ULL << MVT_LEASE_FEE) | \
(1ULL << MVT_PENALTY_ADJ) | \
(1ULL << MVT_JOURNAL) | \
(1ULL << MVT_CHANNEL_PROPOSED))
(1ULL << MVT_CHANNEL_PROPOSED) | \
(1ULL << MVT_IGNORED))
static enum mvt_tag mvt_tag_in_db(enum mvt_tag mvt_tag)
{
@@ -145,6 +147,9 @@ static enum mvt_tag mvt_tag_in_db(enum mvt_tag mvt_tag)
case MVT_FOREIGN:
BUILD_ASSERT(MVT_FOREIGN == 26);
return mvt_tag;
case MVT_IGNORED:
BUILD_ASSERT(MVT_IGNORED == 27);
return mvt_tag;
}
abort();
}

View File

@@ -40,7 +40,8 @@ enum mvt_tag {
MVT_PENALTY_ADJ = 24,
MVT_JOURNAL = 25,
MVT_FOREIGN = 26,
#define NUM_MVT_TAGS (MVT_FOREIGN + 1)
MVT_IGNORED = 27,
#define NUM_MVT_TAGS (MVT_IGNORED + 1)
};
struct mvt_tags {

View File

@@ -186,6 +186,8 @@ static bool mvt_tag_is_primary(enum mvt_tag tag)
return true;
case MVT_FOREIGN:
return false;
case MVT_IGNORED:
return true;
}
abort();
}

View File

@@ -16666,6 +16666,7 @@
"to_them",
"penalized",
"stolen",
"ignored",
"to_miner"
],
"description": [

View File

@@ -114,6 +114,7 @@
"to_them",
"penalized",
"stolen",
"ignored",
"to_miner"
],
"description": [

View File

@@ -218,6 +218,7 @@ void maybe_update_account(struct command *cmd,
case MVT_PENALTY_ADJ:
case MVT_JOURNAL:
case MVT_FOREIGN:
case MVT_IGNORED:
/* Ignored */
break;
}