mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-03-15 20:09:18 +01:00
plugin: Allow plugins to customize the mindepth in accept_channel
This is the counterpart of the `mindepth` parameter in `fundchannel` and friends. Allows dynamic lookups of `node_id` and selectively opting into `option_zeroconf` being used. Changelog-Added: plugin: The `openchannel` hook may return a `mindepth` indicating how many confirmations are required.
This commit is contained in:
parent
adbb977053
commit
1477873190
1 changed files with 11 additions and 0 deletions
|
@ -701,6 +701,7 @@ openchannel_hook_deserialize(struct openchannel_hook_payload *payload,
|
|||
const jsmntok_t *t_result = json_get_member(buffer, toks, "result");
|
||||
const jsmntok_t *t_errmsg = json_get_member(buffer, toks, "error_message");
|
||||
const jsmntok_t *t_closeto = json_get_member(buffer, toks, "close_to");
|
||||
const jsmntok_t *t_mindepth = json_get_member(buffer, toks, "mindepth");
|
||||
|
||||
if (!t_result)
|
||||
fatal("Plugin returned an invalid response to the"
|
||||
|
@ -752,6 +753,16 @@ openchannel_hook_deserialize(struct openchannel_hook_payload *payload,
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (t_mindepth != NULL) {
|
||||
json_to_u32(buffer, t_mindepth, &payload->uc->minimum_depth);
|
||||
log_debug(
|
||||
openingd->ld->log,
|
||||
"Setting mindepth=%d for this channel as requested by "
|
||||
"the openchannel hook",
|
||||
payload->uc->minimum_depth);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue