Skip to content

Commit

Permalink
lightningd: fix up typesafe-cb bitcoind_getfilteredblock
Browse files Browse the repository at this point in the history
`const struct filteredblock *` everywhere, as the typesafe_cb_preargs
macro required.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  • Loading branch information
rustyrussell committed Aug 9, 2019
1 parent 5e36257 commit 69b7ef1
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 8 deletions.
4 changes: 2 additions & 2 deletions lightningd/bitcoind.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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)
{
Expand Down
2 changes: 1 addition & 1 deletion lightningd/bitcoind.h
Original file line number Diff line number Diff line change
Expand Up @@ -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) \
Expand Down
5 changes: 2 additions & 3 deletions lightningd/gossip_control.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion wallet/wallet.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion wallet/wallet.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

0 comments on commit 69b7ef1

Please sign in to comment.