xpay: use filtering on rpc_command so we only get called on "pay".

tests/test_coinmoves.py::test_generate_coinmoves (2,000,000, sqlite3):
	Time (from start to end of l2 node):	 135 seconds **WAS 227**
	Worst latency:				 12.1 seconds **WAS 62.4**

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2025-11-20 12:07:13 +10:30
parent 1d4a1cdd8a
commit 9961f6bf0e
2 changed files with 11 additions and 2 deletions

View File

@@ -2500,10 +2500,13 @@ dont_redirect:
return command_hook_success(cmd);
}
static const char *cmd_hook_filters[] = {"pay"};
static const struct plugin_hook hooks[] = {
{
"rpc_command",
handle_rpc_command,
.name = "rpc_command",
.handle = handle_rpc_command,
.strfilters = cmd_hook_filters,
.num_strfilters = ARRAY_SIZE(cmd_hook_filters),
},
};