Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
Refactor mempool.dat to be extensible, and store missing info #9422
Conversation
fanquake
added
the
Mempool
label
Dec 26, 2016
luke-jr
referenced this pull request
Dec 26, 2016
Open
RPC: sendrawtransaction: Allow the user to ignore/override specific rejections #7533
| @@ -4027,7 +4027,7 @@ int VersionBitsTipStateSinceHeight(const Consensus::Params& params, Consensus::D | ||
| return VersionBitsStateSinceHeight(chainActive.Tip(), params, pos, versionbitscache); | ||
| } | ||
| -static const uint64_t MEMPOOL_DUMP_VERSION = 1; | ||
| +static const uint64_t MEMPOOL_DUMP_VERSION = 2; |
|
Needs rebase. |
| @@ -4027,7 +4027,7 @@ int VersionBitsTipStateSinceHeight(const Consensus::Params& params, Consensus::D | ||
| return VersionBitsStateSinceHeight(chainActive.Tip(), params, pos, versionbitscache); | ||
| } | ||
| -static const uint64_t MEMPOOL_DUMP_VERSION = 1; | ||
| +static const uint64_t MEMPOOL_DUMP_VERSION = 2; |
| + | ||
| + it = mapData.find("deltas"); | ||
| + if (it == mapData.end()) { | ||
| + try { |
sipa
Jan 10, 2017
Owner
Can't this try block be made to enclose all deserialization operations, so that the catch and error reporting can be written only once?
| @@ -4092,24 +4113,43 @@ bool LoadMempool(void) | ||
| return true; | ||
| } | ||
| +template <class T> | ||
| +std::vector<unsigned char> SerializeToVector(T o) { | ||
| + CDataStream ss(SER_NETWORK, PROTOCOL_VERSION); |
sipa
Jan 10, 2017
Owner
SER_DISK / CLIENT_VERSION? I doubt it matters for anything, but better be consistent for now.
|
Fixed serialisation params. There are conflicts now - may I rebase? |
|
Rebased. |
| @@ -4192,42 +4192,63 @@ bool LoadMempool(void) | ||
| if (version != MEMPOOL_DUMP_VERSION) { |
kallewoof
Feb 10, 2017
•
Member
The implications seem to be minor, but this means all bitcoin nodes prior to this PR being merged will drop all their mempools on startup. Is that okay? Would it be possible / worth it to load version=1 mempools too? Above comment by @sipa seems to indicate this was never used, in which case I think we should simply say MEMPOOL_DUMP_VERSION = 1 above.
luke-jr
added some commits
Dec 25, 2016
TheBlueMatt
reviewed
Nov 10, 2017
I'm not actually sure we want to save mempoolminfee - if you just restarted the practical mempoolminfee on the network may be much lower....it puts you in a state of downloading lots of transactions only pretty briefly (assuming any of your peers aren't limiting their mempool, which they almost always are, so mempoolminfee on most nodes never actually leaves 0 anyway). Probably not worth a incompatible version just for this, IMO, though if we had other things we wanted to store we could revisit.
luke-jr commentedDec 25, 2016
Should fix #9103