|
Electroneum
|
#include <MicroCore.h>

Public Member Functions | |
| MicroCore () | |
| bool | init (const string &_blockchain_path, bool testnet=false) |
| Blockchain & | get_core () |
| bool | get_block_by_height (const uint64_t &height, block &blk) |
| bool | get_tx (const crypto::hash &tx_hash, transaction &tx) |
| bool | get_tx (const string &tx_hash, transaction &tx) |
| bool | find_output_in_tx (const transaction &tx, const public_key &output_pubkey, tx_out &out, size_t &output_index) |
| bool | get_tx_hash_from_output_pubkey (const public_key &output_pubkey, const uint64_t &block_height, crypto::hash &tx_hash, transaction &tx_found) |
| uint64_t | get_blk_timestamp (uint64_t blk_height) |
| string | get_blkchain_path () |
| virtual | ~MicroCore () |
Private Attributes | |
| string | blockchain_path |
| tx_memory_pool | m_mempool |
| Blockchain | m_blockchain_storage |
Micro version of cryptonode::core class Micro version of constructor, init and destructor are implemted.
Just enough to read the blockchain database for use in the example.
| etneg::MicroCore::MicroCore | ( | ) |
The constructor is interesting, as m_mempool and m_blockchain_storage depend on each other.
So basically m_mempool is initialized with reference to Blockchain (i.e., Blockchain&) and m_blockchain_storage is initialized with reference to m_mempool (i.e., tx_memory_pool&)
The same is done in cryptonode::core.
|
virtual |
De-initialized Blockchain.
since blockchain is opened as MDB_RDONLY need to manually free memory taken on heap by BlockchainLMDB
| bool etneg::MicroCore::find_output_in_tx | ( | const transaction & | tx, |
| const public_key & | output_pubkey, | ||
| tx_out & | out, | ||
| size_t & | output_index | ||
| ) |
Find output with given public key in a given transaction
| uint64_t etneg::MicroCore::get_blk_timestamp | ( | uint64_t | blk_height | ) |
| string etneg::MicroCore::get_blkchain_path | ( | ) |
Get block by its height
returns true if success
| Blockchain & etneg::MicroCore::get_core | ( | ) |
Get m_blockchain_storage. Initialize m_blockchain_storage with the BlockchainLMDB object.
| bool etneg::MicroCore::get_tx | ( | const crypto::hash & | tx_hash, |
| transaction & | tx | ||
| ) |
Get transaction tx from the blockchain using it hash
| bool etneg::MicroCore::get_tx | ( | const string & | tx_hash, |
| transaction & | tx | ||
| ) |
| bool etneg::MicroCore::get_tx_hash_from_output_pubkey | ( | const public_key & | output_pubkey, |
| const uint64_t & | block_height, | ||
| crypto::hash & | tx_hash, | ||
| cryptonote::transaction & | tx_found | ||
| ) |
Returns tx hash in a given block which contains given output's public key
Initialized the MicroCore object.
Create BlockchainLMDB on the heap. Open database files located in blockchain_path. Initialize m_blockchain_storage with the BlockchainLMDB object.
|
private |
|
private |
|
private |
1.8.14