mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-18 05:12:45 +01:00
a663dc322c
Alpha has segregated witnesses, so txid doesn't include the inputs. That means we can create the first commit transaction before we sign the anchor tx. Bitcoin will need to do this differently: presumbly via new sipops (a OP_CHECKSIG2VERIFY I imagine). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
32 lines
1.1 KiB
C
32 lines
1.1 KiB
C
#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,
|
|
struct sha256_double *txid);
|
|
#endif /* LIGHTNING_ANCHOR_H */
|