aboutsummaryrefslogtreecommitdiff
path: root/src/rpcmining.cpp
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2012-07-06 16:33:34 +0200
committerPieter Wuille <pieter.wuille@gmail.com>2012-10-20 23:08:57 +0200
commitae8bfd12daa802d20791e69d3477e799d2b99f45 (patch)
tree848867135da5954b7155ebe98c09db66d09d5737 /src/rpcmining.cpp
parent450cbb0944cd20a06ce806e6679a1f4c83c50db2 (diff)
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.
Diffstat (limited to 'src/rpcmining.cpp')
-rw-r--r--src/rpcmining.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/rpcmining.cpp b/src/rpcmining.cpp
index 96518c6d8c..0270b5f102 100644
--- a/src/rpcmining.cpp
+++ b/src/rpcmining.cpp
@@ -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();