misc. fix rejects filter additions.
This commit is contained in:
parent
4a8768bcd2
commit
a6dc5a08c8
@ -131,7 +131,9 @@ function Fullnode(options) {
|
|||||||
key: this.options.sslKey,
|
key: this.options.sslKey,
|
||||||
cert: this.options.sslCert,
|
cert: this.options.sslCert,
|
||||||
port: this.options.httpPort || this.network.rpcPort,
|
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
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -36,7 +36,7 @@ function HTTPClient(options) {
|
|||||||
this.options = options;
|
this.options = options;
|
||||||
this.network = bcoin.network.get(options.network);
|
this.network = bcoin.network.get(options.network);
|
||||||
|
|
||||||
this.uri = options.uri;
|
this.uri = options.uri || 'localhost:' + this.network.rpcPort;
|
||||||
this.id = null;
|
this.id = null;
|
||||||
this.socket = null;
|
this.socket = null;
|
||||||
|
|
||||||
|
|||||||
@ -1824,8 +1824,6 @@ Peer.prototype.sendReject = function sendReject(code, reason, obj) {
|
|||||||
if (obj) {
|
if (obj) {
|
||||||
this.logger.debug('Rejecting %s %s (%s): ccode=%s reason=%s.',
|
this.logger.debug('Rejecting %s %s (%s): ccode=%s reason=%s.',
|
||||||
reject.message, obj.rhash, this.hostname, code, reason);
|
reject.message, obj.rhash, this.hostname, code, reason);
|
||||||
|
|
||||||
this.pool.rejects.add(obj.hash());
|
|
||||||
} else {
|
} else {
|
||||||
this.logger.debug('Rejecting packet from %s: ccode=%s reason=%s.',
|
this.logger.debug('Rejecting packet from %s: ccode=%s reason=%s.',
|
||||||
this.hostname, code, reason);
|
this.hostname, code, reason);
|
||||||
|
|||||||
@ -696,6 +696,7 @@ Pool.prototype._handleHeaders = function _handleHeaders(headers, peer, callback)
|
|||||||
|
|
||||||
if (!header.verify(ret)) {
|
if (!header.verify(ret)) {
|
||||||
peer.reject(header, 'invalid', ret.reason, 100);
|
peer.reject(header, 'invalid', ret.reason, 100);
|
||||||
|
self.rejects.add(header.hash());
|
||||||
return next(new Error('Invalid header.'));
|
return next(new Error('Invalid header.'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -79,7 +79,9 @@ function SPVNode(options) {
|
|||||||
key: this.options.sslKey,
|
key: this.options.sslKey,
|
||||||
cert: this.options.sslCert,
|
cert: this.options.sslCert,
|
||||||
port: this.options.httpPort || this.network.rpcPort,
|
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
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user