@@ -867,6 +867,7 @@ struct onfunding_channel_tx_hook_payload {
867867static void onfunding_channel_tx_hook_final (struct onfunding_channel_tx_hook_payload * payload STEALS )
868868{
869869 struct subd * openingd = payload -> openingd ;
870+ log_info (openingd -> log , "from hook sending the tx %s" , fmt_bitcoin_tx (tmpctx , payload -> tx ));
870871 // FIXME(bitfinix): manage the errors!
871872 subd_send_msg (openingd ,
872873 take (towire_openingd_on_funding_tx_reply (NULL , payload -> tx )));
@@ -892,25 +893,26 @@ static bool onfunding_channel_tx_hook_deserialize(struct onfunding_channel_tx_ho
892893{
893894 const jsmntok_t * result_tok , * error_tok , * tx_tok ;
894895
896+ log_info (payload -> openingd -> log , "buffer %s" , buffer );
895897 if ((error_tok = json_get_member (buffer , toks , "error" )) != NULL )
896898 fatal ("Plugin returned an error inside the response to the"
897899 " onfunding_channel_tx hook: %.*s" ,
898900 toks [0 ].end - toks [0 ].start , buffer + toks [0 ].start );
899901
900- if ((result_tok = json_get_member (buffer , toks , "result" )) == NULL )
901- fatal ("Plugin returned an invalid response to the"
902+ if ((result_tok = json_get_member (buffer , toks , "result" )) == NULL )
903+ fatal ("Plugin returned an invalid response (missing result) to the"
902904 " onfunding_channel_tx hook: %.*s" ,
903905 toks [0 ].end - toks [0 ].start , buffer + toks [0 ].start );
904906
905907 if ((tx_tok = json_get_member (buffer , result_tok , "tx" )) == NULL )
906- fatal ("Plugin returned an invalid response to the"
908+ fatal ("Plugin returned an invalid response (missing tx) to the"
907909 " onfunding_channel_tx hook: %.*s" ,
908910 toks [0 ].end - toks [0 ].start , buffer + toks [0 ].start );
909911
910912 if (!json_to_tx (buffer , tx_tok , payload -> tx ))
911- fatal ("Plugin returned an invalid response to the"
913+ fatal ("Plugin returned an invalid (json to tx) response to the"
912914 " onfunding_channel_tx hook: %.*s" ,
913- toks [0 ].end - toks [0 ].start , buffer + toks [0 ].start );
915+ tx_tok [0 ].end - tx_tok [0 ].start , buffer + tx_tok [0 ].start );
914916 return true;
915917}
916918
0 commit comments