aboutsummaryrefslogtreecommitdiff
path: root/src/txdb.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2016-05-06 10:02:57 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2016-05-06 10:03:09 +0200
commitefee32f38110965435c884a6bcf0f83695c4c75b (patch)
treee1b985b21a579b5cd4d52b7a4c4586dbf1496b6c /src/txdb.cpp
parent006cdf64dc93239c05202b1a81d538ecda1e6c2a (diff)
parent99e70751f23aa59ac297f6746dd8f09a140d48ae (diff)
downloadbitcoin-efee32f38110965435c884a6bcf0f83695c4c75b.tar.xz
Merge #7815: Break circular dependency main ↔ txdb
99e7075 Break circular dependency main ↔ txdb (Wladimir J. van der Laan)
Diffstat (limited to 'src/txdb.cpp')
-rw-r--r--src/txdb.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/txdb.cpp b/src/txdb.cpp
index 5fbaeb608a..078c29def3 100644
--- a/src/txdb.cpp
+++ b/src/txdb.cpp
@@ -5,10 +5,8 @@
#include "txdb.h"
-#include "chain.h"
#include "chainparams.h"
#include "hash.h"
-#include "main.h"
#include "pow.h"
#include "uint256.h"
@@ -173,7 +171,7 @@ bool CBlockTreeDB::ReadFlag(const std::string &name, bool &fValue) {
return true;
}
-bool CBlockTreeDB::LoadBlockIndexGuts()
+bool CBlockTreeDB::LoadBlockIndexGuts(boost::function<CBlockIndex*(const uint256&)> insertBlockIndex)
{
boost::scoped_ptr<CDBIterator> pcursor(NewIterator());
@@ -187,8 +185,8 @@ bool CBlockTreeDB::LoadBlockIndexGuts()
CDiskBlockIndex diskindex;
if (pcursor->GetValue(diskindex)) {
// Construct block index object
- CBlockIndex* pindexNew = InsertBlockIndex(diskindex.GetBlockHash());
- pindexNew->pprev = InsertBlockIndex(diskindex.hashPrev);
+ CBlockIndex* pindexNew = insertBlockIndex(diskindex.GetBlockHash());
+ pindexNew->pprev = insertBlockIndex(diskindex.hashPrev);
pindexNew->nHeight = diskindex.nHeight;
pindexNew->nFile = diskindex.nFile;
pindexNew->nDataPos = diskindex.nDataPos;