@@ -249,13 +249,6 @@ void unmarshal_witnesses(RepeatedPtrField<WitnessStack> const &wits,
249249 *o_sigs = osigs;
250250}
251251
252- bool return_pubkey (const string &i_pubkey, struct pubkey *o_pubkey)
253- {
254- /* pubkey needs to be compressed DER */
255- return pubkey_from_der (
256- (const u8 *)i_pubkey.c_str (), i_pubkey.length (), o_pubkey);
257- }
258-
259252/* Copied from ccan/mem/mem.h which the c++ compiler doesn't like */
260253static inline bool memeq (const void *a, size_t al, const void *b, size_t bl)
261254{
@@ -740,38 +733,13 @@ proxy_stat proxy_handle_get_channel_basepoints(
740733 GetChannelBasepointsReply rsp;
741734 Status status = stub->GetChannelBasepoints (&context, req, &rsp);
742735 if (status.ok ()) {
743- /* FIXME - Uncomment these when real value returned */
744- #if 1
745- /* For now just make valgrind happy */
746- memset (o_basepoints, ' \0 ' , sizeof (*o_basepoints));
747- memset (o_funding_pubkey, ' \0 ' , sizeof (*o_funding_pubkey));
748- #else
749- if (!return_pubkey(rsp.basepoints().revocation(),
750- &o_basepoints->revocation)) {
751- last_message = "bad returned revocation basepoint";
752- return PROXY_INTERNAL_ERROR;
753- }
754- if (!return_pubkey(rsp.basepoints().payment(),
755- &o_basepoints->payment)) {
756- last_message = "bad returned payment basepoint";
757- return PROXY_INTERNAL_ERROR;
758- }
759- if (!return_pubkey(rsp.basepoints().htlc(),
760- &o_basepoints->htlc)) {
761- last_message = "bad returned htlc basepoint";
762- return PROXY_INTERNAL_ERROR;
763- }
764- if (!return_pubkey(rsp.basepoints().delayed_payment(),
765- &o_basepoints->delayed_payment)) {
766- last_message = "bad returned delayed_payment basepoint";
767- return PROXY_INTERNAL_ERROR;
768- }
769- if (!return_pubkey(rsp.remote_funding_pubkey(),
770- o_funding_pubkey)) {
771- last_message = "bad returned funding pubkey";
772- return PROXY_INTERNAL_ERROR;
773- }
774- #endif
736+ Basepoints const & bps = rsp.basepoints ();
737+ unmarshal_pubkey (bps.revocation (), &o_basepoints->revocation );
738+ unmarshal_pubkey (bps.payment (), &o_basepoints->payment );
739+ unmarshal_pubkey (bps.htlc (), &o_basepoints->htlc );
740+ unmarshal_pubkey (bps.delayed_payment (),
741+ &o_basepoints->delayed_payment );
742+ unmarshal_pubkey (bps.funding_pubkey (), o_funding_pubkey);
775743 status_debug (" %s:%d %s self_id=%s" ,
776744 __FILE__, __LINE__, __FUNCTION__,
777745 dump_node_id (&self_id).c_str (),
0 commit comments