@ -116,7 +116,7 @@ static const u8 *dev_upfront_shutdown_script(const tal_t *ctx)
/*~ If we can't agree on parameters, we fail to open the channel. If we're
* the funder , we need to tell lightningd , otherwise it never really notices . */
static void negotiation_aborted ( struct state * state , bool am_funder ,
const char * why )
const char * why , bool is_err )
{
status_debug ( " aborted opening negotiation: %s " , why ) ;
/*~ The "billboard" (exposed as "status" in the JSON listpeers RPC
@ -129,7 +129,7 @@ static void negotiation_aborted(struct state *state, bool am_funder,
/* If necessary, tell master that funding failed. */
if ( am_funder ) {
u8 * msg = towire_opening_funder_failed ( NULL , why ) ;
u8 * msg = towire_opening_funder_failed ( NULL , why , is_err ) ;
wire_sync_write ( REQ_FD , take ( msg ) ) ;
}
@ -155,7 +155,7 @@ static void negotiation_failed(struct state *state, bool am_funder,
" You gave bad parameters: %s " , errmsg ) ;
sync_crypto_write ( state - > pps , take ( msg ) ) ;
negotiation_aborted ( state , am_funder , errmsg ) ;
negotiation_aborted ( state , am_funder , errmsg , true ) ;
}
/*~ This is the key function that checks that their configuration is reasonable:
@ -399,7 +399,8 @@ static u8 *opening_negotiate_msg(const tal_t *ctx, struct state *state,
if ( all_channels ) {
if ( am_funder ) {
msg = towire_opening_funder_failed ( NULL ,
err ) ;
err ,
true ) ;
wire_sync_write ( REQ_FD , take ( msg ) ) ;
}
peer_failed_received_errmsg ( state - > pps , err ,
@ -407,7 +408,8 @@ static u8 *opening_negotiate_msg(const tal_t *ctx, struct state *state,
}
negotiation_aborted ( state , am_funder ,
tal_fmt ( tmpctx , " They sent error %s " ,
err ) ) ;
err ) ,
true ) ;
/* Return NULL so caller knows to stop negotiating. */
return NULL ;
}