diff --git a/lib/mempool/mempool.js b/lib/mempool/mempool.js index 4ae38da87..da5b2f492 100644 --- a/lib/mempool/mempool.js +++ b/lib/mempool/mempool.js @@ -1759,13 +1759,16 @@ class Mempool extends EventEmitter { getConflicts(tx) { const conflicts = []; + const hashes = new BufferSet(); for (const {prevout} of tx.inputs) { const {hash, index} = prevout; const conflict = this.getSpent(hash, index); - if (conflict && conflicts.indexOf(conflict) === -1) + if (conflict && !hashes.has(hash)) { + hashes.add(hash); conflicts.push(conflict); + } } return conflicts;