Skip to content

Commit

Permalink
Merge pull request #1850 from OriginTrail/v6/develop
Browse files Browse the repository at this point in the history
OriginTrail 6.0.0-beta.1.31 Testnet Prerelease Hotfix
  • Loading branch information
kotlarmilos authored Mar 24, 2022
2 parents 5a48dce + eec83d0 commit 6ce9639
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 14 deletions.
23 changes: 10 additions & 13 deletions external/libp2p-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,19 +165,16 @@ class Libp2pService {
this.node.handle(eventName, async (handlerProps) => {
const {stream} = handlerProps;
let timestamp = Date.now();
this.limiter.limit(handlerProps.connection.remotePeer.toB58String()).then(async (blocked) => {
if (blocked) {
const preparedBlockedResponse = await this.prepareForSending(constants.NETWORK_RESPONSES.BLOCKED);
await pipe(
[preparedBlockedResponse],
stream
);
requestBlocked = true;
this.logger.info(`Blocking request from ${handlerProps.connection.remotePeer._idB58String}. Max number of requests exceeded.`);
return;
}
}
);
const blocked = await this.limiter.limit(handlerProps.connection.remotePeer.toB58String());
if(blocked) {
const preparedBlockedResponse = await this.prepareForSending(constants.NETWORK_RESPONSES.BLOCKED);
await pipe(
[preparedBlockedResponse],
stream
);
this.logger.info(`Blocking request from ${handlerProps.connection.remotePeer._idB58String}. Max number of requests exceeded.`);
return;
}
let data = await pipe(
stream,
async function (source) {
Expand Down
2 changes: 1 addition & 1 deletion modules/service/data-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,7 @@ class DataService {
this.logger.info('TripleStore is busy.');
}
if (isToobusy) {
this.logger.info('TripleStore is busy.');
this.logger.info('Node is busy.');
}
return isToobusy || isTripleStoreBusy;
}
Expand Down

0 comments on commit 6ce9639

Please sign in to comment.