Transaction
empty
/// Creates a new empty transaction (no inputs or outputs, zero fee).
数据全部清空、归零。
new
/// Creates a new transaction initialized with
/// the provided inputs, outputs, kernels
// 新建
with_offset
/// Creates a new transaction using this transaction as a template
/// and with the specified offset.
// 新建
with_input
/// Builds a new transaction with the provided inputs added. Existing
/// inputs, if any, are kept intact.
// 新建
with_output
/// Builds a new transaction with the provided output added. Existing
/// outputs, if any, are kept intact.
// 新建
fee
/// Total fee for a transaction is the sum of fees of all kernels.
// 获取数据
overage
同 fee
lock_height
/// Lock height of a transaction is the max lock height of the kernels.
// 获取数据
verify_weight
// Verify the body is not too big in terms of number of inputs|outputs|kernels.
verify_sorted
// Verify that inputs|outputs|kernels are all sorted in lexicographical order.
verify_cut_through
// Verify that no input is spending an output from the same block.
verify_features
/// Verify we have no invalid outputs or kernels in the transaction
/// due to invalid features.
/// Specifically, a transaction cannot contain a coinbase output or a coinbase kernel.
verify_output_features
// Verify we have no outputs tagged as COINBASE_OUTPUT.
verify_kernel_features
// Verify we have no kernels tagged as COINBASE_KERNEL.
validate_read
/// "Lightweight" validation that we can perform quickly during read/deserialization.
/// Subset of full validation that skips expensive verification steps, specifically -
/// * rangeproof verification
/// * kernel signature verification
validate
verify_features // OutputFeatures 和 KernelFeatures
verify_weight // inputs、outputs、kernels 三者的数据长度与设置值比较
verify_kernel_sums // 巧妙的将手续费和偏移量结合在一起,并进行验证
verify_sorted // inputs、outputs、kernels 三者都是数组,需保证其内部数据的顺序
verify_cut_through // 输入、输出两者对比,不存在相同的 commitment
verify_rangeproofs // 即每个输出的 verify_proof
verify_kernel_signatures // 即每个 kernel 对自身数据的验证
tx_weight
/// Calculate transaction weight
weight
/// Calculate transaction weight from transaction details
// 输入长度 + 输出长度