Update peer.js

Added documentation for relay transaction flag.
This commit is contained in:
Matthew Little 2014-02-22 19:28:02 -07:00
parent 9bb998dc19
commit 0a6f05a067

View File

@ -19,6 +19,8 @@ var Peer = module.exports = function(options){
var emptyNetAddress = new Buffer('010000000000000000000000000000000000ffff000000000000', 'hex');
var userAgent = util.varStringBuffer('/node-stratum/');
var blockStartHeight = new Buffer('00000000', 'hex'); //block start_height, can be empty
//If protocol version is new enough, add do not relay transactions flag byte, outlined in BIP37
//https://github.com/bitcoin/bips/blob/master/bip-0037.mediawiki#extensions-to-existing-messages
var relayTransactions = options.protocolVersion >= 70001 ? new Buffer([false]) : new Buffer([]);
//Command strings found at: https://en.bitcoin.it/wiki/Protocol_specification
@ -160,4 +162,4 @@ var Peer = module.exports = function(options){
};
Peer.prototype.__proto__ = events.EventEmitter.prototype;
Peer.prototype.__proto__ = events.EventEmitter.prototype;