Skip to content

Commit

Permalink
test: mempool trigger handleReorg() every removeBlock()
Browse files Browse the repository at this point in the history
  • Loading branch information
pinheadmz committed Jan 1, 2020
1 parent e470007 commit 74267ea
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/mempool-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,7 @@ describe('Mempool', function() {

// Unconfirm block into mempool
await mempool._removeBlock(entry2, block2.txs);
await mempool._handleReorg();

// Mempool should contain both TXs
assert(mempool.hasEntry(tx2.hash()));
Expand Down Expand Up @@ -649,6 +650,7 @@ describe('Mempool', function() {
// Now the block gets disconnected
await chain.disconnect(entry3);
await mempool._removeBlock(entry3, block3.txs);
await mempool._handleReorg();

// Coinbase spend is back in the mempool
assert.strictEqual(mempool.map.size, 1);
Expand Down Expand Up @@ -725,6 +727,7 @@ describe('Mempool', function() {
// Now the block gets disconnected
await chain.disconnect(entry2);
await mempool._removeBlock(entry2, block2.txs);
await mempool._handleReorg();

// Spend is back in the mempool
assert.strictEqual(mempool.map.size, 1);
Expand Down Expand Up @@ -860,6 +863,7 @@ describe('Mempool', function() {
// Now the block gets disconnected
await chain.disconnect(entry3);
await mempool._removeBlock(entry3, block3.txs);
await mempool._handleReorg();

// Bid is back in the mempool
assert.strictEqual(mempool.map.size, 1);
Expand Down

0 comments on commit 74267ea

Please sign in to comment.