2018-07-09 13:17:59 +02:00
|
|
|
#include <common/derive_basepoints.h>
|
2017-08-28 18:05:01 +02:00
|
|
|
#include <common/htlc_wire.h>
|
2018-07-09 13:17:59 +02:00
|
|
|
|
2017-08-23 03:52:17 +02:00
|
|
|
# Begin! Here's the onchain tx which spends funding tx, followed by all HTLCs.
|
2017-09-26 23:02:48 +02:00
|
|
|
onchain_init,5001
|
2018-07-09 13:17:58 +02:00
|
|
|
onchain_init,,seed,struct secret
|
2017-08-23 03:52:17 +02:00
|
|
|
onchain_init,,shachain,struct shachain
|
|
|
|
onchain_init,,funding_amount_satoshi,u64
|
|
|
|
# Remote per commit point for committed tx.
|
|
|
|
onchain_init,,old_remote_per_commitment_point,struct pubkey
|
|
|
|
# Remote per commit point for current tx (needed if we haven't got revoke_and_ack yet).
|
|
|
|
onchain_init,,remote_per_commitment_point,struct pubkey
|
|
|
|
onchain_init,,local_to_self_delay,u32
|
|
|
|
onchain_init,,remote_to_self_delay,u32
|
2017-11-21 04:33:22 +01:00
|
|
|
onchain_init,,feerate_per_kw,u32
|
2017-08-23 03:52:17 +02:00
|
|
|
onchain_init,,local_dust_limit_satoshi,u64
|
|
|
|
# Gives an easy way to tell if it's our unilateral close or theirs...
|
2017-12-18 07:41:52 +01:00
|
|
|
onchain_init,,our_broadcast_txid,struct bitcoin_txid
|
2017-08-23 03:52:17 +02:00
|
|
|
onchain_init,,local_scriptpubkey_len,u16
|
|
|
|
onchain_init,,local_scriptpubkey,local_scriptpubkey_len*u8
|
|
|
|
onchain_init,,remote_scriptpubkey_len,u16
|
|
|
|
onchain_init,,remote_scriptpubkey,remote_scriptpubkey_len*u8
|
|
|
|
onchain_init,,ourwallet_pubkey,struct pubkey
|
|
|
|
# We need these two for commit number obscurer
|
|
|
|
onchain_init,,funder,enum side
|
2018-07-09 13:17:59 +02:00
|
|
|
onchain_init,,remote_basepoints,struct basepoints
|
2017-08-23 03:52:17 +02:00
|
|
|
onchain_init,,tx,struct bitcoin_tx
|
|
|
|
onchain_init,,tx_blockheight,u32
|
2017-09-26 23:02:47 +02:00
|
|
|
onchain_init,,reasonable_depth,u32
|
2017-08-23 03:52:17 +02:00
|
|
|
onchain_init,,num_htlc_sigs,u16
|
|
|
|
onchain_init,,htlc_signature,num_htlc_sigs*secp256k1_ecdsa_signature
|
|
|
|
onchain_init,,num_htlcs,u64
|
2018-04-03 06:31:48 +02:00
|
|
|
onchain_init,,min_possible_feerate,u32
|
|
|
|
onchain_init,,max_possible_feerate,u32
|
2017-08-23 03:52:17 +02:00
|
|
|
|
2017-08-29 06:12:04 +02:00
|
|
|
#include <onchaind/onchain_wire.h>
|
2017-08-23 03:52:17 +02:00
|
|
|
# This is all the HTLCs: one per message
|
2017-09-26 23:02:48 +02:00
|
|
|
onchain_htlc,5002
|
2017-08-23 03:52:17 +02:00
|
|
|
onchain_htlc,,htlc,struct htlc_stub
|
2017-09-26 23:02:47 +02:00
|
|
|
# If it's not in the commitment tx, tell us (immediately or htlc_missing_depth)
|
|
|
|
onchain_htlc,,tell_if_missing,bool
|
|
|
|
onchain_htlc,,tell_immediately,bool
|
2017-08-23 03:52:17 +02:00
|
|
|
|
2018-02-23 07:23:51 +01:00
|
|
|
# This says we're ready; give us preimages.
|
2017-09-26 23:02:48 +02:00
|
|
|
onchain_init_reply,5101
|
2017-08-23 03:52:17 +02:00
|
|
|
|
|
|
|
# onchaind->master: Send out a tx.
|
2017-09-26 23:02:48 +02:00
|
|
|
onchain_broadcast_tx,5003
|
2017-08-23 03:52:17 +02:00
|
|
|
onchain_broadcast_tx,,tx,struct bitcoin_tx
|
|
|
|
|
|
|
|
# master->onchaind: Notifier that an output has been spent by input_num of tx.
|
2017-09-26 23:02:48 +02:00
|
|
|
onchain_spent,5004
|
2017-08-23 03:52:17 +02:00
|
|
|
onchain_spent,,tx,struct bitcoin_tx
|
|
|
|
onchain_spent,,input_num,u32
|
|
|
|
onchain_spent,,blockheight,u32
|
|
|
|
|
|
|
|
# master->onchaind: We will receive more than one of these, as depth changes.
|
2017-09-26 23:02:48 +02:00
|
|
|
onchain_depth,5005
|
2017-12-18 07:41:52 +01:00
|
|
|
onchain_depth,,txid,struct bitcoin_txid
|
2017-08-23 03:52:17 +02:00
|
|
|
onchain_depth,,depth,u32
|
|
|
|
|
|
|
|
# onchaind->master: We don't want to watch this tx, or its outputs
|
2017-09-26 23:02:48 +02:00
|
|
|
onchain_unwatch_tx,5006
|
2017-12-18 07:41:52 +01:00
|
|
|
onchain_unwatch_tx,,txid,struct bitcoin_txid
|
2017-08-23 03:52:17 +02:00
|
|
|
|
|
|
|
# master->onchaind: We know HTLC preimage
|
2017-09-26 23:02:48 +02:00
|
|
|
onchain_known_preimage,5007
|
2017-08-23 03:52:17 +02:00
|
|
|
onchain_known_preimage,,preimage,struct preimage
|
|
|
|
|
|
|
|
# onchaind->master: We discovered HTLC preimage
|
2017-09-26 23:02:48 +02:00
|
|
|
onchain_extracted_preimage,5008
|
2017-08-23 03:52:17 +02:00
|
|
|
onchain_extracted_preimage,,preimage,struct preimage
|
|
|
|
|
2017-09-26 23:02:47 +02:00
|
|
|
# onchaind->master: this HTLC was missing from commit tx.
|
2017-09-26 23:02:48 +02:00
|
|
|
onchain_missing_htlc_output,5009
|
2017-09-26 23:02:47 +02:00
|
|
|
onchain_missing_htlc_output,,htlc,struct htlc_stub
|
2017-09-26 23:02:47 +02:00
|
|
|
|
|
|
|
# onchaind->master: this HTLC has timed out (after reasonable_depth)
|
2017-09-26 23:02:48 +02:00
|
|
|
onchain_htlc_timeout,5010
|
2017-09-26 23:02:47 +02:00
|
|
|
onchain_htlc_timeout,,htlc,struct htlc_stub
|
2017-10-12 02:25:54 +02:00
|
|
|
|
|
|
|
# onchaind->master: this peer can be forgotten
|
|
|
|
onchain_all_irrevocably_resolved,5011
|
2017-12-19 17:09:52 +01:00
|
|
|
|
2018-02-08 22:43:01 +01:00
|
|
|
# onchaind->master: hey, I identified an UTXO you'll want to track
|
2017-12-19 17:09:52 +01:00
|
|
|
onchain_add_utxo,5012
|
|
|
|
onchain_add_utxo,,prev_out_tx,struct bitcoin_txid
|
|
|
|
onchain_add_utxo,,prev_out_index,u32
|
|
|
|
onchain_add_utxo,,per_commit_point,struct pubkey
|
2018-02-23 07:23:51 +01:00
|
|
|
onchain_add_utxo,,value,u64
|
2018-03-22 00:18:53 +01:00
|
|
|
onchain_add_utxo,,blockheight,u32
|