Compare commits
8 Commits
master
...
dev-stash1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6cf330926c | ||
|
|
e98754eab8 | ||
|
|
97d7c6ecde | ||
|
|
0a52cc93db | ||
|
|
b6a64351b3 | ||
|
|
d831d36835 | ||
|
|
10db01654e | ||
| b4df8314a2 |
@ -212,12 +212,13 @@ function exitHandler(options, _process, node, err) {
|
||||
if(err.stack) {
|
||||
log.error(err.stack);
|
||||
}
|
||||
node.stop(function(err) {
|
||||
if(err) {
|
||||
log.error('Failed to stop services: ' + err);
|
||||
}
|
||||
_process.exit(-1);
|
||||
});
|
||||
if(options.exit)
|
||||
node.stop(function(err) {
|
||||
if(err) {
|
||||
log.error('Failed to stop services: ' + err);
|
||||
}
|
||||
_process.exit(-1);
|
||||
});
|
||||
}
|
||||
// Handle SIGINT (Ctrl+C)
|
||||
if (options.sigint) {
|
||||
@ -229,7 +230,7 @@ function exitHandler(options, _process, node, err) {
|
||||
}
|
||||
|
||||
function registerExitHandlers(_process, node) {
|
||||
_process.on('uncaughtException', exitHandler.bind(null, {exit:true}, _process, node));
|
||||
_process.on('uncaughtException', exitHandler.bind(null, {exit:false}, _process, node));
|
||||
_process.on('SIGINT', exitHandler.bind(null, {sigint:true}, _process, node));
|
||||
}
|
||||
|
||||
|
||||
@ -181,10 +181,23 @@ BlockService.prototype.getRawBlock = function(hash, callback) {
|
||||
if(err) {
|
||||
return callback(err);
|
||||
}
|
||||
if (!block) {
|
||||
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){
|
||||
return callback();
|
||||
}
|
||||
callback(null, block.toRaw().toString('hex'));
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user