Browse Source

lightningd: fix up typesafe-cb bitcoind_getfilteredblock

`const struct filteredblock *` everywhere, as the typesafe_cb_preargs
macro required.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
pull/2938/head
Rusty Russell 5 years ago
parent
commit
69b7ef1508
  1. 4
      lightningd/bitcoind.c
  2. 2
      lightningd/bitcoind.h
  3. 5
      lightningd/gossip_control.c
  4. 2
      wallet/wallet.c
  5. 2
      wallet/wallet.h

4
lightningd/bitcoind.c

@ -787,7 +787,7 @@ void bitcoind_gettxout(struct bitcoind *bitcoind,
* process the various steps. */
struct filteredblock_call {
struct list_node list;
void (*cb)(struct bitcoind *bitcoind, struct filteredblock *fb,
void (*cb)(struct bitcoind *bitcoind, const struct filteredblock *fb,
void *arg);
void *arg;
@ -914,7 +914,7 @@ process_getfiltered_block_final(struct bitcoind *bitcoind,
void bitcoind_getfilteredblock_(struct bitcoind *bitcoind, u32 height,
void (*cb)(struct bitcoind *bitcoind,
struct filteredblock *fb,
const struct filteredblock *fb,
void *arg),
void *arg)
{

2
lightningd/bitcoind.h

@ -153,7 +153,7 @@ void bitcoind_getblockhash_(struct bitcoind *bitcoind,
void bitcoind_getfilteredblock_(struct bitcoind *bitcoind, u32 height,
void (*cb)(struct bitcoind *bitcoind,
struct filteredblock *fb,
const struct filteredblock *fb,
void *arg),
void *arg);
#define bitcoind_getfilteredblock(bitcoind_, height, cb, arg) \

5
lightningd/gossip_control.c

@ -60,10 +60,9 @@ static void got_txout(struct bitcoind *bitcoind,
}
static void got_filteredblock(struct bitcoind *bitcoind,
struct filteredblock *fb,
void *arg)
const struct filteredblock *fb,
struct short_channel_id *scid)
{
struct short_channel_id *scid = (struct short_channel_id *)arg;
struct filteredblock_outpoint *fbo = NULL, *o;
struct bitcoin_tx_output txo;

2
wallet/wallet.c

@ -2411,7 +2411,7 @@ void wallet_utxoset_add(struct wallet *w, const struct bitcoin_tx *tx,
outpointfilter_add(w->utxoset_outpoints, &txid, outnum);
}
void wallet_filteredblock_add(struct wallet *w, struct filteredblock *fb)
void wallet_filteredblock_add(struct wallet *w, const struct filteredblock *fb)
{
if (wallet_have_block(w, fb->height))
return;

2
wallet/wallet.h

@ -1170,6 +1170,6 @@ struct wallet_transaction *wallet_transactions_get(struct wallet *w, const tal_t
*
* This can be used to backfill the blocks and still unspent UTXOs that were before our wallet birth height.
*/
void wallet_filteredblock_add(struct wallet *w, struct filteredblock *fb);
void wallet_filteredblock_add(struct wallet *w, const struct filteredblock *fb);
#endif /* LIGHTNING_WALLET_WALLET_H */

Loading…
Cancel
Save