@ -25,9 +25,9 @@
# include <ccan/take/take.h>
# include <ccan/take/take.h>
# include <ccan/tal/str/str.h>
# include <ccan/tal/str/str.h>
# include <ccan/time/time.h>
# include <ccan/time/time.h>
# include <channeld/channeld_wiregen.h>
# include <channeld/commit_tx.h>
# include <channeld/commit_tx.h>
# include <channeld/full_channel.h>
# include <channeld/full_channel.h>
# include <channeld/gen_channel_wire.h>
# include <channeld/watchtower.h>
# include <channeld/watchtower.h>
# include <common/blinding.h>
# include <common/blinding.h>
# include <common/coin_mvt.h>
# include <common/coin_mvt.h>
@ -541,7 +541,7 @@ static void channel_announcement_negotiate(struct peer *peer)
/* After making sure short_channel_ids match, we can send remote
/* After making sure short_channel_ids match, we can send remote
* announcement to MASTER . */
* announcement to MASTER . */
wire_sync_write ( MASTER_FD ,
wire_sync_write ( MASTER_FD ,
take ( towire_channel_got_announcement ( NULL ,
take ( towire_channeld _got_announcement ( NULL ,
& peer - > announcement_node_sigs [ REMOTE ] ,
& peer - > announcement_node_sigs [ REMOTE ] ,
& peer - > announcement_bitcoin_sigs [ REMOTE ] ) ) ) ;
& peer - > announcement_bitcoin_sigs [ REMOTE ] ) ) ) ;
@ -587,7 +587,7 @@ static void handle_peer_funding_locked(struct peer *peer, const u8 *msg)
peer - > funding_locked [ REMOTE ] = true ;
peer - > funding_locked [ REMOTE ] = true ;
wire_sync_write ( MASTER_FD ,
wire_sync_write ( MASTER_FD ,
take ( towire_channel_got_funding_locked ( NULL ,
take ( towire_channeld _got_funding_locked ( NULL ,
& peer - > remote_per_commit ) ) ) ;
& peer - > remote_per_commit ) ) ) ;
channel_announcement_negotiate ( peer ) ;
channel_announcement_negotiate ( peer ) ;
@ -746,7 +746,7 @@ static u8 *sending_commitsig_msg(const tal_t *ctx,
/* We tell master what (of our) HTLCs peer will now be
/* We tell master what (of our) HTLCs peer will now be
* committed to . */
* committed to . */
changed = changed_htlc_arr ( tmpctx , changed_htlcs ) ;
changed = changed_htlc_arr ( tmpctx , changed_htlcs ) ;
msg = towire_channel_sending_commitsig ( ctx , remote_commit_index , pbase , fee_states , changed ,
msg = towire_channeld _sending_commitsig ( ctx , remote_commit_index , pbase , fee_states , changed ,
commit_sig , htlc_sigs ) ;
commit_sig , htlc_sigs ) ;
return msg ;
return msg ;
}
}
@ -1092,7 +1092,7 @@ static void send_commit(struct peer *peer)
htlc_sigs ) ;
htlc_sigs ) ;
/* Message is empty; receiving it is the point. */
/* Message is empty; receiving it is the point. */
master_wait_sync_reply ( tmpctx , peer , take ( msg ) ,
master_wait_sync_reply ( tmpctx , peer , take ( msg ) ,
WIRE_CHANNEL_SENDING_COMMITSIG_REPLY ) ;
WIRE_CHANNELD _SENDING_COMMITSIG_REPLY ) ;
status_debug ( " Sending commit_sig with %zu htlc sigs " ,
status_debug ( " Sending commit_sig with %zu htlc sigs " ,
tal_count ( htlc_sigs ) ) ;
tal_count ( htlc_sigs ) ) ;
@ -1258,7 +1258,7 @@ static void send_revocation(struct peer *peer,
/* We had to do this after channel_sending_revoke_and_ack, since we
/* We had to do this after channel_sending_revoke_and_ack, since we
* want it to save the fee_states produced there . */
* want it to save the fee_states produced there . */
msg_for_master
msg_for_master
= towire_channel_got_commitsig ( NULL ,
= towire_channeld _got_commitsig ( NULL ,
peer - > next_index [ LOCAL ] - 1 ,
peer - > next_index [ LOCAL ] - 1 ,
peer - > channel - > fee_states ,
peer - > channel - > fee_states ,
commit_sig , htlc_sigs ,
commit_sig , htlc_sigs ,
@ -1268,7 +1268,7 @@ static void send_revocation(struct peer *peer,
changed ,
changed ,
committx ) ;
committx ) ;
master_wait_sync_reply ( tmpctx , peer , take ( msg_for_master ) ,
master_wait_sync_reply ( tmpctx , peer , take ( msg_for_master ) ,
WIRE_CHANNEL_GOT_COMMITSIG_REPLY ) ;
WIRE_CHANNELD _GOT_COMMITSIG_REPLY ) ;
/* Now we can finally send revoke_and_ack to peer */
/* Now we can finally send revoke_and_ack to peer */
sync_crypto_write_no_delay ( peer - > pps , take ( msg ) ) ;
sync_crypto_write_no_delay ( peer - > pps , take ( msg ) ) ;
@ -1465,7 +1465,7 @@ static u8 *got_revoke_msg(struct peer *peer, u64 revoke_num,
HSM_FD ) ;
HSM_FD ) ;
}
}
msg = towire_channel_got_revoke ( peer , revoke_num , per_commitment_secret ,
msg = towire_channeld _got_revoke ( peer , revoke_num , per_commitment_secret ,
next_per_commit_point , fee_states ,
next_per_commit_point , fee_states ,
changed , pbase , ptx ) ;
changed , pbase , ptx ) ;
tal_free ( ptx ) ;
tal_free ( ptx ) ;
@ -1530,7 +1530,7 @@ static void handle_peer_revoke_and_ack(struct peer *peer, const u8 *msg)
changed_htlcs ,
changed_htlcs ,
peer - > channel - > fee_states ) ;
peer - > channel - > fee_states ) ;
master_wait_sync_reply ( tmpctx , peer , take ( msg ) ,
master_wait_sync_reply ( tmpctx , peer , take ( msg ) ,
WIRE_CHANNEL_GOT_REVOKE_REPLY ) ;
WIRE_CHANNELD _GOT_REVOKE_REPLY ) ;
peer - > old_remote_per_commit = peer - > remote_per_commit ;
peer - > old_remote_per_commit = peer - > remote_per_commit ;
peer - > remote_per_commit = next_per_commit ;
peer - > remote_per_commit = next_per_commit ;
@ -1712,7 +1712,7 @@ static void handle_peer_shutdown(struct peer *peer, const u8 *shutdown)
/* Tell master: we don't have to wait because on reconnect other end
/* Tell master: we don't have to wait because on reconnect other end
* will re - send anyway . */
* will re - send anyway . */
wire_sync_write ( MASTER_FD ,
wire_sync_write ( MASTER_FD ,
take ( towire_channel_got_shutdown ( NULL , scriptpubkey ) ) ) ;
take ( towire_channeld _got_shutdown ( NULL , scriptpubkey ) ) ) ;
peer - > shutdown_sent [ REMOTE ] = true ;
peer - > shutdown_sent [ REMOTE ] = true ;
/* BOLT #2:
/* BOLT #2:
@ -2284,7 +2284,7 @@ static void check_future_dataloss_fields(struct peer *peer,
* commitment transaction on - chain .
* commitment transaction on - chain .
*/
*/
wire_sync_write ( MASTER_FD ,
wire_sync_write ( MASTER_FD ,
take ( towire_channel_fail_fallen_behind ( NULL ,
take ( towire_channeld _fail_fallen_behind ( NULL ,
remote_current_per_commitment_point ) ) ) ;
remote_current_per_commitment_point ) ) ) ;
/* We have to send them an error to trigger dropping to chain. */
/* We have to send them an error to trigger dropping to chain. */
@ -2719,11 +2719,11 @@ static void handle_funding_depth(struct peer *peer, const u8 *msg)
u32 depth ;
u32 depth ;
struct short_channel_id * scid ;
struct short_channel_id * scid ;
if ( ! fromwire_channel_funding_depth ( tmpctx ,
if ( ! fromwire_channeld _funding_depth ( tmpctx ,
msg ,
msg ,
& scid ,
& scid ,
& depth ) )
& depth ) )
master_badmsg ( WIRE_CHANNEL_FUNDING_DEPTH , msg ) ;
master_badmsg ( WIRE_CHANNELD _FUNDING_DEPTH , msg ) ;
/* Too late, we're shutting down! */
/* Too late, we're shutting down! */
if ( peer - > shutdown_sent [ LOCAL ] )
if ( peer - > shutdown_sent [ LOCAL ] )
@ -2779,10 +2779,10 @@ static void handle_offer_htlc(struct peer *peer, const u8 *inmsg)
status_failed ( STATUS_FAIL_MASTER_IO ,
status_failed ( STATUS_FAIL_MASTER_IO ,
" funding not locked for offer_htlc " ) ;
" funding not locked for offer_htlc " ) ;
if ( ! fromwire_channel_offer_htlc ( tmpctx , inmsg , & amount ,
if ( ! fromwire_channeld _offer_htlc ( tmpctx , inmsg , & amount ,
& cltv_expiry , & payment_hash ,
& cltv_expiry , & payment_hash ,
onion_routing_packet , & blinding ) )
onion_routing_packet , & blinding ) )
master_badmsg ( WIRE_CHANNEL_OFFER_HTLC , inmsg ) ;
master_badmsg ( WIRE_CHANNELD _OFFER_HTLC , inmsg ) ;
# if EXPERIMENTAL_FEATURES
# if EXPERIMENTAL_FEATURES
struct tlv_update_add_tlvs * tlvs ;
struct tlv_update_add_tlvs * tlvs ;
@ -2816,7 +2816,7 @@ static void handle_offer_htlc(struct peer *peer, const u8 *inmsg)
sync_crypto_write ( peer - > pps , take ( msg ) ) ;
sync_crypto_write ( peer - > pps , take ( msg ) ) ;
start_commit_timer ( peer ) ;
start_commit_timer ( peer ) ;
/* Tell the master. */
/* Tell the master. */
msg = towire_channel_offer_htlc_reply ( NULL , peer - > htlc_id ,
msg = towire_channeld _offer_htlc_reply ( NULL , peer - > htlc_id ,
0 , " " ) ;
0 , " " ) ;
wire_sync_write ( MASTER_FD , take ( msg ) ) ;
wire_sync_write ( MASTER_FD , take ( msg ) ) ;
peer - > htlc_id + + ;
peer - > htlc_id + + ;
@ -2855,7 +2855,7 @@ static void handle_offer_htlc(struct peer *peer, const u8 *inmsg)
abort ( ) ;
abort ( ) ;
failed :
failed :
msg = towire_channel_offer_htlc_reply ( NULL , 0 , failwiremsg , failstr ) ;
msg = towire_channeld _offer_htlc_reply ( NULL , 0 , failwiremsg , failstr ) ;
wire_sync_write ( MASTER_FD , take ( msg ) ) ;
wire_sync_write ( MASTER_FD , take ( msg ) ) ;
}
}
@ -2863,11 +2863,11 @@ static void handle_feerates(struct peer *peer, const u8 *inmsg)
{
{
u32 feerate ;
u32 feerate ;
if ( ! fromwire_channel_feerates ( inmsg , & feerate ,
if ( ! fromwire_channeld _feerates ( inmsg , & feerate ,
& peer - > feerate_min ,
& peer - > feerate_min ,
& peer - > feerate_max ,
& peer - > feerate_max ,
& peer - > feerate_penalty ) )
& peer - > feerate_penalty ) )
master_badmsg ( WIRE_CHANNEL_FEERATES , inmsg ) ;
master_badmsg ( WIRE_CHANNELD _FEERATES , inmsg ) ;
/* BOLT #2:
/* BOLT #2:
*
*
@ -2900,10 +2900,10 @@ static void handle_specific_feerates(struct peer *peer, const u8 *inmsg)
u32 base_old = peer - > fee_base ;
u32 base_old = peer - > fee_base ;
u32 per_satoshi_old = peer - > fee_per_satoshi ;
u32 per_satoshi_old = peer - > fee_per_satoshi ;
if ( ! fromwire_channel_specific_feerates ( inmsg ,
if ( ! fromwire_channeld _specific_feerates ( inmsg ,
& peer - > fee_base ,
& peer - > fee_base ,
& peer - > fee_per_satoshi ) )
& peer - > fee_per_satoshi ) )
master_badmsg ( WIRE_CHANNEL_SPECIFIC_FEERATES , inmsg ) ;
master_badmsg ( WIRE_CHANNELD _SPECIFIC_FEERATES , inmsg ) ;
/* only send channel updates if values actually changed */
/* only send channel updates if values actually changed */
if ( peer - > fee_base ! = base_old | | peer - > fee_per_satoshi ! = per_satoshi_old )
if ( peer - > fee_base ! = base_old | | peer - > fee_per_satoshi ! = per_satoshi_old )
@ -2916,8 +2916,8 @@ static void handle_preimage(struct peer *peer, const u8 *inmsg)
struct fulfilled_htlc fulfilled_htlc ;
struct fulfilled_htlc fulfilled_htlc ;
struct htlc * h ;
struct htlc * h ;
if ( ! fromwire_channel_fulfill_htlc ( inmsg , & fulfilled_htlc ) )
if ( ! fromwire_channeld _fulfill_htlc ( inmsg , & fulfilled_htlc ) )
master_badmsg ( WIRE_CHANNEL_FULFILL_HTLC , inmsg ) ;
master_badmsg ( WIRE_CHANNELD _FULFILL_HTLC , inmsg ) ;
switch ( channel_fulfill_htlc ( peer - > channel , REMOTE ,
switch ( channel_fulfill_htlc ( peer - > channel , REMOTE ,
fulfilled_htlc . id ,
fulfilled_htlc . id ,
@ -2948,8 +2948,8 @@ static void handle_fail(struct peer *peer, const u8 *inmsg)
enum channel_remove_err e ;
enum channel_remove_err e ;
struct htlc * h ;
struct htlc * h ;
if ( ! fromwire_channel_fail_htlc ( inmsg , inmsg , & failed_htlc ) )
if ( ! fromwire_channeld _fail_htlc ( inmsg , inmsg , & failed_htlc ) )
master_badmsg ( WIRE_CHANNEL_FAIL_HTLC , inmsg ) ;
master_badmsg ( WIRE_CHANNELD _FAIL_HTLC , inmsg ) ;
e = channel_fail_htlc ( peer - > channel , REMOTE , failed_htlc - > id , & h ) ;
e = channel_fail_htlc ( peer - > channel , REMOTE , failed_htlc - > id , & h ) ;
switch ( e ) {
switch ( e ) {
@ -2975,8 +2975,8 @@ static void handle_shutdown_cmd(struct peer *peer, const u8 *inmsg)
{
{
u8 * local_shutdown_script ;
u8 * local_shutdown_script ;
if ( ! fromwire_channel_send_shutdown ( peer , inmsg , & local_shutdown_script ) )
if ( ! fromwire_channeld _send_shutdown ( peer , inmsg , & local_shutdown_script ) )
master_badmsg ( WIRE_CHANNEL_SEND_SHUTDOWN , inmsg ) ;
master_badmsg ( WIRE_CHANNELD _SEND_SHUTDOWN , inmsg ) ;
tal_free ( peer - > final_scriptpubkey ) ;
tal_free ( peer - > final_scriptpubkey ) ;
peer - > final_scriptpubkey = local_shutdown_script ;
peer - > final_scriptpubkey = local_shutdown_script ;
@ -2989,15 +2989,15 @@ static void handle_shutdown_cmd(struct peer *peer, const u8 *inmsg)
static void handle_send_error ( struct peer * peer , const u8 * msg )
static void handle_send_error ( struct peer * peer , const u8 * msg )
{
{
char * reason ;
char * reason ;
if ( ! fromwire_channel_send_error ( msg , msg , & reason ) )
if ( ! fromwire_channeld _send_error ( msg , msg , & reason ) )
master_badmsg ( WIRE_CHANNEL_SEND_ERROR , msg ) ;
master_badmsg ( WIRE_CHANNELD _SEND_ERROR , msg ) ;
status_debug ( " Send error reason: %s " , reason ) ;
status_debug ( " Send error reason: %s " , reason ) ;
sync_crypto_write ( peer - > pps ,
sync_crypto_write ( peer - > pps ,
take ( towire_errorfmt ( NULL , & peer - > channel_id ,
take ( towire_errorfmt ( NULL , & peer - > channel_id ,
" %s " , reason ) ) ) ;
" %s " , reason ) ) ) ;
wire_sync_write ( MASTER_FD ,
wire_sync_write ( MASTER_FD ,
take ( towire_channel_send_error_reply ( NULL ) ) ) ;
take ( towire_channeld _send_error_reply ( NULL ) ) ) ;
}
}
# if DEVELOPER
# if DEVELOPER
@ -3007,7 +3007,7 @@ static void handle_dev_reenable_commit(struct peer *peer)
start_commit_timer ( peer ) ;
start_commit_timer ( peer ) ;
status_debug ( " dev_reenable_commit " ) ;
status_debug ( " dev_reenable_commit " ) ;
wire_sync_write ( MASTER_FD ,
wire_sync_write ( MASTER_FD ,
take ( towire_channel_dev_reenable_commit_reply ( NULL ) ) ) ;
take ( towire_channeld _dev_reenable_commit_reply ( NULL ) ) ) ;
}
}
static void handle_dev_memleak ( struct peer * peer , const u8 * msg )
static void handle_dev_memleak ( struct peer * peer , const u8 * msg )
@ -3022,7 +3022,7 @@ static void handle_dev_memleak(struct peer *peer, const u8 *msg)
found_leak = dump_memleak ( memtable ) ;
found_leak = dump_memleak ( memtable ) ;
wire_sync_write ( MASTER_FD ,
wire_sync_write ( MASTER_FD ,
take ( towire_channel_dev_memleak_reply ( NULL ,
take ( towire_channeld _dev_memleak_reply ( NULL ,
found_leak ) ) ) ;
found_leak ) ) ) ;
}
}
@ -3037,31 +3037,31 @@ static void channeld_send_custommsg(struct peer *peer, const u8 *msg)
static void req_in ( struct peer * peer , const u8 * msg )
static void req_in ( struct peer * peer , const u8 * msg )
{
{
enum channel_wire_typ e t = fromwire_peektype ( msg ) ;
enum channeld _wire t = fromwire_peektype ( msg ) ;
switch ( t ) {
switch ( t ) {
case WIRE_CHANNEL_FUNDING_DEPTH :
case WIRE_CHANNELD _FUNDING_DEPTH :
handle_funding_depth ( peer , msg ) ;
handle_funding_depth ( peer , msg ) ;
return ;
return ;
case WIRE_CHANNEL_OFFER_HTLC :
case WIRE_CHANNELD _OFFER_HTLC :
handle_offer_htlc ( peer , msg ) ;
handle_offer_htlc ( peer , msg ) ;
return ;
return ;
case WIRE_CHANNEL_FEERATES :
case WIRE_CHANNELD _FEERATES :
handle_feerates ( peer , msg ) ;
handle_feerates ( peer , msg ) ;
return ;
return ;
case WIRE_CHANNEL_FULFILL_HTLC :
case WIRE_CHANNELD _FULFILL_HTLC :
handle_preimage ( peer , msg ) ;
handle_preimage ( peer , msg ) ;
return ;
return ;
case WIRE_CHANNEL_FAIL_HTLC :
case WIRE_CHANNELD _FAIL_HTLC :
handle_fail ( peer , msg ) ;
handle_fail ( peer , msg ) ;
return ;
return ;
case WIRE_CHANNEL_SPECIFIC_FEERATES :
case WIRE_CHANNELD _SPECIFIC_FEERATES :
handle_specific_feerates ( peer , msg ) ;
handle_specific_feerates ( peer , msg ) ;
return ;
return ;
case WIRE_CHANNEL_SEND_SHUTDOWN :
case WIRE_CHANNELD _SEND_SHUTDOWN :
handle_shutdown_cmd ( peer , msg ) ;
handle_shutdown_cmd ( peer , msg ) ;
return ;
return ;
case WIRE_CHANNEL_SEND_ERROR :
case WIRE_CHANNELD _SEND_ERROR :
handle_send_error ( peer , msg ) ;
handle_send_error ( peer , msg ) ;
return ;
return ;
# if EXPERIMENTAL_FEATURES
# if EXPERIMENTAL_FEATURES
@ -3073,32 +3073,32 @@ static void req_in(struct peer *peer, const u8 *msg)
break ;
break ;
# endif /* !EXPERIMENTAL_FEATURES */
# endif /* !EXPERIMENTAL_FEATURES */
# if DEVELOPER
# if DEVELOPER
case WIRE_CHANNEL_DEV_REENABLE_COMMIT :
case WIRE_CHANNELD _DEV_REENABLE_COMMIT :
handle_dev_reenable_commit ( peer ) ;
handle_dev_reenable_commit ( peer ) ;
return ;
return ;
case WIRE_CHANNEL_DEV_MEMLEAK :
case WIRE_CHANNELD _DEV_MEMLEAK :
handle_dev_memleak ( peer , msg ) ;
handle_dev_memleak ( peer , msg ) ;
return ;
return ;
# else
# else
case WIRE_CHANNEL_DEV_REENABLE_COMMIT :
case WIRE_CHANNELD _DEV_REENABLE_COMMIT :
case WIRE_CHANNEL_DEV_MEMLEAK :
case WIRE_CHANNELD _DEV_MEMLEAK :
# endif /* DEVELOPER */
# endif /* DEVELOPER */
case WIRE_CHANNEL_INIT :
case WIRE_CHANNELD _INIT :
case WIRE_CHANNEL_OFFER_HTLC_REPLY :
case WIRE_CHANNELD _OFFER_HTLC_REPLY :
case WIRE_CHANNEL_SENDING_COMMITSIG :
case WIRE_CHANNELD _SENDING_COMMITSIG :
case WIRE_CHANNEL_GOT_COMMITSIG :
case WIRE_CHANNELD _GOT_COMMITSIG :
case WIRE_CHANNEL_GOT_REVOKE :
case WIRE_CHANNELD _GOT_REVOKE :
case WIRE_CHANNEL_SENDING_COMMITSIG_REPLY :
case WIRE_CHANNELD _SENDING_COMMITSIG_REPLY :
case WIRE_CHANNEL_GOT_COMMITSIG_REPLY :
case WIRE_CHANNELD _GOT_COMMITSIG_REPLY :
case WIRE_CHANNEL_GOT_REVOKE_REPLY :
case WIRE_CHANNELD _GOT_REVOKE_REPLY :
case WIRE_CHANNEL_GOT_FUNDING_LOCKED :
case WIRE_CHANNELD _GOT_FUNDING_LOCKED :
case WIRE_CHANNEL_GOT_ANNOUNCEMENT :
case WIRE_CHANNELD _GOT_ANNOUNCEMENT :
case WIRE_CHANNEL_GOT_SHUTDOWN :
case WIRE_CHANNELD _GOT_SHUTDOWN :
case WIRE_CHANNEL_SHUTDOWN_COMPLETE :
case WIRE_CHANNELD _SHUTDOWN_COMPLETE :
case WIRE_CHANNEL_DEV_REENABLE_COMMIT_REPLY :
case WIRE_CHANNELD _DEV_REENABLE_COMMIT_REPLY :
case WIRE_CHANNEL_FAIL_FALLEN_BEHIND :
case WIRE_CHANNELD _FAIL_FALLEN_BEHIND :
case WIRE_CHANNEL_DEV_MEMLEAK_REPLY :
case WIRE_CHANNELD _DEV_MEMLEAK_REPLY :
case WIRE_CHANNEL_SEND_ERROR_REPLY :
case WIRE_CHANNELD _SEND_ERROR_REPLY :
case WIRE_GOT_ONIONMSG_TO_US :
case WIRE_GOT_ONIONMSG_TO_US :
case WIRE_GOT_ONIONMSG_FORWARD :
case WIRE_GOT_ONIONMSG_FORWARD :
break ;
break ;
@ -3152,7 +3152,7 @@ static void init_channel(struct peer *peer)
status_setup_sync ( MASTER_FD ) ;
status_setup_sync ( MASTER_FD ) ;
msg = wire_sync_read ( tmpctx , MASTER_FD ) ;
msg = wire_sync_read ( tmpctx , MASTER_FD ) ;
if ( ! fromwire_channel_init ( peer , msg ,
if ( ! fromwire_channeld _init ( peer , msg ,
& chainparams ,
& chainparams ,
& peer - > our_features ,
& peer - > our_features ,
& funding_txid , & funding_txout ,
& funding_txid , & funding_txout ,
@ -3206,7 +3206,7 @@ static void init_channel(struct peer *peer)
& dev_fast_gossip ,
& dev_fast_gossip ,
& dev_fail_process_onionpacket ,
& dev_fail_process_onionpacket ,
& pbases ) ) {
& pbases ) ) {
master_badmsg ( WIRE_CHANNEL_INIT , msg ) ;
master_badmsg ( WIRE_CHANNELD _INIT , msg ) ;
}
}
/* Keeping an array of pointers is better since it allows us to avoid
/* Keeping an array of pointers is better since it allows us to avoid
@ -3292,7 +3292,7 @@ static void init_channel(struct peer *peer)
if ( peer - > channel - > opener = = LOCAL )
if ( peer - > channel - > opener = = LOCAL )
peer - > desired_feerate = channel_feerate ( peer - > channel , REMOTE ) ;
peer - > desired_feerate = channel_feerate ( peer - > channel , REMOTE ) ;
/* from now we need keep watch over WIRE_CHANNEL_FUNDING_DEPTH */
/* from now we need keep watch over WIRE_CHANNELD _FUNDING_DEPTH */
peer - > depth_togo = minimum_depth ;
peer - > depth_togo = minimum_depth ;
/* OK, now we can process peer messages. */
/* OK, now we can process peer messages. */
@ -3313,7 +3313,7 @@ static void send_shutdown_complete(struct peer *peer)
{
{
/* Now we can tell master shutdown is complete. */
/* Now we can tell master shutdown is complete. */
wire_sync_write ( MASTER_FD ,
wire_sync_write ( MASTER_FD ,
take ( towire_channel_shutdown_complete ( NULL , peer - > pps ) ) ) ;
take ( towire_channeld _shutdown_complete ( NULL , peer - > pps ) ) ) ;
per_peer_state_fdpass_send ( MASTER_FD , peer - > pps ) ;
per_peer_state_fdpass_send ( MASTER_FD , peer - > pps ) ;
close ( MASTER_FD ) ;
close ( MASTER_FD ) ;
}
}
@ -3390,7 +3390,7 @@ int main(int argc, char *argv[])
msg = msg_dequeue ( peer - > from_master ) ;
msg = msg_dequeue ( peer - > from_master ) ;
if ( msg ) {
if ( msg ) {
status_debug ( " Now dealing with deferred %s " ,
status_debug ( " Now dealing with deferred %s " ,
channel_wire_typ e_name (
channeld _wire_name (
fromwire_peektype ( msg ) ) ) ;
fromwire_peektype ( msg ) ) ) ;
req_in ( peer , msg ) ;
req_in ( peer , msg ) ;
tal_free ( msg ) ;
tal_free ( msg ) ;