closingd: send the tx to master as we negotiate.

We can derive fees from this, and also broadcast at any time without
having to reconstruct it.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2017-08-18 14:13:52 +09:30
parent 253b3e679e
commit c389215a35
6 changed files with 87 additions and 127 deletions

View File

@@ -91,10 +91,6 @@ struct peer {
/* Our key for shutdown (-1 if not chosen yet) */
s64 local_shutdown_idx;
/* Closing stuff. */
u64 closing_fee_received;
secp256k1_ecdsa_signature *closing_sig_received;
/* Reestablishment stuff: last sent commit and revocation details. */
bool last_was_revoke;
struct changed_htlc *last_sent_commit;
@@ -142,6 +138,9 @@ struct peer *peer_from_json(struct lightningd *ld,
const char *buffer,
jsmntok_t *peeridtok);
void peer_last_tx(struct peer *peer, struct bitcoin_tx *tx,
const secp256k1_ecdsa_signature *sig);
void peer_fundee_open(struct peer *peer, const u8 *msg,
const struct crypto_state *cs,
int peer_fd, int gossip_fd);