MCPcopy Create free account
hub / github.com/ElementsProject/lightning / bitcoin_plugin_error

Function bitcoin_plugin_error

lightningd/bitcoind.c:96–113  ·  view source on GitHub ↗

Our Bitcoin backend plugin gave us a bad response. We can't recover. */

Source from the content-addressed store, hash-verified

94
95/* Our Bitcoin backend plugin gave us a bad response. We can't recover. */
96static void NORETURN
97bitcoin_plugin_error(struct bitcoind *bitcoind, const char *buf,
98 const jsmntok_t *toks, const char *method,
99 const char *fmt, ...)
100{
101 va_list ap;
102 char *reason;
103 struct plugin *p;
104
105 va_start(ap, fmt);
106 reason = tal_vfmt(NULL, fmt, ap);
107 va_end(ap);
108
109 p = strmap_getn(&bitcoind->pluginsmap, method, strcspn(method, "."));
110 fatal("%s error: bad response to %s (%s), response was %.*s",
111 p ? p->cmd : "UNKNOWN CALL", method, reason,
112 toks->end - toks->start, buf + toks->start);
113}
114
115/* Check response for error (fatal if found) and return result token (fatal if not found). */
116static const jsmntok_t *get_bitcoin_result(struct bitcoind *bitcoind,

Callers 7

get_bitcoin_resultFunction · 0.85
parse_feerate_rangesFunction · 0.85
estimatefees_callbackFunction · 0.85
sendrawtx_callbackFunction · 0.85
getchaininfo_callbackFunction · 0.85
getutxout_callbackFunction · 0.85

Calls 1

fatalFunction · 0.70

Tested by

no test coverage detected