Browse Source

Connection: default value for sendGetBlocks

patch-2
olalonde 11 years ago
parent
commit
9d53ef5106
  1. 7
      Connection.js

7
Connection.js

@ -186,10 +186,15 @@ Connection.prototype.sendVersion = function () {
};
Connection.prototype.sendGetBlocks = function (starts, stop, wantHeaders) {
// Default value for stop is 0 to get as many blocks as possible (500)
stop = stop || '00000000000000000000000000000000';
var put = new Put();
put.word32le(this.sendVer);
// https://en.bitcoin.it/wiki/Protocol_specification#getblocks
put.word32le(this.sendVer);
put.varint(starts.length);
for (var i = 0; i < starts.length; i++) {
if (starts[i].length != 32) {
throw new Error('Invalid hash length');

Loading…
Cancel
Save