hotfix for crash

This commit is contained in:
Sai Raj 2023-01-03 21:00:21 +05:30 committed by GitHub
parent b4df8314a2
commit 10db01654e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -181,10 +181,12 @@ BlockService.prototype.getRawBlock = function(hash, callback) {
if(err) {
return callback(err);
}
if (!block) {
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.toRaw().toString('hex'));
log.info("Testing getRawBlock " + block_raw_str_hex);
callback(null, block.toRaw().toString('hex'));
});
};