aboutsummaryrefslogtreecommitdiff
path: root/src/blockchain_db/berkeleydb/db_bdb.cpp
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2016-09-01 11:29:22 +0200
committerRiccardo Spagni <ric@spagni.net>2016-09-01 11:29:22 +0200
commitd3994f1df0bf9a842e6fd58a87928cc73b07c91d (patch)
treef70094f1b2f1c83c45c64a4bfca90c6e8ef1e3ad /src/blockchain_db/berkeleydb/db_bdb.cpp
parentMerge pull request #1016 (diff)
parentcore: faster find_blockchain_supplement (diff)
downloadmonero-d3994f1df0bf9a842e6fd58a87928cc73b07c91d.tar.xz
Merge pull request #1018
6cf8ca2 core: faster find_blockchain_supplement (moneromooo-monero)
Diffstat (limited to 'src/blockchain_db/berkeleydb/db_bdb.cpp')
-rw-r--r--src/blockchain_db/berkeleydb/db_bdb.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/blockchain_db/berkeleydb/db_bdb.cpp b/src/blockchain_db/berkeleydb/db_bdb.cpp
index 4ec284e38..137ed9dc6 100644
--- a/src/blockchain_db/berkeleydb/db_bdb.cpp
+++ b/src/blockchain_db/berkeleydb/db_bdb.cpp
@@ -1235,7 +1235,7 @@ void BlockchainBDB::unlock()
check_open();
}
-bool BlockchainBDB::block_exists(const crypto::hash& h) const
+bool BlockchainBDB::block_exists(const crypto::hash& h, uint64_t *height) const
{
LOG_PRINT_L3("BlockchainBDB::" << __func__);
check_open();
@@ -1251,6 +1251,9 @@ bool BlockchainBDB::block_exists(const crypto::hash& h) const
else if (get_result)
throw0(DB_ERROR("DB error attempting to fetch block index from hash"));
+ if (height)
+ *height = get_result - 1;
+
return true;
}