Skip to content

Commit 61501a2

Browse files
style: reviewer feedback
Co-authored-by: Alan Szepieniec <[email protected]>
1 parent fc7ae21 commit 61501a2

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

src/config_models/cli_args.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,8 @@ pub struct Args {
178178
/// peers into its mempool. And if the node is either upgrading transaction
179179
/// proofs on the network or composing, it will never merge two transactions
180180
/// that would exceed this limit. Does not affect block validity, i.e.
181-
/// consensus. So a block with more than this number of inputs may be
182-
/// considered value. Also does not affect which block proposals that a
181+
/// consensus: a block with more than this number of inputs can be
182+
/// valid. Also does not affect which block proposals that a
183183
/// guessing node will attempt to solve the PoW puzzle for. Set to "none" to
184184
/// disable this limit.
185185
#[clap(long, value_parser = parse_optional_usize, default_value = "28")]
@@ -630,6 +630,7 @@ mod cli_args_tests {
630630
#[test]
631631
fn test_parse_optional_usize() {
632632
assert_eq!(parse_optional_usize("42"), Ok(Some(42)));
633+
assert_eq!(parse_optional_usize("28"), Ok(Some(28)));
633634
assert_eq!(parse_optional_usize("0"), Ok(Some(0)));
634635
assert_eq!(parse_optional_usize("none"), Ok(None));
635636
assert_eq!(parse_optional_usize("None"), Ok(None));

src/main_loop.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -806,15 +806,15 @@ impl MainLoopHandler {
806806
return Ok(());
807807
}
808808

809-
// Insert into mempool
809+
// Insert into mempool, if allowed.
810810
if let Err(err) = global_state_mut
811811
.mempool_insert(
812812
pt2m_transaction.transaction.to_owned(),
813813
TransactionOrigin::Foreign,
814814
)
815815
.await
816816
{
817-
warn!("{err}");
817+
warn!("cannot add transaction into mempool: {err}");
818818
return Ok(());
819819
}
820820

src/models/state/mempool.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -246,10 +246,10 @@ impl Mempool {
246246
pub(crate) fn most_dense_single_proof_pair(
247247
&self,
248248
) -> Option<([(&TransactionKernel, &Proof); 2], TransactionOrigin)> {
249-
/// Loop from `i`th most valuable transaction in the mempool to the
250-
/// least valuable in order to find a pair whose total number of inputs
249+
/// Loop from `i`th densest transaction in the mempool to the
250+
/// least dense in order to find a pair whose total number of inputs
251251
/// does not exceed the maximum value.
252-
fn skip_first_n_transaction(
252+
fn most_dense_pair_skip_first_n(
253253
mempool: &Mempool,
254254
i: usize,
255255
) -> Option<([(&TransactionKernel, &Proof); 2], TransactionOrigin)> {
@@ -279,7 +279,7 @@ impl Mempool {
279279
None
280280
}
281281

282-
(0..self.len() - 1).find_map(|i| skip_first_n_transaction(self, i))
282+
(0..self.len() - 1).find_map(|i| most_dense_pair_skip_first_n(self, i))
283283
}
284284

285285
/// check if transaction exists in mempool

0 commit comments

Comments
 (0)