mirror of https://github.com/embarklabs/embark.git
fix: fix error logs in the cockpit due from negative blocks numbers (#1967)
This commit is contained in:
parent
d86c26d71a
commit
4b947bb5c2
|
@ -153,11 +153,13 @@ export default class EthereumAPI {
|
|||
});
|
||||
},
|
||||
function (next) {
|
||||
async.times(limit, function (n, eachCb) {
|
||||
self.web3.eth.getBlock(from - n, returnTransactionObjects, function (err, block) {
|
||||
if (from - limit < 0) {
|
||||
limit = from + 1;
|
||||
}
|
||||
async.times(limit, (n, eachCb) => {
|
||||
self.web3.eth.getBlock(from - n, returnTransactionObjects, (err, block) => {
|
||||
if (err) {
|
||||
// FIXME Returns an error because we are too low
|
||||
return eachCb();
|
||||
return eachCb(err);
|
||||
}
|
||||
if (!block) {
|
||||
return eachCb();
|
||||
|
|
|
@ -57,6 +57,7 @@ export class Proxy {
|
|||
// Send the possibly modified request to the Node
|
||||
requestManager.send(resp.reqData, (err, result) => {
|
||||
if (err) {
|
||||
this.logger.debug(JSON.stringify(resp.reqData));
|
||||
return this.logger.error(__('Error executing the request on the Node'), err.message || err);
|
||||
}
|
||||
this.emitActionsForResponse(resp.reqData, {jsonrpc: "2.0", id: resp.reqData.id, result}, (_err, resp) => {
|
||||
|
|
Loading…
Reference in New Issue