mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 07:04:22 +01:00
When we see an offered HTLC onchain, we need to use the preimage if we know it. So we dump all the known HTLC preimages at startup, and send new ones as we discover them. This doesn't cover preimages we know because we're the final recipient; that can happen if an HTLC hasn't been irrevocably committed yet. We'll do that in a followup patch. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
59 lines
1.2 KiB
C
59 lines
1.2 KiB
C
#ifndef LIGHTNING_LIGHTNINGD_ONCHAIN_ONCHAIN_TYPES_H
|
|
#define LIGHTNING_LIGHTNINGD_ONCHAIN_ONCHAIN_TYPES_H
|
|
#include "config.h"
|
|
|
|
/* Different transactions we care about. */
|
|
enum tx_type {
|
|
/* The initial 2 of 2 funding transaction */
|
|
FUNDING_TRANSACTION,
|
|
|
|
/* A mutual close: spends funding */
|
|
MUTUAL_CLOSE,
|
|
|
|
/* Their unilateral: spends funding */
|
|
THEIR_UNILATERAL,
|
|
|
|
/* Our unilateral: spends funding */
|
|
OUR_UNILATERAL,
|
|
|
|
/* The 2 different types of HTLC transaction, each way */
|
|
THEIR_HTLC_TIMEOUT_TO_THEM,
|
|
THEIR_HTLC_FULFILL_TO_US,
|
|
OUR_HTLC_TIMEOUT_TO_US,
|
|
OUR_HTLC_FULFILL_TO_THEM,
|
|
|
|
/* Delayed variants */
|
|
OUR_HTLC_TIMEOUT_TX,
|
|
OUR_HTLC_SUCCESS_TX,
|
|
|
|
/* When we spend the to-us output (after cltv_expiry) */
|
|
OUR_UNILATERAL_TO_US_RETURN_TO_WALLET,
|
|
|
|
/* Special type for marking outputs as resolved by self. */
|
|
SELF,
|
|
|
|
/* Shouldn't happen. */
|
|
UNKNOWN_TXTYPE
|
|
};
|
|
|
|
/* Different output types. */
|
|
enum output_type {
|
|
/* FUNDING_TRANSACTION */
|
|
FUNDING_OUTPUT,
|
|
|
|
/* THEIR_UNILATERAL */
|
|
OUTPUT_TO_US,
|
|
DELAYED_OUTPUT_TO_THEM,
|
|
|
|
/* OUR_UNILATERAL */
|
|
DELAYED_OUTPUT_TO_US,
|
|
OUTPUT_TO_THEM,
|
|
|
|
/* HTLC outputs: their offers and our offers */
|
|
THEIR_HTLC,
|
|
OUR_HTLC,
|
|
};
|
|
|
|
|
|
#endif /* LIGHTNING_LIGHTNINGD_ONCHAIN_ONCHAIN_TYPES_H */
|