Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix error logs in the cockpit due from negative blocks numbers #1967

Merged
merged 1 commit into from
Oct 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
1 change: 1 addition & 0 deletions packages/stack/proxy/src/proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down