diff --git a/lib/bcoin/peer.js b/lib/bcoin/peer.js index d01807d0..11200615 100644 --- a/lib/bcoin/peer.js +++ b/lib/bcoin/peer.js @@ -1141,11 +1141,6 @@ Peer.prototype._handleGetUTXOs = function _handleGetUTXOs(payload) { var coin; if (self.mempool && payload.mempool) { - if (self.mempool.isSpent(hash, index)) { - hits.push(0); - return next(); - } - coin = self.mempool.getCoin(hash, index); if (coin) { @@ -1153,6 +1148,11 @@ Peer.prototype._handleGetUTXOs = function _handleGetUTXOs(payload) { coins.push(coin); return next(); } + + if (self.mempool.isSpent(hash, index)) { + hits.push(0); + return next(); + } } self.chain.db.getCoin(hash, index, function(err, coin) {