2017-08-28 18:06:01 +02:00
|
|
|
#ifndef LIGHTNING_COMMON_PERMUTE_TX_H
|
|
|
|
#define LIGHTNING_COMMON_PERMUTE_TX_H
|
2016-01-21 21:08:08 +01:00
|
|
|
#include "config.h"
|
2015-06-12 04:23:27 +02:00
|
|
|
#include "bitcoin/tx.h"
|
2015-05-29 05:29:09 +02:00
|
|
|
|
2017-02-07 02:44:22 +01:00
|
|
|
struct htlc;
|
|
|
|
|
2016-08-18 06:53:46 +02:00
|
|
|
/* Permute the transaction into BIP69 order. */
|
2017-02-21 05:45:29 +01:00
|
|
|
void permute_inputs(struct bitcoin_tx_input *inputs, size_t num_inputs,
|
|
|
|
const void **map);
|
2015-05-29 05:29:09 +02:00
|
|
|
|
2017-02-21 05:45:29 +01:00
|
|
|
/* If @map is non-NULL, it will be permuted the same as the outputs.
|
2017-02-07 02:44:22 +01:00
|
|
|
*
|
2017-02-21 05:45:29 +01:00
|
|
|
* So the caller initiates the map with which htlcs are used, it
|
|
|
|
* can easily see which htlc (if any) is in output #0 with map[0].
|
2017-02-07 02:44:22 +01:00
|
|
|
*/
|
|
|
|
void permute_outputs(struct bitcoin_tx_output *outputs, size_t num_outputs,
|
2017-02-21 05:45:29 +01:00
|
|
|
const void **map);
|
2017-08-28 18:06:01 +02:00
|
|
|
#endif /* LIGHTNING_COMMON_PERMUTE_TX_H */
|