Changeset View
Changeset View
Standalone View
Standalone View
chronik/chronik-bridge/src/ffi.rs
Show First 20 Lines • Show All 208 Lines • ▼ Show 20 Lines | unsafe extern "C++" { | ||||
) -> Result<UniquePtr<CBlock>>; | ) -> Result<UniquePtr<CBlock>>; | ||||
/// Load the CBlockUndo data of this CBlockIndex from the disk undo data | /// Load the CBlockUndo data of this CBlockIndex from the disk undo data | ||||
fn load_block_undo( | fn load_block_undo( | ||||
self: &ChronikBridge, | self: &ChronikBridge, | ||||
block_index: &CBlockIndex, | block_index: &CBlockIndex, | ||||
) -> Result<UniquePtr<CBlockUndo>>; | ) -> Result<UniquePtr<CBlockUndo>>; | ||||
/// Load the CTransaction and CTxUndo data from disk and turn it into a | |||||
/// bridged Tx, containing spent coins etc. | |||||
fn load_tx( | |||||
self: &ChronikBridge, | |||||
file_num: u32, | |||||
data_pos: u32, | |||||
undo_pos: u32, | |||||
) -> Result<Tx>; | |||||
/// Load the CTransaction from disk and serialize it. | |||||
fn load_raw_tx( | |||||
self: &ChronikBridge, | |||||
file_num: u32, | |||||
data_pos: u32, | |||||
) -> Result<Vec<u8>>; | |||||
/// Find at which block the given block_index forks off from the node. | /// Find at which block the given block_index forks off from the node. | ||||
fn find_fork( | fn find_fork( | ||||
self: &ChronikBridge, | self: &ChronikBridge, | ||||
block_index: &CBlockIndex, | block_index: &CBlockIndex, | ||||
) -> Result<&CBlockIndex>; | ) -> Result<&CBlockIndex>; | ||||
/// Lookup the spent coins of a tx and fill them in in-place. | /// Lookup the spent coins of a tx and fill them in in-place. | ||||
/// - `not_found` will be the outpoints that couldn't be found in the | /// - `not_found` will be the outpoints that couldn't be found in the | ||||
Show All 37 Lines | unsafe extern "C++" { | ||||
/// Bridge bitcoind's classes to the shared struct [`Block`]. | /// Bridge bitcoind's classes to the shared struct [`Block`]. | ||||
fn bridge_block( | fn bridge_block( | ||||
block: &CBlock, | block: &CBlock, | ||||
block_undo: &CBlockUndo, | block_undo: &CBlockUndo, | ||||
block_index: &CBlockIndex, | block_index: &CBlockIndex, | ||||
) -> Result<Block>; | ) -> Result<Block>; | ||||
/// Load the CTransaction and CTxUndo data from disk and turn it into a | |||||
/// bridged Tx, containing spent coins etc. | |||||
fn load_tx(file_num: u32, data_pos: u32, undo_pos: u32) -> Result<Tx>; | |||||
/// Load the CTransaction from disk and serialize it. | |||||
fn load_raw_tx(file_num: u32, data_pos: u32) -> Result<Vec<u8>>; | |||||
/// Get a BlockInfo for this CBlockIndex. | /// Get a BlockInfo for this CBlockIndex. | ||||
fn get_block_info(block_index: &CBlockIndex) -> BlockInfo; | fn get_block_info(block_index: &CBlockIndex) -> BlockInfo; | ||||
/// CBlockIndex::GetAncestor | /// CBlockIndex::GetAncestor | ||||
fn get_block_ancestor( | fn get_block_ancestor( | ||||
block_index: &CBlockIndex, | block_index: &CBlockIndex, | ||||
height: i32, | height: i32, | ||||
) -> Result<&CBlockIndex>; | ) -> Result<&CBlockIndex>; | ||||
▲ Show 20 Lines • Show All 46 Lines • Show Last 20 Lines |