From 74b7571517e522bed2a71a9e2c468695e9432fc0 Mon Sep 17 00:00:00 2001 From: Esteban Ordano Date: Tue, 20 Jan 2015 11:08:16 -0300 Subject: [PATCH] Update version --- docs/messages.md | 2 +- lib/messages.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/messages.md b/docs/messages.md index 0f757ed..550ebee 100644 --- a/docs/messages.md +++ b/docs/messages.md @@ -9,7 +9,7 @@ The bitcoin protocol specifies a set of [messages](https://en.bitcoin.it/wiki/Pr ### Version -The version message (`ver`) is used on connection creation, to advertise the type of node. The remote node will respond with its version, and no communication is possible until both peers have exchanged their versions. By default, bitcore advertises itself as named `bitcore:0.8`. +The version message (`ver`) is used on connection creation, to advertise the type of node. The remote node will respond with its version, and no communication is possible until both peers have exchanged their versions. By default, bitcore advertises itself as named `bitcore` with the current version of the `bitcore-p2p` package. ### VerAck diff --git a/lib/messages.js b/lib/messages.js index 6d55a03..2e704bd 100644 --- a/lib/messages.js +++ b/lib/messages.js @@ -172,9 +172,10 @@ module.exports.Message = Message; * @param{Buffer} nonce - a random 8 bytes buffer */ function Version(subversion, nonce) { + var packageInfo = require('../package.json'); this.command = 'version'; this.version = PROTOCOL_VERSION; - this.subversion = subversion || '/bitcore:0.8/'; + this.subversion = subversion || '/bitcore:' + packageInfo.version + '/'; this.nonce = nonce || CONNECTION_NONCE; } util.inherits(Version, Message);