diff --git a/lib/blockchain/common.js b/lib/blockchain/common.js index ca5f1eff..efb0ce55 100644 --- a/lib/blockchain/common.js +++ b/lib/blockchain/common.js @@ -62,7 +62,7 @@ exports.thresholdStates = { exports.flags = { VERIFY_NONE: 0, VERIFY_POW: 1 << 0, - VERIFY_BODY: 1 << 1, + VERIFY_BODY: 1 << 1 }; /** diff --git a/lib/mining/minerblock.js b/lib/mining/minerblock.js index a577857a..3eec53df 100644 --- a/lib/mining/minerblock.js +++ b/lib/mining/minerblock.js @@ -353,11 +353,12 @@ MinerBlock.prototype.extraNonce = function extraNonce() { */ MinerBlock.prototype.addTX = function addTX(tx, view) { + var hash = tx.hash('hex'); var item, weight, sigops; assert(!tx.mutable, 'Cannot add mutable TX to block.'); - if (this.block.hasTX(tx)) + if (this.block.hasTX(hash)) return false; item = BlockEntry.fromTX(tx, view, this); diff --git a/lib/net/pool.js b/lib/net/pool.js index a4f207c0..84fbf5f9 100644 --- a/lib/net/pool.js +++ b/lib/net/pool.js @@ -2153,7 +2153,7 @@ Pool.prototype._handleTX = co(function* handleTX(peer, packet) { if (peer.merkleBlock) { assert(peer.merkleMatches > 0); - if (peer.merkleBlock.hasTX(tx)) { + if (peer.merkleBlock.hasTX(hash)) { peer.merkleBlock.addTX(tx); if (--peer.merkleMatches === 0) { yield this._addBlock(peer, peer.merkleBlock, flags);