mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
lightningd: don't crash when we get a bogus estimatefees subfield.
We hand "estimatefees.feerate_floor" as method, for example, and then crash instead of reporting the plugin which gave us the bad answer. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -113,9 +113,9 @@ static void bitcoin_plugin_error(struct bitcoind *bitcoind, const char *buf,
|
|||||||
reason = tal_vfmt(NULL, fmt, ap);
|
reason = tal_vfmt(NULL, fmt, ap);
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
|
|
||||||
p = strmap_get(&bitcoind->pluginsmap, method);
|
p = strmap_getn(&bitcoind->pluginsmap, method, strcspn(method, "."));
|
||||||
fatal("%s error: bad response to %s (%s), response was %.*s",
|
fatal("%s error: bad response to %s (%s), response was %.*s",
|
||||||
p->cmd, method, reason,
|
p ? p->cmd : "UNKNOWN CALL", method, reason,
|
||||||
toks->end - toks->start, buf + toks->start);
|
toks->end - toks->start, buf + toks->start);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user