Skip to content

Commit ff46994

Browse files
committed
wallet: re-add ADDR_P2SH_SEGWIT type to enum addrtype
It was long obsoleted, and never appears in the DB, but we do still have to handle old ones in the code. We removed it from the enum in f342630 (v24.02) after deprecating it in 23.02. Signed-off-by: Rusty Russell <[email protected]>
1 parent 642ca0a commit ff46994

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

wallet/wallet.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,7 @@ static inline enum channel_state channel_state_in_db(enum channel_state s)
274274
/* /!\ This is a DB ENUM, please do not change the numbering of any
275275
* already defined elements (adding is ok) /!\ */
276276
enum addrtype {
277+
ADDR_P2SH_SEGWIT = 1,
277278
ADDR_BECH32 = 2,
278279
ADDR_P2TR = 4,
279280
ADDR_ALL = (ADDR_BECH32 + ADDR_P2TR)
@@ -291,6 +292,10 @@ static inline enum addrtype wallet_addrtype_in_db(enum addrtype t)
291292
case ADDR_ALL:
292293
BUILD_ASSERT(ADDR_ALL == 6);
293294
return t;
295+
/* This existed, but is NEVER placed into db */
296+
case ADDR_P2SH_SEGWIT:
297+
BUILD_ASSERT(ADDR_P2SH_SEGWIT == 1);
298+
break;
294299
}
295300
fatal("%s: %u is invalid", __func__, t);
296301
}

wallet/walletrpc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ encode_pubkey_to_addr(const tal_t *ctx,
7575
goto done;
7676
}
7777

78+
case ADDR_P2SH_SEGWIT:
7879
case ADDR_ALL:
7980
abort();
8081
}

0 commit comments

Comments
 (0)