Skip to content

Commit

Permalink
mempool: add/fix comments
Browse files Browse the repository at this point in the history
  • Loading branch information
pinheadmz committed Jan 5, 2023
1 parent ae6d510 commit 8b8a7d8
Showing 1 changed file with 20 additions and 11 deletions.
31 changes: 20 additions & 11 deletions lib/mempool/mempool.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,20 +78,29 @@ class Mempool extends EventEmitter {
this.tip = this.network.genesis.hash;
this.nextState = this.chain.state;

this.waiting = new BufferMap();
this.orphans = new BufferMap();
this.map = new BufferMap();
this.spents = new BufferMap();
this.claims = new BufferMap();
this.airdrops = new BufferMap();
this.airdropIndex = new Map();
this.claimNames = new BufferMap();
// "The" mempool
this.map = new BufferMap(); // hash -> MempoolEntry
this.claims = new BufferMap(); // hash -> ClaimEntry
this.airdrops = new BufferMap(); // hash -> AirdropEntry

// Orphans and missing parents
this.waiting = new BufferMap(); // parent hash -> BufferSet[spender hashes]
this.orphans = new BufferMap(); // orphan tx hash -> Orphan

// Prevent double-spends
this.spents = new BufferMap(); // prevout key -> MempoolEntry of spender
this.claimNames = new BufferMap(); // namehash -> ClaimEntry
this.airdropIndex = new Map(); // airdrop position -> AirdropEntry

// Track namestates to validate incoming covenants
this.contracts = new ContractState(this.network);

// Recently rejected txs by hash
this.rejects = new RollingFilter(120000, 0.000001);

// Extensions of blockchain indexes by tx hash for API
this.coinIndex = new CoinIndex();
this.txIndex = new TXIndex();

this.contracts = new ContractState(this.network);
}

/**
Expand Down Expand Up @@ -3123,7 +3132,7 @@ class Orphan {
* Create an orphan.
* @constructor
* @param {TX} tx
* @param {Hash[]} missing
* @param {Number} missing
* @param {Number} id
*/

Expand Down

0 comments on commit 8b8a7d8

Please sign in to comment.