From 0a6f05a067bb205403b8faaa4c4e3585f0bbbf85 Mon Sep 17 00:00:00 2001 From: Matthew Little Date: Sat, 22 Feb 2014 19:28:02 -0700 Subject: [PATCH] Update peer.js Added documentation for relay transaction flag. --- lib/peer.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/peer.js b/lib/peer.js index fca80d0..4e20b44 100644 --- a/lib/peer.js +++ b/lib/peer.js @@ -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; \ No newline at end of file +Peer.prototype.__proto__ = events.EventEmitter.prototype;