Browse Source

lightningd: remove deprecated return for `db_write` hook.

Changelog-Removed: JSON API: The hook `db_write` can no longer return `true` (deprecated in 0.8.1)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
pyln
Rusty Russell 4 years ago
parent
commit
8aa660e938
  1. 27
      lightningd/plugin_hook.c

27
lightningd/plugin_hook.c

@ -299,33 +299,6 @@ static void db_hook_response(const char *buffer, const jsmntok_t *toks,
fatal("Plugin returned an invalid response to the db_write "
"hook: %s", buffer);
#ifdef COMPAT_V080
/* For back-compatibility we allow to return a simple Boolean true. */
if (deprecated_apis) {
bool resp;
if (json_to_bool(buffer, resulttok, &resp)) {
static bool warned = false;
/* If it fails, we must not commit to our db. */
if (!resp)
fatal("Plugin returned failed db_write: %s.",
buffer);
if (!warned) {
warned = true;
log_unusual(ph_req->db->log,
"Plugin returned 'true' to "
"'db_hook'. "
"This is now deprecated and "
"you should return "
"{'result': 'continue'} "
"instead.");
}
/* Resume. */
io_break(ph_req);
return;
}
}
#endif /* defined(COMPAT_V080) */
/* We expect result: { 'result' : 'continue' }.
* Anything else we abort.
*/

Loading…
Cancel
Save