peer: error on finishDrain.

This commit is contained in:
Christopher Jeffrey 2016-11-27 16:09:23 -08:00
parent 89f86ae6c5
commit 7fd2c409ae
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD

View File

@ -857,7 +857,7 @@ Peer.prototype.maybeStall = function maybeStall() {
if (util.now() < this.drainStart + 10)
return false;
this.finishDrain();
this.finishDrain(new Error('Peer stalled.'));
this.error('Peer stalled.');
return true;
@ -885,7 +885,7 @@ Peer.prototype.finishDrain = function finishDrain(err) {
* @returns {Promise}
*/
Peer.prototype.trySend = function send(packet) {
Peer.prototype.trySend = function trySend(packet) {
return this.send(packet).catch(util.nop);
};