| 43 | } |
| 44 | |
| 45 | void fail_destination_tok(struct multifundchannel_destination *dest, |
| 46 | const char *buf, |
| 47 | const jsmntok_t *error) |
| 48 | { |
| 49 | const char *err; |
| 50 | const jsmntok_t *data_tok; |
| 51 | |
| 52 | err = json_scan(tmpctx, buf, error, "{code:%,message:%}", |
| 53 | JSON_SCAN(json_to_int, &dest->error_code), |
| 54 | JSON_SCAN_TAL(dest->mfc, |
| 55 | json_strdup, |
| 56 | &dest->error_message)); |
| 57 | if (err) |
| 58 | plugin_err(dest->mfc->cmd->plugin, |
| 59 | "`fundchannel_complete` failure failed to parse %s", |
| 60 | err); |
| 61 | |
| 62 | data_tok = json_get_member(buf, error, "data"); |
| 63 | if (data_tok) |
| 64 | dest->error_data = json_strdup(dest->mfc, buf, data_tok); |
| 65 | else |
| 66 | dest->error_data = NULL; |
| 67 | |
| 68 | fail_destination(dest); |
| 69 | } |
| 70 | |
| 71 | void fail_destination_msg(struct multifundchannel_destination *dest, |
| 72 | enum jsonrpc_errcode error_code, |
no test coverage detected