mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-03-03 18:57:06 +01:00
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>
This commit is contained in:
parent
349f245f8c
commit
8aa660e938
1 changed files with 0 additions and 27 deletions
|
@ -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 "
|
fatal("Plugin returned an invalid response to the db_write "
|
||||||
"hook: %s", buffer);
|
"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' }.
|
/* We expect result: { 'result' : 'continue' }.
|
||||||
* Anything else we abort.
|
* Anything else we abort.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Add table
Reference in a new issue