handle SIGINT
This commit is contained in:
parent
5c3e007e38
commit
1cd51ef944
4
index.js
4
index.js
@ -21,6 +21,10 @@ if (require.main === module) {
|
||||
console.log('Error: ', err);
|
||||
}
|
||||
});
|
||||
process.on('SIGINT', function() {
|
||||
node.stop();
|
||||
process.exit();
|
||||
});
|
||||
|
||||
var reporterName = config.get('Reporter');
|
||||
var reporter = reporters[reporterName];
|
||||
|
||||
@ -86,6 +86,11 @@ BitcoreNode.prototype.start = function() {
|
||||
this.networkMonitor.start();
|
||||
};
|
||||
|
||||
BitcoreNode.prototype.stop = function() {
|
||||
this.networkMonitor.stop();
|
||||
};
|
||||
|
||||
|
||||
BitcoreNode.prototype.sync = function() {
|
||||
var genesis = bitcore.Block.fromBuffer(genesisBlocks[bitcore.Networks.defaultNetwork.name]);
|
||||
var self = this;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user