File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -420,6 +420,20 @@ const char *refine_with_fees_and_limits(const tal_t *ctx,
420420 tal_arr_remove (& flows_index , i );
421421 }
422422
423- tal_free (working_ctx );
423+ /* finally write the remaining flows */
424+ struct flow * * tmp_flows = tal_arr (working_ctx , struct flow * , 0 );
425+ for (size_t i = 0 ; i < tal_count (flows_index ); i ++ ) {
426+ tal_arr_expand (& tmp_flows , (* flows )[flows_index [i ]]);
427+ (* flows )[flows_index [i ]] = NULL ;
428+ }
429+ for (size_t i = 0 ; i < tal_count (* flows ); i ++ ) {
430+ (* flows )[i ] = tal_free ((* flows )[i ]);
431+ }
432+ tal_resize (flows , 0 );
433+ for (size_t i = 0 ; i < tal_count (tmp_flows ); i ++ ) {
434+ tal_arr_expand (flows , tmp_flows [i ]);
435+ }
436+
437+ tal_free (working_ctx );
424438 return NULL ;
425439}
You can’t perform that action at this time.
0 commit comments