mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 07:04:22 +01:00
inflights: use ctx for making new ones
Also convert everything to an array thingy
This commit is contained in:
@@ -1394,12 +1394,16 @@ bool peer_start_channeld(struct channel *channel,
|
|||||||
inflights = tal_arr(tmpctx, struct inflight *, 0);
|
inflights = tal_arr(tmpctx, struct inflight *, 0);
|
||||||
list_for_each(&channel->inflights, inflight, list) {
|
list_for_each(&channel->inflights, inflight, list) {
|
||||||
struct inflight *infcopy = tal(inflights, struct inflight);
|
struct inflight *infcopy = tal(inflights, struct inflight);
|
||||||
|
|
||||||
infcopy->outpoint = inflight->funding->outpoint;
|
infcopy->outpoint = inflight->funding->outpoint;
|
||||||
infcopy->amnt = inflight->funding->total_funds;
|
infcopy->amnt = inflight->funding->total_funds;
|
||||||
infcopy->splice_amnt = inflight->funding->splice_amnt;
|
infcopy->splice_amnt = inflight->funding->splice_amnt;
|
||||||
infcopy->last_tx = inflight->last_tx;
|
infcopy->last_tx = tal_dup(infcopy, struct bitcoin_tx, inflight->last_tx);
|
||||||
infcopy->last_sig = inflight->last_sig;
|
infcopy->last_sig = inflight->last_sig;
|
||||||
infcopy->i_am_initiator = inflight->i_am_initiator;
|
infcopy->i_am_initiator = inflight->i_am_initiator;
|
||||||
|
tal_wally_start();
|
||||||
|
wally_psbt_clone_alloc(inflight->funding_psbt, 0, &infcopy->psbt);
|
||||||
|
tal_wally_end_onto(infcopy, infcopy->psbt, struct wally_psbt);
|
||||||
tal_arr_expand(&inflights, infcopy);
|
tal_arr_expand(&inflights, infcopy);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -249,6 +249,7 @@ class Type(FieldSet):
|
|||||||
'wally_psbt',
|
'wally_psbt',
|
||||||
'wally_tx',
|
'wally_tx',
|
||||||
'scb_chan',
|
'scb_chan',
|
||||||
|
'inflight',
|
||||||
]
|
]
|
||||||
|
|
||||||
# Some BOLT types are re-typed based on their field name
|
# Some BOLT types are re-typed based on their field name
|
||||||
|
|||||||
Reference in New Issue
Block a user