core-lightning/lightningd/closing_control.h
Rusty Russell e981a4f14a lightningd: pass signed tx through to close callback.
Thread the signed tx through so close's JSON return contains that,
rather than the unsigned channel->last_tx.

We have to split the "get cmd_id" from "resolve the close commands" though;
and of course, as before, we don't actually print the txids of multiple
transactions even though we may have multi in flight due to splice!

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Fixed: JSON-RPC: `close` returns a `tx` field with witness data populated (i.e. signed).
Fixes: #6440
2023-08-02 07:09:28 +09:30

23 lines
732 B
C

#ifndef LIGHTNING_LIGHTNINGD_CLOSING_CONTROL_H
#define LIGHTNING_LIGHTNINGD_CLOSING_CONTROL_H
#include "config.h"
#include <ccan/short_types/short_types.h>
#include <stdbool.h>
struct channel;
struct lightningd;
struct peer_fd;
/* Find cmd_id for closing command, if any. */
const char *cmd_id_from_close_command(const tal_t *ctx,
struct lightningd *ld, struct channel *channel);
/* Resolve a close command for a channel that will be closed soon. */
void resolve_close_command(struct lightningd *ld, struct channel *channel,
bool cooperative, const struct bitcoin_tx *close_tx);
void peer_start_closingd(struct channel *channel,
struct peer_fd *peer_fd);
#endif /* LIGHTNING_LIGHTNINGD_CLOSING_CONTROL_H */