diff --git a/bin/node b/bin/node index 48b835e1..d9d1551f 100755 --- a/bin/node +++ b/bin/node @@ -45,6 +45,10 @@ process.on('unhandledRejection', (err, promise) => { throw err; }); +process.on('SIGINT', async () => { + await node.close(); +}); + (async () => { await node.ensure(); await node.open(); diff --git a/bin/spvnode b/bin/spvnode index 4608468b..b9499c57 100755 --- a/bin/spvnode +++ b/bin/spvnode @@ -33,6 +33,10 @@ process.on('unhandledRejection', (err, promise) => { throw err; }); +process.on('SIGINT', async () => { + await node.close(); +}); + (async () => { await node.ensure(); await node.open();