diff --git a/plugins/Makefile b/plugins/Makefile index 335e3847a..7ca2622e2 100644 --- a/plugins/Makefile +++ b/plugins/Makefile @@ -203,7 +203,7 @@ plugins/recover: $(PLUGIN_RECOVER_OBJS) $(PLUGIN_LIB_OBJS) libcommon.a plugins/recklessrpc: $(PLUGIN_RECKLESSRPC_OBJS) $(PLUGIN_LIB_OBJS) libcommon.a # This covers all the low-level list RPCs which return simple arrays -SQL_LISTRPCS := listchannels listforwards listhtlcs listinvoices listnodes listoffers listpeers listpeerchannels listclosedchannels listtransactions listsendpays listchainmoves listchannelmoves bkpr-listaccountevents bkpr-listincome +SQL_LISTRPCS := listchannels listforwards listhtlcs listinvoices listnodes listoffers listpeers listpeerchannels listclosedchannels listtransactions listsendpays listchainmoves listchannelmoves bkpr-listaccountevents bkpr-listincome listnetworkevents SQL_LISTRPCS_SCHEMAS := $(foreach l,$(SQL_LISTRPCS),doc/schemas/$l.json) SQL_SCHEMA_PARTS := $(foreach l,$(SQL_LISTRPCS), plugins/sql-schema_$l_gen.h) diff --git a/plugins/sql.c b/plugins/sql.c index be7df11df..17c63faf7 100644 --- a/plugins/sql.c +++ b/plugins/sql.c @@ -1517,7 +1517,8 @@ static const struct refresh_funcs refresh_funcs[] = { { "listclosedchannels", default_refresh }, { "listtransactions", default_refresh }, { "bkpr-listaccountevents", default_refresh }, - { "bkpr-listincome", default_refresh } + { "bkpr-listincome", default_refresh }, + { "listnetworkevents", default_refresh }, }; static const struct refresh_funcs *find_command_refresh(const char *cmdname) diff --git a/tests/test_plugin.py b/tests/test_plugin.py index 03109f3bb..1ef559420 100644 --- a/tests/test_plugin.py +++ b/tests/test_plugin.py @@ -3907,7 +3907,23 @@ def test_sql(node_factory, bitcoind): {'name': 'txid', 'type': 'txid'}, {'name': 'payment_id', - 'type': 'hex'}]}} + 'type': 'hex'}]}, + 'networkevents': { + 'columns': [{'name': 'created_index', + 'type': 'u64'}, + {'name': 'timestamp', + 'type': 'u64'}, + {'name': 'peer_id', + 'type': 'pubkey'}, + {'name': 'type', + 'type': 'string'}, + {'name': 'reason', + 'type': 'string'}, + {'name': 'duration_nsec', + 'type': 'u64'}, + {'name': 'connect_attempted', + 'type': 'boolean'}]}, + } sqltypemap = {'string': 'TEXT', 'boolean': 'INTEGER',