|
|
@ -1,24 +1,23 @@ |
|
|
|
require('classtool'); |
|
|
|
var imports = require('soop').imports(); |
|
|
|
|
|
|
|
function spec(b) { |
|
|
|
var config = b.config || require('./config'); |
|
|
|
var log = b.log || require('./util/log'); |
|
|
|
var network = b.network || require('./networks')[config.network]; |
|
|
|
var config = imports.config || require('./config'); |
|
|
|
var log = imports.log || require('./util/log'); |
|
|
|
var network = imports.network || require('./networks')[config.network]; |
|
|
|
|
|
|
|
var MAX_RECEIVE_BUFFER = 10000000; |
|
|
|
var PROTOCOL_VERSION = 70000; |
|
|
|
|
|
|
|
var Binary = b.Binary || require('binary'); |
|
|
|
var Put = b.Put || require('bufferput'); |
|
|
|
var Buffers = b.Buffers || require('buffers'); |
|
|
|
var Binary = imports.Binary || require('binary'); |
|
|
|
var Put = imports.Put || require('bufferput'); |
|
|
|
var Buffers = imports.Buffers || require('buffers'); |
|
|
|
require('./Buffers.monkey').patch(Buffers); |
|
|
|
var noop = function() {}; |
|
|
|
var Block = require('./Block').class(); |
|
|
|
var Transaction = require('./Transaction').class(); |
|
|
|
var util = b.util || require('./util/util'); |
|
|
|
var Parser = b.Parser || require('./util/BinaryParser').class(); |
|
|
|
var buffertools = b.buffertools || require('buffertools'); |
|
|
|
var doubleSha256 = b.doubleSha256 || util.twoSha256; |
|
|
|
|
|
|
|
var Block = require('./Block'); |
|
|
|
var Transaction = require('./Transaction'); |
|
|
|
var util = imports.util || require('./util/util'); |
|
|
|
var Parser = imports.Parser || require('./util/BinaryParser'); |
|
|
|
var buffertools = imports.buffertools || require('buffertools'); |
|
|
|
var doubleSha256 = imports.doubleSha256 || util.twoSha256; |
|
|
|
var nonce = util.generateNonce(); |
|
|
|
|
|
|
|
var BIP0031_VERSION = 60000; |
|
|
@ -53,7 +52,7 @@ function spec(b) { |
|
|
|
|
|
|
|
this.setupHandlers(); |
|
|
|
} |
|
|
|
Connection.superclass = b.superclass || require('events').EventEmitter; |
|
|
|
Connection.parent = imports.parent || require('events').EventEmitter; |
|
|
|
|
|
|
|
Connection.prototype.setupHandlers = function () { |
|
|
|
this.socket.addListener('connect', this.handleConnect.bind(this)); |
|
|
@ -542,6 +541,4 @@ function spec(b) { |
|
|
|
return data; |
|
|
|
}; |
|
|
|
|
|
|
|
return Connection; |
|
|
|
}; |
|
|
|
module.defineClass(spec); |
|
|
|
module.exports = require('soop')(Connection); |
|
|
|