@@ -746,24 +746,27 @@ proxy_stat proxy_handle_sign_remote_commitment_tx(
746746 struct node_id *peer_id,
747747 u64 dbid,
748748 const struct pubkey *remote_per_commit,
749- struct sha256 *rhashes, u64 commit_num,
749+ struct existing_htlc **htlcs,
750+ u64 commit_num, u32 feerate,
750751 struct bitcoin_signature *o_sig)
751752{
752753 STATUS_DEBUG (
753754 " %s:%d %s { "
754755 " \" self_id\" :%s, \" peer_id\" :%s, \" dbid\" :%" PRIu64 " , "
755756 " \" counterparty_funding_pubkey\" :%s, "
756757 " \" remote_per_commit\" :%s, \" tx\" :%s, "
757- " \" rhashes\" :%s, \" commit_num\" :%" PRIu64 " }" ,
758+ " \" htlcs\" :%s, "
759+ " \" commit_num\" :%" PRIu64 " , "
760+ " \" feerate\" :%d }" ,
758761 __FILE__, __LINE__, __FUNCTION__,
759762 dump_node_id (&self_id).c_str (),
760763 dump_node_id (peer_id).c_str (),
761764 dbid,
762765 dump_pubkey (counterparty_funding_pubkey).c_str (),
763766 dump_pubkey (remote_per_commit).c_str (),
764767 dump_tx (tx).c_str (),
765- dump_rhashes (rhashes , tal_count (rhashes )).c_str (),
766- commit_num
768+ dump_htlcs (( const struct existing_htlc **) htlcs , tal_count (htlcs )).c_str (),
769+ commit_num, feerate
767770 );
768771
769772 last_message = " " ;
@@ -773,8 +776,15 @@ proxy_stat proxy_handle_sign_remote_commitment_tx(
773776 marshal_pubkey (remote_per_commit,
774777 req.mutable_remote_per_commit_point ());
775778 marshal_single_input_tx (tx, NULL , req.mutable_tx ());
776- marshal_rhashes (rhashes, req.mutable_payment_hashes ());
779+ for (size_t ii = 0 ; ii < tal_count (htlcs); ++ii) {
780+ if (htlc_state_owner (htlcs[ii]->state ) == REMOTE) {
781+ marshal_htlc (htlcs[ii], req.add_offered_htlcs ());
782+ } else {
783+ marshal_htlc (htlcs[ii], req.add_received_htlcs ());
784+ }
785+ }
777786 req.set_commit_num (commit_num);
787+ req.set_feerate_sat_per_kw (feerate);
778788
779789 ClientContext context;
780790 SignatureReply rsp;
@@ -1073,31 +1083,41 @@ proxy_stat proxy_handle_sign_commitment_tx(
10731083 const struct pubkey *counterparty_funding_pubkey,
10741084 struct node_id *peer_id,
10751085 u64 dbid,
1076- struct sha256 *rhashes, u64 commit_num,
1086+ struct existing_htlc **htlcs,
1087+ u64 commit_num, u32 feerate,
10771088 struct bitcoin_signature *o_sig)
10781089{
10791090 STATUS_DEBUG (
10801091 " %s:%d %s { "
10811092 " \" self_id\" :%s, \" peer_id\" :%s, \" dbid\" :%" PRIu64 " , "
10821093 " \" counterparty_funding_pubkey\" :%s, \" tx\" :%s, "
1083- " \" rhashes\" :%s, \" commit_num\" :%" PRIu64 " }" ,
1094+ " \" htlcs\" :%s, "
1095+ " \" commit_num\" :%" PRIu64 " , "
1096+ " \" feerate\" :%d }" ,
10841097 __FILE__, __LINE__, __FUNCTION__,
10851098 dump_node_id (&self_id).c_str (),
10861099 dump_node_id (peer_id).c_str (),
10871100 dbid,
10881101 dump_pubkey (counterparty_funding_pubkey).c_str (),
10891102 dump_tx (tx).c_str (),
1090- dump_rhashes (rhashes , tal_count (rhashes )).c_str (),
1091- commit_num
1103+ dump_htlcs (( const struct existing_htlc **) htlcs , tal_count (htlcs )).c_str (),
1104+ commit_num, feerate
10921105 );
10931106
10941107 last_message = " " ;
10951108 SignHolderCommitmentTxRequest req;
10961109 marshal_node_id (&self_id, req.mutable_node_id ());
10971110 marshal_channel_nonce (peer_id, dbid, req.mutable_channel_nonce ());
10981111 marshal_single_input_tx (tx, NULL , req.mutable_tx ());
1099- marshal_rhashes (rhashes, req.mutable_payment_hashes ());
1112+ for (size_t ii = 0 ; ii < tal_count (htlcs); ++ii) {
1113+ if (htlc_state_owner (htlcs[ii]->state ) == LOCAL) {
1114+ marshal_htlc (htlcs[ii], req.add_offered_htlcs ());
1115+ } else {
1116+ marshal_htlc (htlcs[ii], req.add_received_htlcs ());
1117+ }
1118+ }
11001119 req.set_commit_num (commit_num);
1120+ req.set_feerate_sat_per_kw (feerate);
11011121
11021122 ClientContext context;
11031123 SignatureReply rsp;
0 commit comments