2015-05-29 04:29:09 +01:00
|
|
|
#ifndef LIGHTNING_PERMUTE_TX_H
|
|
|
|
#define LIGHTNING_PERMUTE_TX_H
|
2016-01-21 20:08:08 +00:00
|
|
|
#include "config.h"
|
2015-06-12 03:23:27 +01:00
|
|
|
#include "bitcoin/tx.h"
|
2015-05-29 04:29:09 +01:00
|
|
|
|
2017-02-07 01:44:22 +00:00
|
|
|
struct htlc;
|
|
|
|
|
2016-08-18 05:53:46 +01:00
|
|
|
/* Permute the transaction into BIP69 order. */
|
2017-02-21 04:45:29 +00:00
|
|
|
void permute_inputs(struct bitcoin_tx_input *inputs, size_t num_inputs,
|
|
|
|
const void **map);
|
2015-05-29 04:29:09 +01:00
|
|
|
|
2017-02-21 04:45:29 +00:00
|
|
|
/* If @map is non-NULL, it will be permuted the same as the outputs.
|
2017-02-07 01:44:22 +00:00
|
|
|
*
|
2017-02-21 04:45:29 +00: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 01:44:22 +00:00
|
|
|
*/
|
|
|
|
void permute_outputs(struct bitcoin_tx_output *outputs, size_t num_outputs,
|
2017-02-21 04:45:29 +00:00
|
|
|
const void **map);
|
2015-05-29 04:29:09 +01:00
|
|
|
#endif /* LIGHTNING_PERMUTE_TX_H */
|