@@ -869,6 +869,7 @@ struct onfunding_channel_tx_hook_payload {
869869static void onfunding_channel_tx_hook_final (struct onfunding_channel_tx_hook_payload * payload STEALS )
870870{
871871 struct subd * openingd = payload -> openingd ;
872+ log_info (openingd -> log , "from hook sending the tx %s" , fmt_bitcoin_tx (tmpctx , payload -> tx ));
872873 // FIXME(bitfinix): manage the errors!
873874 subd_send_msg (openingd ,
874875 take (towire_openingd_on_funding_tx_reply (NULL , payload -> tx )));
@@ -894,25 +895,26 @@ static bool onfunding_channel_tx_hook_deserialize(struct onfunding_channel_tx_ho
894895{
895896 const jsmntok_t * result_tok , * error_tok , * tx_tok ;
896897
898+ log_info (payload -> openingd -> log , "buffer %s" , buffer );
897899 if ((error_tok = json_get_member (buffer , toks , "error" )) != NULL )
898900 fatal ("Plugin returned an error inside the response to the"
899901 " onfunding_channel_tx hook: %.*s" ,
900902 toks [0 ].end - toks [0 ].start , buffer + toks [0 ].start );
901903
902- if ((result_tok = json_get_member (buffer , toks , "result" )) == NULL )
903- fatal ("Plugin returned an invalid response to the"
904+ if ((result_tok = json_get_member (buffer , toks , "result" )) == NULL )
905+ fatal ("Plugin returned an invalid response (missing result) to the"
904906 " onfunding_channel_tx hook: %.*s" ,
905907 toks [0 ].end - toks [0 ].start , buffer + toks [0 ].start );
906908
907909 if ((tx_tok = json_get_member (buffer , result_tok , "tx" )) == NULL )
908- fatal ("Plugin returned an invalid response to the"
910+ fatal ("Plugin returned an invalid response (missing tx) to the"
909911 " onfunding_channel_tx hook: %.*s" ,
910912 toks [0 ].end - toks [0 ].start , buffer + toks [0 ].start );
911913
912914 if (!json_to_tx (buffer , tx_tok , payload -> tx ))
913- fatal ("Plugin returned an invalid response to the"
915+ fatal ("Plugin returned an invalid (json to tx) response to the"
914916 " onfunding_channel_tx hook: %.*s" ,
915- toks [0 ].end - toks [0 ].start , buffer + toks [0 ].start );
917+ tx_tok [0 ].end - tx_tok [0 ].start , buffer + tx_tok [0 ].start );
916918 return true;
917919}
918920
0 commit comments