Store:
主要存储以下数据:
- 链数据(高度、拓扑高度,区块全排序,末端区块)
- 区块数据(区块)
- 交易数据(交易、交易所在区块高度,密钥镜像)
Store_Block_Topological_order
// stores a blocks topological order
Store_TX
// store a tx
// this only occurs when a tx has been mined or a a reorganisation is in progress
// stores a height to show at what height it has been mined
Store_TX_Height
// load height at which a specific tx was mined
Store_BL
// TODO the miner tx should be extracted ands stored from somewhere else
// NOTE: before storing a block, its transactions must be stored
Store_TOPO_HEIGHT
Store_TOP_HEIGHT
Store_KeyImage
store_TX_in_Block
store_TIPS
// store settle status within the block
// a blockid with stored with value 1 == it has been settled
// a blockid stored with value 0 == it has not been settled
// a blockid not found in store == it has NOT been settled
你让它存什么,它就存什么,不做任何与业务相关的判断。
Load:
Load_Block_Topological_order
Load_Block_Topological_order_at_index
Load_TX_Size
Load_TX_Height
Load_TX_FROM_ID
Load_BL_FROM_ID
Load_Height_for_BL_ID
Load_Block_Timestamp
Load_Block_Cumulative_Difficulty
Load_Block_Difficulty
Load_Block_Base_Reward
Load_Block_Total_Reward
// inluding reward + fees
Load_Already_Generated_Coins_for_Topo_Index
Load_Block_Size
Load_TOPO_HEIGHT
// faster bootstrap
Load_TOP_HEIGHT
// faster bootstrap
Load_TX_blocks
Load_TIPS_ATOMIC
load_TIPS
Get:
Get_Block_Past
// all the immediate past of a block
Get_Block_Future
// a block withput a future is called tip
Get_Block_Output_Index
// get the position from where indexing must start for this block
// indexing mean vout based index
// cryptonote works by giving each vout a unique index number
Get_Blocks_At_Height
其它:
Is_Block_Topological_order
// since topological order might mutate, instead of doing cleanup, we double check the pointers
IS_TX_Valid
mark_TX
// this will mark a block, tx combination as valid/invalid
Read_KeyImage_Status