mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-18 21:35:11 +01:00
bitcoind: Initialize filteredblock->outpoints with filteredblock
We will be calling the callback out of order once we fan out the results of a single lookip to multiple calls, so being sure that everything is allocated ahead of time is necessary. Signed-off-by: Christian Decker <decker.christian@gmail.com>
This commit is contained in:
parent
43b3eea783
commit
040cda2875
@ -852,8 +852,6 @@ static void process_getfilteredblock_step2(struct bitcoind *bitcoind,
|
||||
}
|
||||
}
|
||||
|
||||
call->result->outpoints = tal_arr(call->result, struct filteredblock_outpoint *, 0);
|
||||
call->current_outpoint = 0;
|
||||
if (tal_count(call->outpoints) == 0) {
|
||||
/* If there were no outpoints to check, we can short-circuit
|
||||
* and just call the callback. */
|
||||
@ -897,6 +895,8 @@ void bitcoind_getfilteredblock_(struct bitcoind *bitcoind, u32 height,
|
||||
assert(call->cb != NULL);
|
||||
call->start_time = time_now();
|
||||
call->result->height = height;
|
||||
call->result->outpoints = tal_arr(call->result, struct filteredblock_outpoint *, 0);
|
||||
call->current_outpoint = 0;
|
||||
|
||||
bitcoind_getblockhash(bitcoind, height, process_getfilteredblock_step1, call);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user