Skip to content

Commit 98bac88

Browse files
committed
Merge branch 'release/0.3.16-beta'
2 parents 00926aa + 9ddb9fb commit 98bac88

File tree

4 files changed

+16
-11
lines changed

4 files changed

+16
-11
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
66

77
## [Unreleased]
88

9+
## [0.3.16] - 2018-01-09
10+
11+
### Changed
12+
- Fixed IRI TCP negotiation bug #5
13+
914
## [0.3.15] - 2018-01-09
1015

1116
### Changed

dist/node/node.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -537,14 +537,14 @@ var Node = function (_Base) {
537537
UDPPort = head.UDPPort,
538538
remoteKey = head.remoteKey,
539539
name = head.name,
540-
wishedProtocol = head.protocol;
540+
protocol = head.protocol;
541541

542-
var protocol = _this9._negotiateProtocol(wishedProtocol);
543-
_this9.list.update(peer, { port: port, nelsonID: nelsonID, TCPPort: TCPPort, UDPPort: UDPPort, remoteKey: remoteKey, name: name, protocol: protocol }).then(function () {
544-
if (protocol) {
542+
var IRIProtocol = _this9._negotiateProtocol(protocol);
543+
_this9.list.update(peer, { port: port, nelsonID: nelsonID, TCPPort: TCPPort, UDPPort: UDPPort, remoteKey: remoteKey, name: name, IRIProtocol: IRIProtocol }).then(function () {
544+
if (IRIProtocol) {
545545
_this9._ready && _this9.iri.addNeighbors([peer]);
546546
} else {
547-
_this9.log(('Couldn\'t negotiate protocol with ' + peer.data.hostname + ': my ' + _this9.opts.IRIProtocol + ' vs remote ' + wishedProtocol).yellow);
547+
_this9.log(('Couldn\'t negotiate protocol with ' + peer.data.hostname + ': my ' + _this9.opts.IRIProtocol + ' vs remote ' + IRIProtocol).yellow);
548548
removeNeighbor();
549549
}
550550
});

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nelson.cli",
3-
"version": "0.3.15",
3+
"version": "0.3.16",
44
"repository": {
55
"type": "git",
66
"url": "https://github.com/SemkoDev/nelson.cli.git"

src/node/node.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -399,13 +399,13 @@ class Node extends Base {
399399
this.log('!!', 'wrong headers received', head);
400400
return removeNeighbor();
401401
}
402-
const { port, nelsonID, TCPPort, UDPPort, remoteKey, name, protocol: wishedProtocol } = head;
403-
const protocol = this._negotiateProtocol(wishedProtocol);
404-
this.list.update(peer, { port, nelsonID, TCPPort, UDPPort, remoteKey, name, protocol }).then(() => {
405-
if (protocol) {
402+
const { port, nelsonID, TCPPort, UDPPort, remoteKey, name, protocol } = head;
403+
const IRIProtocol = this._negotiateProtocol(protocol);
404+
this.list.update(peer, { port, nelsonID, TCPPort, UDPPort, remoteKey, name, IRIProtocol }).then(() => {
405+
if (IRIProtocol) {
406406
this._ready && this.iri.addNeighbors([ peer ]);
407407
} else {
408-
this.log(`Couldn't negotiate protocol with ${peer.data.hostname}: my ${this.opts.IRIProtocol} vs remote ${wishedProtocol}`.yellow);
408+
this.log(`Couldn't negotiate protocol with ${peer.data.hostname}: my ${this.opts.IRIProtocol} vs remote ${IRIProtocol}`.yellow);
409409
removeNeighbor();
410410
}
411411
});

0 commit comments

Comments
 (0)