Update version

This commit is contained in:
Esteban Ordano 2015-01-20 11:08:16 -03:00
parent 333fb4f787
commit 74b7571517
2 changed files with 3 additions and 2 deletions

View File

@ -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

View File

@ -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);