mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-13 12:33:42 +02:00
Batch block connection during IBD
During the initial block download (or -loadblock), delay connection of new blocks a bit, and perform them in a single action. This reduces the load on the database engine, as subsequent blocks often update an earlier block's transaction already.
This commit is contained in:
parent
450cbb0944
commit
ae8bfd12da
10 changed files with 183 additions and 171 deletions
|
|
@ -281,9 +281,7 @@ Value getblocktemplate(const Array& params, bool fHelp)
|
|||
Array transactions;
|
||||
map<uint256, int64_t> setTxIndex;
|
||||
int i = 0;
|
||||
CCoinsDB coindb("r");
|
||||
CCoinsViewDB viewdb(coindb);
|
||||
CCoinsViewCache view(viewdb);
|
||||
CCoinsViewCache &view = *pcoinsTip;
|
||||
BOOST_FOREACH (CTransaction& tx, pblock->vtx)
|
||||
{
|
||||
uint256 txHash = tx.GetHash();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue