commando-rune: show warning when creating runes with no restrictions

Changelog-Added: Show warning when creating runes with no restrictions
Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
William Casarin
2022-07-28 07:05:51 -07:00
committed by neil saitug
parent 78804d9ea8
commit 10d66c25c4
3 changed files with 12 additions and 1 deletions

View File

@@ -804,6 +804,10 @@ static struct command_result *reply_with_rune(struct command *cmd,
json_add_string(js, "rune", rune_to_base64(tmpctx, rune));
json_add_string(js, "unique_id", rune->unique_id);
if (tal_count(rune->restrs) <= 1) {
json_add_string(js, "warning_unrestricted_rune", "WARNING: This rune has no restrictions! Anyone who has access to this rune could drain funds from your node. Be careful when giving this to apps that you don't trust. Consider using the restrictions parameter to only allow access to specific rpc methods.");
}
return command_finished(cmd, js);
}