misc. fix rejects filter additions.

This commit is contained in:
Christopher Jeffrey 2016-07-12 15:34:41 -07:00
parent 4a8768bcd2
commit a6dc5a08c8
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD
5 changed files with 8 additions and 5 deletions

View File

@ -131,7 +131,9 @@ function Fullnode(options) {
key: this.options.sslKey,
cert: this.options.sslCert,
port: this.options.httpPort || this.network.rpcPort,
host: this.options.httpHost || '0.0.0.0'
host: this.options.httpHost || '0.0.0.0',
apiKey: this.options.apiKey,
auth: this.options.auth
});
}

View File

@ -36,7 +36,7 @@ function HTTPClient(options) {
this.options = options;
this.network = bcoin.network.get(options.network);
this.uri = options.uri;
this.uri = options.uri || 'localhost:' + this.network.rpcPort;
this.id = null;
this.socket = null;

View File

@ -1824,8 +1824,6 @@ Peer.prototype.sendReject = function sendReject(code, reason, obj) {
if (obj) {
this.logger.debug('Rejecting %s %s (%s): ccode=%s reason=%s.',
reject.message, obj.rhash, this.hostname, code, reason);
this.pool.rejects.add(obj.hash());
} else {
this.logger.debug('Rejecting packet from %s: ccode=%s reason=%s.',
this.hostname, code, reason);

View File

@ -696,6 +696,7 @@ Pool.prototype._handleHeaders = function _handleHeaders(headers, peer, callback)
if (!header.verify(ret)) {
peer.reject(header, 'invalid', ret.reason, 100);
self.rejects.add(header.hash());
return next(new Error('Invalid header.'));
}

View File

@ -79,7 +79,9 @@ function SPVNode(options) {
key: this.options.sslKey,
cert: this.options.sslCert,
port: this.options.httpPort || this.network.rpcPort,
host: '0.0.0.0'
host: this.options.httpHost || '0.0.0.0',
apiKey: this.options.apiKey,
auth: this.options.auth
});
}