Browse Source

lightningd: move notify_new_block() callback to peer_htlcs.

And change prototype to take the lightningd structure.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ppa-0.6.1
Rusty Russell 7 years ago
parent
commit
9662589ed8
  1. 4
      lightningd/chaintopology.c
  2. 2
      lightningd/chaintopology.h
  3. 6
      lightningd/lightningd.c
  4. 6
      lightningd/peer_htlcs.c

4
lightningd/chaintopology.c

@ -92,8 +92,8 @@ static void connect_block(struct chain_topology *topo,
} }
b->full_txs = tal_free(b->full_txs); b->full_txs = tal_free(b->full_txs);
/* Tell peers about new block. */ /* Tell lightningd about new block. */
notify_new_block(topo, b->height); notify_new_block(topo->bitcoind->ld, b->height);
} }
static const struct bitcoin_tx *tx_in_block(const struct block *b, static const struct bitcoin_tx *tx_in_block(const struct block *b,

2
lightningd/chaintopology.h

@ -156,7 +156,7 @@ void setup_topology(struct chain_topology *topology,
struct txlocator *locate_tx(const void *ctx, const struct chain_topology *topo, const struct sha256_double *txid); struct txlocator *locate_tx(const void *ctx, const struct chain_topology *topo, const struct sha256_double *txid);
void notify_new_block(struct chain_topology *topo, unsigned int height); void notify_new_block(struct lightningd *ld, unsigned int height);
#if DEVELOPER #if DEVELOPER
void json_dev_broadcast(struct command *cmd, void json_dev_broadcast(struct command *cmd,

6
lightningd/lightningd.c

@ -32,12 +32,6 @@
char *bitcoin_datadir; char *bitcoin_datadir;
void notify_new_block(struct chain_topology *topo, u32 height);
void notify_new_block(struct chain_topology *topo, u32 height)
{
/* FIXME */
}
void db_resolve_invoice(struct lightningd *ld, void db_resolve_invoice(struct lightningd *ld,
const char *label); const char *label);
void db_resolve_invoice(struct lightningd *ld, void db_resolve_invoice(struct lightningd *ld,

6
lightningd/peer_htlcs.c

@ -1425,3 +1425,9 @@ void peer_htlcs(const tal_t *ctx,
fulfilled_htlcs, fulfilled_sides); fulfilled_htlcs, fulfilled_sides);
} }
} }
void notify_new_block(struct lightningd *ld, u32 height)
{
/* FIXME */
}

Loading…
Cancel
Save