aboutsummaryrefslogtreecommitdiff
path: root/src/blockchain_db
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2019-10-08 15:55:03 -0500
committerluigi1111 <luigi1111w@gmail.com>2019-10-08 15:55:03 -0500
commitbf525793c724f62d4716aaca59345ba2e13a2c3c (patch)
treead7ea60c6faf8ca103a686529fc1c716e272a9a5 /src/blockchain_db
parentMerge pull request #5960 (diff)
parentmonerod can now sync from pruned blocks (diff)
downloadmonero-bf525793c724f62d4716aaca59345ba2e13a2c3c.tar.xz
Merge pull request #5915
8330e77 monerod can now sync from pruned blocks (moneromooo-monero)
Diffstat (limited to 'src/blockchain_db')
-rw-r--r--src/blockchain_db/blockchain_db.h3
-rw-r--r--src/blockchain_db/lmdb/db_lmdb.cpp6
2 files changed, 6 insertions, 3 deletions
diff --git a/src/blockchain_db/blockchain_db.h b/src/blockchain_db/blockchain_db.h
index 8a6695cd8..d1e4919be 100644
--- a/src/blockchain_db/blockchain_db.h
+++ b/src/blockchain_db/blockchain_db.h
@@ -155,7 +155,8 @@ struct txpool_tx_meta_t
uint8_t relayed;
uint8_t do_not_relay;
uint8_t double_spend_seen: 1;
- uint8_t bf_padding: 7;
+ uint8_t pruned: 1;
+ uint8_t bf_padding: 6;
uint8_t padding[76]; // till 192 bytes
};
diff --git a/src/blockchain_db/lmdb/db_lmdb.cpp b/src/blockchain_db/lmdb/db_lmdb.cpp
index 760e380a9..8e2b5bebf 100644
--- a/src/blockchain_db/lmdb/db_lmdb.cpp
+++ b/src/blockchain_db/lmdb/db_lmdb.cpp
@@ -2056,7 +2056,7 @@ bool BlockchainLMDB::prune_worker(int mode, uint32_t pruning_seed)
++n_prunable_records;
result = mdb_cursor_get(c_txs_prunable, &k, &v, MDB_SET);
if (result == MDB_NOTFOUND)
- MWARNING("Already pruned at height " << block_height << "/" << blockchain_height);
+ MDEBUG("Already pruned at height " << block_height << "/" << blockchain_height);
else if (result)
throw0(DB_ERROR(lmdb_error("Failed to find transaction prunable data: ", result).c_str()));
else
@@ -2152,7 +2152,7 @@ bool BlockchainLMDB::prune_worker(int mode, uint32_t pruning_seed)
{
++n_prunable_records;
if (result == MDB_NOTFOUND)
- MWARNING("Already pruned at height " << block_height << "/" << blockchain_height);
+ MDEBUG("Already pruned at height " << block_height << "/" << blockchain_height);
else
{
MDEBUG("Pruning at height " << block_height << "/" << blockchain_height);
@@ -2994,6 +2994,8 @@ bool BlockchainLMDB::get_tx_blob(const crypto::hash& h, cryptonote::blobdata &bd
return false;
else if (get_result)
throw0(DB_ERROR(lmdb_error("DB error attempting to fetch tx from hash", get_result).c_str()));
+ else if (result1.mv_size == 0)
+ return false;
bd.assign(reinterpret_cast<char*>(result0.mv_data), result0.mv_size);
bd.append(reinterpret_cast<char*>(result1.mv_data), result1.mv_size);