wallet: Add bip32_base to the wallet struct

Wallet should really be the container for anything bip32 related, so
I'd like to slowly wean off of `ld->bip32_base` in favor of
`ld->wallet->bip32_base`
This commit is contained in:
Christian Decker 2017-06-21 17:26:38 +02:00 committed by Rusty Russell
parent 8cdab9da1e
commit d6656358b5
3 changed files with 4 additions and 0 deletions

View File

@ -26,6 +26,7 @@ static bool hsm_init_done(struct subd *hsm, const u8 *msg, const int *fds,
ld->bip32_base) != WALLY_OK)
errx(1, "HSM did not give unserializable BIP32 extkey");
ld->wallet->bip32_base = ld->bip32_base;
io_break(ld->hsm);
return true;
}

View File

@ -7,6 +7,7 @@ struct wallet *wallet_new(const tal_t *ctx, struct log *log)
struct wallet *wallet = tal(ctx, struct wallet);
wallet->db = db_setup(wallet);
wallet->log = log;
wallet->bip32_base = NULL;
if (!wallet->db) {
fatal("Unable to setup the wallet database");
}

View File

@ -5,10 +5,12 @@
#include "db.h"
#include <ccan/tal/tal.h>
#include <lightningd/utxo.h>
#include <wally_bip32.h>
struct wallet {
struct db *db;
struct log *log;
struct ext_key *bip32_base;
};
/* Possible states for tracked outputs in the database. Not sure yet