aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_core/blockchain_db.h
diff options
context:
space:
mode:
authorThomas Winget <tewinget@gmail.com>2014-10-23 15:37:10 -0400
committerwarptangent <warptangent@inbox.com>2015-01-04 19:01:10 -0800
commitdb00ce0173f49ef9e1d07019b803155c9d4fe945 (patch)
tree85832eac48117bb0b697b7d868de6119270210f0 /src/cryptonote_core/blockchain_db.h
parentBlockchainDB unit tests, lmdb linker flag (diff)
downloadmonero-db00ce0173f49ef9e1d07019b803155c9d4fe945.tar.xz
Parts of LMDB impl of BlockchainDB done and working
The rest should just be tedious copypasta and modification.
Diffstat (limited to 'src/cryptonote_core/blockchain_db.h')
-rw-r--r--src/cryptonote_core/blockchain_db.h18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/cryptonote_core/blockchain_db.h b/src/cryptonote_core/blockchain_db.h
index 251f9272b..b3c73a0d8 100644
--- a/src/cryptonote_core/blockchain_db.h
+++ b/src/cryptonote_core/blockchain_db.h
@@ -332,8 +332,8 @@ private:
, const uint64_t& coins_generated
) = 0;
- // tells the subclass to remove data about a block
- virtual void remove_block(const crypto::hash& blk_hash) = 0;
+ // tells the subclass to remove data about the top block
+ virtual void remove_block() = 0;
// tells the subclass to store the transaction and its metadata
virtual void add_transaction_data(const crypto::hash& blk_hash, const transaction& tx) = 0;
@@ -403,12 +403,14 @@ public:
// adds a block with the given metadata to the top of the blockchain, returns the new height
- uint64_t add_block( const block& blk
- , const size_t& block_size
- , const difficulty_type& cumulative_difficulty
- , const uint64_t& coins_generated
- , const std::vector<transaction>& txs
- );
+ // NOTE: subclass implementations of this (or the functions it calls) need
+ // to handle undoing any partially-added blocks in the event of a failure.
+ virtual uint64_t add_block( const block& blk
+ , const size_t& block_size
+ , const difficulty_type& cumulative_difficulty
+ , const uint64_t& coins_generated
+ , const std::vector<transaction>& txs
+ );
// return true if a block with hash <h> exists in the blockchain
virtual bool block_exists(const crypto::hash& h) = 0;