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:
Rusty Russell 2023-07-11 01:53:43 +09:30
parent 5afd0ab6bb
commit 81cfd3799e
1 changed files with 2 additions and 2 deletions

View File

@ -113,9 +113,9 @@ static void bitcoin_plugin_error(struct bitcoind *bitcoind, const char *buf,
reason = tal_vfmt(NULL, fmt, 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",
p->cmd, method, reason,
p ? p->cmd : "UNKNOWN CALL", method, reason,
toks->end - toks->start, buf + toks->start);
}