Skip to content

Commit

Permalink
add comments for PreCheckedTx
Browse files Browse the repository at this point in the history
  • Loading branch information
chenyukang committed Aug 3, 2023
1 parent 8a22364 commit 64fab5a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion tx-pool/src/pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ impl TxPool {
assert!(!conflicts.is_empty());

let short_id = rtx.transaction.proposal_short_id();
// Rule #4, new tx' fee need to higher than min_rbf_fee computed from the tx_pool configuration
// Rule #4, new tx's fee need to higher than min_rbf_fee computed from the tx_pool configuration
// Rule #3, new tx's fee need to higher than conflicts, here we only check the root tx
if let Some(min_replace_fee) = self.calculate_min_replace_fee(conflicts, tx_size) {
if fee < min_replace_fee {
Expand Down
12 changes: 7 additions & 5 deletions tx-pool/src/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1002,11 +1002,13 @@ impl TxPoolService {
}

type PreCheckedTx = (
Byte32,
Arc<ResolvedTransaction>,
TxStatus,
Capacity,
usize,
Byte32, // tip_hash
Arc<ResolvedTransaction>, // rtx
TxStatus, // status
Capacity, // tx fee
usize, // tx size
// the conflicted txs, used for latter `check_rbf`
// the root txs for removing from `tx-pool` when RBF is checked
HashSet<ProposalShortId>,
);

Expand Down

0 comments on commit 64fab5a

Please sign in to comment.