Skip to content

Commit 8182591

Browse files
committed
fix: document false usage in MemPoolDB::try_add_tx() and remove TODO
1 parent 1d2dff0 commit 8182591

File tree

3 files changed

+12
-13
lines changed

3 files changed

+12
-13
lines changed

stackslib/src/core/mempool.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2294,7 +2294,6 @@ impl MemPoolDB {
22942294
}
22952295

22962296
/// Submit a transaction to the mempool at a particular chain tip.
2297-
/// TODO: Nakamoto-ize
22982297
fn tx_submit(
22992298
mempool_tx: &mut MemPoolTx,
23002299
chainstate: &mut StacksChainState,

stackslib/src/core/tests/mod.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1444,7 +1444,7 @@ fn mempool_db_load_store_replace_tx(#[case] behavior: MempoolCollectionBehavior)
14441444
&mut chainstate,
14451445
&ConsensusHash([0x1; 20]),
14461446
&BlockHeaderHash([0x2; 32]),
1447-
false,
1447+
false, // don't resolve the above chain tip since it doesn't exist
14481448
txid,
14491449
tx_bytes,
14501450
tx_fee,
@@ -1505,7 +1505,7 @@ fn mempool_db_load_store_replace_tx(#[case] behavior: MempoolCollectionBehavior)
15051505
&mut chainstate,
15061506
&ConsensusHash([0x1; 20]),
15071507
&BlockHeaderHash([0x2; 32]),
1508-
false,
1508+
false, // don't resolve the above chain tip since it doesn't exist
15091509
txid,
15101510
tx_bytes,
15111511
tx_fee,
@@ -1569,7 +1569,7 @@ fn mempool_db_load_store_replace_tx(#[case] behavior: MempoolCollectionBehavior)
15691569
&mut chainstate,
15701570
&ConsensusHash([0x1; 20]),
15711571
&BlockHeaderHash([0x2; 32]),
1572-
false,
1572+
false, // don't resolve the above chain tip since it doesn't exist
15731573
txid,
15741574
tx_bytes,
15751575
tx_fee,
@@ -1719,7 +1719,7 @@ fn mempool_db_test_rbf() {
17191719
&mut chainstate,
17201720
&ConsensusHash([0x1; 20]),
17211721
&BlockHeaderHash([0x2; 32]),
1722-
false,
1722+
false, // don't resolve the above chain tip since it doesn't exist
17231723
txid,
17241724
tx_bytes,
17251725
tx_fee,
@@ -1769,7 +1769,7 @@ fn mempool_db_test_rbf() {
17691769
&mut chainstate,
17701770
&ConsensusHash([0x1; 20]),
17711771
&BlockHeaderHash([0x2; 32]),
1772-
false,
1772+
false, // don't resolve the above chain tip since it doesn't exist
17731773
txid,
17741774
tx_bytes,
17751775
tx_fee,
@@ -1852,7 +1852,7 @@ fn test_add_txs_bloom_filter() {
18521852
&mut chainstate,
18531853
&ConsensusHash([0x1 + (block_height as u8); 20]),
18541854
&BlockHeaderHash([0x2 + (block_height as u8); 32]),
1855-
false,
1855+
false, // don't resolve the above chain tip since it doesn't exist
18561856
txid,
18571857
tx_bytes,
18581858
tx_fee,
@@ -1963,7 +1963,7 @@ fn test_txtags() {
19631963
&mut chainstate,
19641964
&ConsensusHash([0x1 + (block_height as u8); 20]),
19651965
&BlockHeaderHash([0x2 + (block_height as u8); 32]),
1966-
false,
1966+
false, // don't resolve the above chain tip since it doesn't exist
19671967
txid,
19681968
tx_bytes,
19691969
tx_fee,
@@ -2057,7 +2057,7 @@ fn test_make_mempool_sync_data() {
20572057
&mut chainstate,
20582058
&ConsensusHash([0x1 + (block_height as u8); 20]),
20592059
&BlockHeaderHash([0x2 + (block_height as u8); 32]),
2060-
false,
2060+
false, // don't resolve the above chain tip since it doesn't exist
20612061
txid.clone(),
20622062
tx_bytes,
20632063
tx_fee,
@@ -2235,7 +2235,7 @@ fn test_find_next_missing_transactions() {
22352235
&mut chainstate,
22362236
&ConsensusHash([0x1 + (block_height as u8); 20]),
22372237
&BlockHeaderHash([0x2 + (block_height as u8); 32]),
2238-
false,
2238+
false, // don't resolve the above chain tip since it doesn't exist
22392239
txid.clone(),
22402240
tx_bytes,
22412241
tx_fee,
@@ -2505,7 +2505,7 @@ fn test_drop_and_blacklist_txs_by_time() {
25052505
&mut chainstate,
25062506
&ConsensusHash([0x1 + (block_height as u8); 20]),
25072507
&BlockHeaderHash([0x2 + (block_height as u8); 32]),
2508-
false,
2508+
false, // don't resolve the above chain tip since it doesn't exist
25092509
txid.clone(),
25102510
tx_bytes,
25112511
tx_fee,
@@ -2625,7 +2625,7 @@ fn test_drop_and_blacklist_txs_by_size() {
26252625
&mut chainstate,
26262626
&ConsensusHash([0x1 + (block_height as u8); 20]),
26272627
&BlockHeaderHash([0x2 + (block_height as u8); 32]),
2628-
false,
2628+
false, // don't resolve the above chain tip since it doesn't exist
26292629
txid.clone(),
26302630
tx_bytes,
26312631
tx_fee,

stackslib/src/net/api/tests/postmempoolquery.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ fn test_stream_mempool_txs() {
174174
&mut chainstate,
175175
&ConsensusHash([0x1 + (block_height as u8); 20]),
176176
&BlockHeaderHash([0x2 + (block_height as u8); 32]),
177-
false,
177+
false, // don't resolve the above chain tip since it doesn't exist
178178
txid.clone(),
179179
tx_bytes,
180180
tx_fee,

0 commit comments

Comments
 (0)