diff --git a/lib/net/peer.js b/lib/net/peer.js index 0e550c2a..cd1c695c 100644 --- a/lib/net/peer.js +++ b/lib/net/peer.js @@ -1352,6 +1352,9 @@ Peer.prototype.getItems = function getItems(type, hashes) { items.push(new InvItem(type, hash)); } + if (items.length === 0) + return; + this.getData(items); }; diff --git a/lib/net/pool.js b/lib/net/pool.js index cff0b695..7091bec4 100644 --- a/lib/net/pool.js +++ b/lib/net/pool.js @@ -1727,6 +1727,9 @@ Pool.prototype.getTX = function getTX(peer, hashes) { items.push(hash); } + if (items.length === 0) + return; + this.logger.debug( 'Requesting %d/%d txs from peer with getdata (%s).', items.length,