Browse Source

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>
ppa-0.6.1
Rusty Russell 7 years ago
committed by Christian Decker
parent
commit
15eaf56d79
  1. 2
      lightningd/test/run-find_my_path.c
  2. 5
      wallet/wallet.c
  3. 3
      wallet/wallet.h

2
lightningd/test/run-find_my_path.c

@ -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 */

5
wallet/wallet.c

@ -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;

3
wallet/wallet.h

@ -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);
/**

Loading…
Cancel
Save