-
Notifications
You must be signed in to change notification settings - Fork 646
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optimized address service mempool index size #352
Conversation
- Adds default to store a large portion of the mempool index in leveldb - Includes an option to use memdown to have the mempool index in-memory
Replaced with using `tx` and `txleave` to manage the state of the mempool indexes.
LGTM |
if (this.node.network === Networks.livenet) { | ||
this.mempoolIndexPath = this.node.datadir + '/bitcore-addressmempool.db'; | ||
} else if (this.node.network === Networks.testnet) { | ||
this.mempoolIndexPath = this.node.datadir + '/testnet3/bitcore-addressmempool.db'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would be nice not to have these prefixes hardcoded
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which prefixes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, instead of having to write this same code block multiple times, it could be DRY'ed up. Not a show stopper, we can clean it up later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The prefixes I was talking about were {livenet: '', testnet: 'testnet3', regtest: 'regtest'}
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since there is some shared code, it could be useful to have this.node.networks.getBaseDataDir()
or at least a utility function on node, we can spawn an issue and add it in later, since this should also touch the db.js
code.
LGTM |
Optimized address service mempool index size
Closes #324
New features:
mempoolSpentIndex
has been kept to be memory only and the key will be 37 bytestx
andtxleave
events from bitcoind and will nolonger make an expensive query for all transactions in the mempoolIncludes breaking API changes:
resetMempoolIndex
method have been removedrunAllMempoolIndexes
has been removed