diff --git a/src/blockchain_db/blockchain_db.cpp b/src/blockchain_db/blockchain_db.cpp index dcbb2e2de..b090ac57f 100644 --- a/src/blockchain_db/blockchain_db.cpp +++ b/src/blockchain_db/blockchain_db.cpp @@ -320,6 +320,11 @@ void BlockchainDB::remove_transaction(const crypto::hash& tx_hash) remove_transaction_data(tx_hash, tx); } +void BlockchainDB::revert_transaction(const crypto::hash &tx_hash) +{ + remove_transaction(tx_hash); +} + block BlockchainDB::get_block_from_height(const uint64_t& height) const { blobdata bd = get_block_blob_from_height(height); diff --git a/src/blockchain_db/blockchain_db.h b/src/blockchain_db/blockchain_db.h index 0492e31ba..a07ebc29c 100644 --- a/src/blockchain_db/blockchain_db.h +++ b/src/blockchain_db/blockchain_db.h @@ -39,6 +39,7 @@ #include #include #include +#include #include "common/command_line.h" #include "crypto/hash.h" #include "cryptonote_basic/blobdatatype.h" @@ -1185,6 +1186,17 @@ namespace cryptonote virtual uint64_t height() const = 0; + // helper function to remove transaction from blockchain + /** + * @brief helper function to remove transaction from the blockchain + * + * This function encapsulates aspects of removing a transaction. + * + * @param tx_hash the hash of the transaction to be removed + */ + void revert_transaction(const crypto::hash &tx_hash); + + /** *