pool: lower timeouts
This commit is contained in:
parent
69f3e85e37
commit
762b53a011
@ -166,6 +166,8 @@ Peer.prototype.destroy = function destroy() {
|
||||
// Private APIs
|
||||
|
||||
Peer.prototype._write = function write(chunk) {
|
||||
if (!this.socket)
|
||||
return;
|
||||
if (NodeBuffer)
|
||||
this.socket.write(new NodeBuffer(chunk));
|
||||
else
|
||||
|
||||
@ -17,15 +17,15 @@ function Pool(options) {
|
||||
this.parallel = options.parallel || 2000;
|
||||
this.redundancy = 2;
|
||||
this.load = {
|
||||
timeout: options.loadTimeout || 10000,
|
||||
timeout: options.loadTimeout || 5000,
|
||||
window: options.loadWindow || 250,
|
||||
timer: null,
|
||||
lwm: options.lwm || this.parallel * 2,
|
||||
hwm: options.hwm || this.parallel * 8,
|
||||
hiReached: false
|
||||
};
|
||||
this.maxRetries = options.maxRetries || 300;
|
||||
this.requestTimeout = options.requestTimeout || 10000;
|
||||
this.maxRetries = options.maxRetries || 10;
|
||||
this.requestTimeout = options.requestTimeout || 5000;
|
||||
this.chain = new bcoin.chain();
|
||||
this.watchMap = {};
|
||||
this.bloom = new bcoin.bloom(8 * 1024,
|
||||
|
||||
@ -15,7 +15,7 @@ TXPool.prototype.add = function add(tx) {
|
||||
|
||||
// Do not add TX two times
|
||||
if (this._all[hash])
|
||||
return;
|
||||
return false;
|
||||
this._all[hash] = tx;
|
||||
|
||||
// Consume unspent money or add orphans
|
||||
@ -54,6 +54,8 @@ TXPool.prototype.add = function add(tx) {
|
||||
// Add input to orphan
|
||||
orphan.tx.input(tx, orphan.index);
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
TXPool.prototype.unspent = function unspent(wallet) {
|
||||
|
||||
@ -149,7 +149,7 @@ Wallet.prototype.sign = function sign(tx, type) {
|
||||
};
|
||||
|
||||
Wallet.prototype.addTX = function addTX(tx) {
|
||||
this.tx.add(tx);
|
||||
return this.tx.add(tx);
|
||||
};
|
||||
|
||||
Wallet.prototype.unspent = function unspent() {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user