lightningd: move bip32_base pointer into struct lightningd.

It's needed as the db and wallet is being set up (db migrations), so
it's simpler this way to always use ld->bip32_base for the next patch.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2023-03-21 14:28:15 +10:30
parent 91a9cf3512
commit 3f02797e88
13 changed files with 29 additions and 35 deletions

View File

@@ -662,7 +662,7 @@ enum watch_result onchaind_funding_spent(struct channel *channel,
return KEEP_WATCHING;
}
if (!bip32_pubkey(ld->wallet->bip32_base, &final_key,
if (!bip32_pubkey(ld->bip32_base, &final_key,
channel->final_key_idx)) {
log_broken(channel->log, "Could not derive onchain key %"PRIu64,
channel->final_key_idx);
@@ -670,7 +670,7 @@ enum watch_result onchaind_funding_spent(struct channel *channel,
}
struct ext_key final_wallet_ext_key;
if (bip32_key_from_parent(
ld->wallet->bip32_base,
ld->bip32_base,
channel->final_key_idx,
BIP32_FLAG_KEY_PUBLIC,
&final_wallet_ext_key) != WALLY_OK) {