forked from jl777/lightning
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathanchor.h
33 lines (29 loc) · 1.14 KB
/
anchor.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#ifndef LIGHTNING_ANCHOR_H
#define LIGHTNING_ANCHOR_H
#include <ccan/tal/tal.h>
#include "lightning.pb-c.h"
struct sha256_double;
/* Create an anchor transaction based on both sides' requests.
* The scriptSigs are left empty.
*
* Allocate an input and output map (if non-NULL); the first
* o1->anchor->n_inputs of inmap are the location of o1's inputs, the
* next o2->anchor->n_inputs are o2's. outmap[0] is the location of
* output for the commitment tx, then o1's change (if
* o1->anchor->change), then o2's change if o2->anchor->change.
*/
struct bitcoin_tx *anchor_tx_create(const tal_t *ctx,
const OpenChannel *o1,
const OpenChannel *o2,
size_t **inmap, size_t **outmap);
/* Add these scriptsigs to the anchor transaction. */
bool anchor_add_scriptsigs(struct bitcoin_tx *anchor,
OpenAnchorScriptsigs *ssigs1,
OpenAnchorScriptsigs *ssigs2,
const size_t *inmap);
/* We wouldn't need the leak files if we had normalized txids! */
void anchor_txid(struct bitcoin_tx *anchor,
const char *leakfile1, const char *leakfile2,
const size_t *inmap,
struct sha256_double *txid);
#endif /* LIGHTNING_ANCHOR_H */