@ -918,7 +918,6 @@ static bool peer_save_commitsig_received(struct peer *peer, u64 commitnum,
/* Update peer->last_sig and peer->last_tx before saving to db */
/* Update peer->last_sig and peer->last_tx before saving to db */
peer_last_tx ( peer , tx , commit_sig ) ;
peer_last_tx ( peer , tx , commit_sig ) ;
wallet_channel_save ( peer - > ld - > wallet , peer - > channel , 0 ) ;
return true ;
return true ;
}
}
@ -992,10 +991,11 @@ void peer_sending_commitsig(struct peer *peer, const u8 *msg)
if ( ! peer_save_commitsig_sent ( peer , commitnum ) )
if ( ! peer_save_commitsig_sent ( peer , commitnum ) )
return ;
return ;
/* Last was commit. FIXME: Save to db. */
/* Last was commit. */
peer - > last_was_revoke = false ;
peer - > last_was_revoke = false ;
tal_free ( peer - > last_sent_commit ) ;
tal_free ( peer - > last_sent_commit ) ;
peer - > last_sent_commit = tal_steal ( peer , changed_htlcs ) ;
peer - > last_sent_commit = tal_steal ( peer , changed_htlcs ) ;
wallet_channel_save ( peer - > ld - > wallet , peer - > channel , 0 ) ;
/* Tell it we've got it, and to go ahead with commitment_signed. */
/* Tell it we've got it, and to go ahead with commitment_signed. */
subd_send_msg ( peer - > owner ,
subd_send_msg ( peer - > owner ,
@ -1135,6 +1135,8 @@ void peer_got_commitsig(struct peer *peer, const u8 *msg)
if ( ! peer_save_commitsig_received ( peer , commitnum , tx , & commit_sig ) )
if ( ! peer_save_commitsig_received ( peer , commitnum , tx , & commit_sig ) )
return ;
return ;
wallet_channel_save ( peer - > ld - > wallet , peer - > channel , 0 ) ;
/* FIXME: Put these straight in the db! */
/* FIXME: Put these straight in the db! */
tal_free ( peer - > last_htlc_sigs ) ;
tal_free ( peer - > last_htlc_sigs ) ;
peer - > last_htlc_sigs = tal_steal ( peer , htlc_sigs ) ;
peer - > last_htlc_sigs = tal_steal ( peer , htlc_sigs ) ;