@@ -210,6 +210,15 @@ void marshal_single_input_tx(struct bitcoin_tx const *tx,
210210 }
211211}
212212
213+ void marshal_rhashes (const struct sha256 *rhashes,
214+ RepeatedPtrField<string> *payment_hashes)
215+ {
216+ for (size_t ii = 0 ; ii < tal_count (rhashes); ++ii) {
217+ payment_hashes->Add (string ((const char *) &rhashes[ii],
218+ sizeof (struct sha256 )));
219+ }
220+ }
221+
213222void unmarshal_secret (Secret const &ss, struct secret *o_sp)
214223{
215224 assert (ss.data ().size () == sizeof (o_sp->data ));
@@ -671,22 +680,26 @@ proxy_stat proxy_handle_sign_remote_commitment_tx(
671680 u64 dbid,
672681 const struct pubkey *remote_per_commit,
673682 bool option_static_remotekey,
683+ struct sha256 *rhashes, u64 commit_num,
674684 struct bitcoin_signature *o_sig)
675685{
676686 STATUS_DEBUG (
677687 " %s:%d %s { "
678688 " \" self_id\" :%s, \" peer_id\" :%s, \" dbid\" :%" PRIu64 " , "
679689 " \" counterparty_funding_pubkey\" :%s, "
680690 " \" remote_per_commit\" :%s, "
681- " \" option_static_remotekey\" :%s, \" tx\" :%s }" ,
691+ " \" option_static_remotekey\" :%s, \" tx\" :%s, "
692+ " \" rhashes\" :%s, \" commit_num\" :%" PRIu64 " }" ,
682693 __FILE__, __LINE__, __FUNCTION__,
683694 dump_node_id (&self_id).c_str (),
684695 dump_node_id (peer_id).c_str (),
685696 dbid,
686697 dump_pubkey (counterparty_funding_pubkey).c_str (),
687698 dump_pubkey (remote_per_commit).c_str (),
688699 (option_static_remotekey ? " true" : " false" ),
689- dump_tx (tx).c_str ()
700+ dump_tx (tx).c_str (),
701+ dump_rhashes (rhashes, tal_count (rhashes)).c_str (),
702+ commit_num
690703 );
691704
692705 last_message = " " ;
@@ -696,6 +709,8 @@ proxy_stat proxy_handle_sign_remote_commitment_tx(
696709 marshal_pubkey (remote_per_commit,
697710 req.mutable_remote_per_commit_point ());
698711 marshal_single_input_tx (tx, NULL , req.mutable_tx ());
712+ marshal_rhashes (rhashes, req.mutable_payment_hashes ());
713+ req.set_commit_num (commit_num);
699714
700715 ClientContext context;
701716 SignatureReply rsp;
0 commit comments