Compare commits
No commits in common. "6cf330926c739c6be2ad3637eac097bab7b19cbb" and "d831d36835be4dbd8784d9ca6647240022b934ab" have entirely different histories.
6cf330926c
...
d831d36835
@ -212,13 +212,12 @@ function exitHandler(options, _process, node, err) {
|
||||
if(err.stack) {
|
||||
log.error(err.stack);
|
||||
}
|
||||
if(options.exit)
|
||||
node.stop(function(err) {
|
||||
if(err) {
|
||||
log.error('Failed to stop services: ' + err);
|
||||
}
|
||||
_process.exit(-1);
|
||||
});
|
||||
node.stop(function(err) {
|
||||
if(err) {
|
||||
log.error('Failed to stop services: ' + err);
|
||||
}
|
||||
_process.exit(-1);
|
||||
});
|
||||
}
|
||||
// Handle SIGINT (Ctrl+C)
|
||||
if (options.sigint) {
|
||||
@ -230,7 +229,7 @@ function exitHandler(options, _process, node, err) {
|
||||
}
|
||||
|
||||
function registerExitHandlers(_process, node) {
|
||||
_process.on('uncaughtException', exitHandler.bind(null, {exit:false}, _process, node));
|
||||
_process.on('uncaughtException', exitHandler.bind(null, {exit:true}, _process, node));
|
||||
_process.on('SIGINT', exitHandler.bind(null, {sigint:true}, _process, node));
|
||||
}
|
||||
|
||||
|
||||
@ -181,23 +181,13 @@ BlockService.prototype.getRawBlock = function(hash, callback) {
|
||||
if(err) {
|
||||
return callback(err);
|
||||
}
|
||||
try{
|
||||
if(!block){
|
||||
return callback();
|
||||
}
|
||||
let block_raw = block.toRaw();
|
||||
if(typeof block_raw == "undefined" || !block_raw){
|
||||
return callback();
|
||||
}
|
||||
let block_raw_str_hex = block_raw.toString('hex');
|
||||
if(typeof block_raw_str_hex == "undefined" || block_raw_str_hex == ''){
|
||||
return callback();
|
||||
}
|
||||
log.info("Testing getRawBlock " + block_raw_str_hex);
|
||||
callback(null, block_raw_str_hex);
|
||||
} catch(e){
|
||||
let block_raw = block.toRaw();
|
||||
let block_raw_str_hex = block_raw.toString('hex');
|
||||
if (!block || typeof block_raw == "undefined" || typeof block_raw_str_hex == "undefined" || block_raw_str_hex == '') {
|
||||
return callback();
|
||||
}
|
||||
//log.info("Testing getRawBlock " + block_raw_str_hex);
|
||||
callback(null, block.toRaw().toString('hex'));
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user