wallet: add ld pointer.

This will be required to give it direct access to the ld->peers list.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2018-02-12 20:40:17 +10:30 committed by Christian Decker
parent fcffbd0f20
commit 15eaf56d79
3 changed files with 6 additions and 4 deletions

View File

@ -112,7 +112,7 @@ bool wallet_htlcs_reconnect(struct wallet *wallet UNNEEDED,
bool wallet_invoice_load(struct wallet *wallet UNNEEDED)
{ fprintf(stderr, "wallet_invoice_load called!\n"); abort(); }
/* Generated stub for wallet_new */
struct wallet *wallet_new(const tal_t *ctx UNNEEDED,
struct wallet *wallet_new(struct lightningd *ld UNNEEDED,
struct log *log UNNEEDED, struct timers *timers UNNEEDED)
{ fprintf(stderr, "wallet_new called!\n"); abort(); }
/* AUTOGENERATED MOCKS END */

View File

@ -16,10 +16,11 @@
#define DIRECTION_INCOMING 0
#define DIRECTION_OUTGOING 1
struct wallet *wallet_new(const tal_t *ctx,
struct wallet *wallet_new(struct lightningd *ld,
struct log *log, struct timers *timers)
{
struct wallet *wallet = tal(ctx, struct wallet);
struct wallet *wallet = tal(ld, struct wallet);
wallet->ld = ld;
wallet->db = db_setup(wallet, log);
wallet->log = log;
wallet->bip32_base = NULL;

View File

@ -21,6 +21,7 @@ struct pubkey;
struct timers;
struct wallet {
struct lightningd *ld;
struct db *db;
struct log *log;
struct ext_key *bip32_base;
@ -111,7 +112,7 @@ struct wallet_payment {
* This is guaranteed to either return a valid wallet, or abort with
* `fatal` if it cannot be initialized.
*/
struct wallet *wallet_new(const tal_t *ctx,
struct wallet *wallet_new(struct lightningd *ld,
struct log *log, struct timers *timers);
/**