Skip to content

Commit

Permalink
Fix version number to valid semver.Fix rejection on invalid semver peers
Browse files Browse the repository at this point in the history
  • Loading branch information
mcanever committed Sep 10, 2018
1 parent c1b7d43 commit b91c16f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion etc/testnet/config.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"port": 5566,
"address": "0.0.0.0",
"version": "1.2.0t",
"version": "1.2.0-t",
"fileLogLevel": "info",
"logFileName": "logs/rise-testnet.log",
"consoleLogLevel": "info",
Expand Down
2 changes: 1 addition & 1 deletion src/apis/requests/BaseRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export abstract class BaseRequest<Out, In> implements IAPIRequest<Out, In> {
}

protected peerSupportsProtoBuf(peer: IPeerLogic) {
return typeof(peer.version) !== 'undefined' && semver.gte(peer.version, '1.2.0');
return typeof(peer.version) !== 'undefined' && semver.valid(peer.version) && semver.gte(peer.version, '1.2.0');
}

protected getQueryString(): string {
Expand Down
2 changes: 1 addition & 1 deletion src/modules/system.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { Symbols } from '../ioc/symbols';
import { BlocksModel } from '../models';
import { AppConfig, PeerHeaders } from '../types/genericTypes';

const rcRegExp = /[a-z]+$/;
const rcRegExp = /-?[a-z]+$/;

@injectable()
export class SystemModule implements ISystemModule {
Expand Down

0 comments on commit b91c16f

Please sign in to comment.