@ -268,7 +268,8 @@ static void send_offer(struct crypto_state *cs,
}
static void tell_master_their_offer ( const struct bitcoin_signature * their_sig ,
const struct bitcoin_tx * tx )
const struct bitcoin_tx * tx ,
struct bitcoin_txid * tx_id )
{
u8 * msg = towire_closing_received_signature ( NULL , their_sig , tx ) ;
if ( ! wire_sync_write ( REQ_FD , take ( msg ) ) )
@ -278,7 +279,7 @@ static void tell_master_their_offer(const struct bitcoin_signature *their_sig,
/* Wait for master to ack, to make sure it's in db. */
msg = wire_sync_read ( NULL , REQ_FD ) ;
if ( ! fromwire_closing_received_signature_reply ( msg ) )
if ( ! fromwire_closing_received_signature_reply ( msg , tx_id ) )
master_badmsg ( WIRE_CLOSING_RECEIVED_SIGNATURE_REPLY , msg ) ;
tal_free ( msg ) ;
}
@ -296,7 +297,8 @@ receive_offer(struct crypto_state *cs,
const struct amount_sat out [ NUM_SIDES ] ,
enum side funder ,
struct amount_sat our_dust_limit ,
struct amount_sat min_fee_to_accept )
struct amount_sat min_fee_to_accept ,
struct bitcoin_txid * closing_txid )
{
u8 * msg ;
struct channel_id their_channel_id ;
@ -399,7 +401,7 @@ receive_offer(struct crypto_state *cs,
/* Master sorts out what is best offer, we just tell it any above min */
if ( amount_sat_greater_eq ( received_fee , min_fee_to_accept ) ) {
status_trace ( " ...offer is reasonable " ) ;
tell_master_their_offer ( & their_sig , tx ) ;
tell_master_their_offer ( & their_sig , tx , closing_txid ) ;
}
return received_fee ;
@ -535,7 +537,7 @@ int main(int argc, char *argv[])
const tal_t * ctx = tal ( NULL , char ) ;
u8 * msg ;
struct pubkey funding_pubkey [ NUM_SIDES ] ;
struct bitcoin_txid funding_txid ;
struct bitcoin_txid funding_txid , closing_txid ;
u16 funding_txout ;
struct amount_sat funding , out [ NUM_SIDES ] ;
struct amount_sat our_dust_limit ;
@ -643,7 +645,8 @@ int main(int argc, char *argv[])
funding_txout , funding ,
out , funder ,
our_dust_limit ,
min_fee_to_accept ) ;
min_fee_to_accept ,
& closing_txid ) ;
}
}
@ -684,14 +687,16 @@ int main(int argc, char *argv[])
funding_txout , funding ,
out , funder ,
our_dust_limit ,
min_fee_to_accept ) ;
min_fee_to_accept ,
& closing_txid ) ;
}
whose_turn = ! whose_turn ;
}
peer_billboard ( true , " We agreed on a closing fee of % " PRIu64 " satoshi " ,
offer [ LOCAL ] ) ;
peer_billboard ( true , " We agreed on a closing fee of % " PRIu64 " satoshi for tx:%s " ,
offer [ LOCAL ] ,
type_to_string ( tmpctx , struct bitcoin_txid , & closing_txid ) ) ;
# if DEVELOPER
/* We don't listen for master commands, so always check memleak here */