Skip to content

Commit 1066d10

Browse files
committed
scripted-diff: rename TxRelay members
-BEGIN VERIFY SCRIPT- ren() { sed -i "s:\<$1\>:$2:g" $(git grep -l "\<$1\>" ./src ./test); } ren cs_filter m_bloom_filter_mutex ren fRelayTxes m_relay_txs ren pfilter m_bloom_filter ren cs_tx_inventory m_tx_inventory_mutex ren filterInventoryKnown m_tx_inventory_known_filter ren setInventoryTxToSend m_tx_inventory_to_send ren fSendMempool m_send_mempool ren nNextInvSend m_next_inv_send_time ren minFeeFilter m_fee_filter_received ren lastSentFeeFilter m_fee_filter_sent -END VERIFY SCRIPT-
1 parent 575bbd0 commit 1066d10

File tree

11 files changed

+82
-82
lines changed

11 files changed

+82
-82
lines changed

src/net.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -902,15 +902,15 @@ static bool CompareNodeTXTime(const NodeEvictionCandidate &a, const NodeEviction
902902
{
903903
// There is a fall-through here because it is common for a node to have more than a few peers that have not yet relayed txn.
904904
if (a.m_last_tx_time != b.m_last_tx_time) return a.m_last_tx_time < b.m_last_tx_time;
905-
if (a.fRelayTxes != b.fRelayTxes) return b.fRelayTxes;
905+
if (a.m_relay_txs != b.m_relay_txs) return b.m_relay_txs;
906906
if (a.fBloomFilter != b.fBloomFilter) return a.fBloomFilter;
907907
return a.m_connected > b.m_connected;
908908
}
909909

910910
// Pick out the potential block-relay only peers, and sort them by last block time.
911911
static bool CompareNodeBlockRelayOnlyTime(const NodeEvictionCandidate &a, const NodeEvictionCandidate &b)
912912
{
913-
if (a.fRelayTxes != b.fRelayTxes) return a.fRelayTxes;
913+
if (a.m_relay_txs != b.m_relay_txs) return a.m_relay_txs;
914914
if (a.m_last_block_time != b.m_last_block_time) return a.m_last_block_time < b.m_last_block_time;
915915
if (a.fRelevantServices != b.fRelevantServices) return b.fRelevantServices;
916916
return a.m_connected > b.m_connected;
@@ -1035,7 +1035,7 @@ void ProtectEvictionCandidatesByRatio(std::vector<NodeEvictionCandidate>& evicti
10351035
EraseLastKElements(vEvictionCandidates, CompareNodeTXTime, 4);
10361036
// Protect up to 8 non-tx-relay peers that have sent us novel blocks.
10371037
EraseLastKElements(vEvictionCandidates, CompareNodeBlockRelayOnlyTime, 8,
1038-
[](const NodeEvictionCandidate& n) { return !n.fRelayTxes && n.fRelevantServices; });
1038+
[](const NodeEvictionCandidate& n) { return !n.m_relay_txs && n.fRelevantServices; });
10391039

10401040
// Protect 4 nodes that most recently sent us novel blocks.
10411041
// An attacker cannot manipulate this metric without performing useful work.

src/net.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1263,7 +1263,7 @@ struct NodeEvictionCandidate
12631263
std::chrono::seconds m_last_block_time;
12641264
std::chrono::seconds m_last_tx_time;
12651265
bool fRelevantServices;
1266-
bool fRelayTxes;
1266+
bool m_relay_txs;
12671267
bool fBloomFilter;
12681268
uint64_t nKeyedNetGroup;
12691269
bool prefer_evict;

src/net_processing.cpp

Lines changed: 67 additions & 67 deletions
Large diffs are not rendered by default.

src/net_processing.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ struct CNodeStateStats {
2929
int m_starting_height = -1;
3030
std::chrono::microseconds m_ping_wait;
3131
std::vector<int> vHeightInFlight;
32-
bool fRelayTxes;
33-
CAmount minFeeFilter;
32+
bool m_relay_txs;
33+
CAmount m_fee_filter_received;
3434
uint64_t m_addr_processed = 0;
3535
uint64_t m_addr_rate_limited = 0;
3636
bool m_addr_relay_enabled{false};

src/qt/rpcconsole.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1219,7 +1219,7 @@ void RPCConsole::updateDetailWidget()
12191219
ui->peerAddrRelayEnabled->setText(stats->nodeStateStats.m_addr_relay_enabled ? ts.yes : ts.no);
12201220
ui->peerAddrProcessed->setText(QString::number(stats->nodeStateStats.m_addr_processed));
12211221
ui->peerAddrRateLimited->setText(QString::number(stats->nodeStateStats.m_addr_rate_limited));
1222-
ui->peerRelayTxes->setText(stats->nodeStateStats.fRelayTxes ? ts.yes : ts.no);
1222+
ui->peerRelayTxes->setText(stats->nodeStateStats.m_relay_txs ? ts.yes : ts.no);
12231223
}
12241224

12251225
ui->peersTabRightPanel->show();

src/rpc/net.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,8 +231,8 @@ static RPCHelpMan getpeerinfo()
231231
heights.push_back(height);
232232
}
233233
obj.pushKV("inflight", heights);
234-
obj.pushKV("relaytxes", statestats.fRelayTxes);
235-
obj.pushKV("minfeefilter", ValueFromAmount(statestats.minFeeFilter));
234+
obj.pushKV("relaytxes", statestats.m_relay_txs);
235+
obj.pushKV("minfeefilter", ValueFromAmount(statestats.m_fee_filter_received));
236236
obj.pushKV("addr_relay_enabled", statestats.m_addr_relay_enabled);
237237
obj.pushKV("addr_processed", statestats.m_addr_processed);
238238
obj.pushKV("addr_rate_limited", statestats.m_addr_rate_limited);

src/test/fuzz/node_eviction.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ FUZZ_TARGET(node_eviction)
2626
/*m_last_block_time=*/std::chrono::seconds{fuzzed_data_provider.ConsumeIntegral<int64_t>()},
2727
/*m_last_tx_time=*/std::chrono::seconds{fuzzed_data_provider.ConsumeIntegral<int64_t>()},
2828
/*fRelevantServices=*/fuzzed_data_provider.ConsumeBool(),
29-
/*fRelayTxes=*/fuzzed_data_provider.ConsumeBool(),
29+
/*m_relay_txs=*/fuzzed_data_provider.ConsumeBool(),
3030
/*fBloomFilter=*/fuzzed_data_provider.ConsumeBool(),
3131
/*nKeyedNetGroup=*/fuzzed_data_provider.ConsumeIntegral<uint64_t>(),
3232
/*prefer_evict=*/fuzzed_data_provider.ConsumeBool(),

src/test/net_peer_eviction_tests.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,7 @@ BOOST_AUTO_TEST_CASE(peer_eviction_test)
627627
number_of_nodes, [number_of_nodes](NodeEvictionCandidate& candidate) {
628628
candidate.m_last_block_time = std::chrono::seconds{number_of_nodes - candidate.id};
629629
if (candidate.id <= 7) {
630-
candidate.fRelayTxes = false;
630+
candidate.m_relay_txs = false;
631631
candidate.fRelevantServices = true;
632632
}
633633
},
@@ -646,7 +646,7 @@ BOOST_AUTO_TEST_CASE(peer_eviction_test)
646646
number_of_nodes, [number_of_nodes](NodeEvictionCandidate& candidate) {
647647
candidate.m_last_block_time = std::chrono::seconds{number_of_nodes - candidate.id};
648648
if (candidate.id <= 7) {
649-
candidate.fRelayTxes = false;
649+
candidate.m_relay_txs = false;
650650
candidate.fRelevantServices = true;
651651
}
652652
},

src/test/util/net.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ std::vector<NodeEvictionCandidate> GetRandomNodeEvictionCandidates(int n_candida
5252
/*m_last_block_time=*/std::chrono::seconds{random_context.randrange(100)},
5353
/*m_last_tx_time=*/std::chrono::seconds{random_context.randrange(100)},
5454
/*fRelevantServices=*/random_context.randbool(),
55-
/*fRelayTxes=*/random_context.randbool(),
55+
/*m_relay_txs=*/random_context.randbool(),
5656
/*fBloomFilter=*/random_context.randbool(),
5757
/*nKeyedNetGroup=*/random_context.randrange(100),
5858
/*prefer_evict=*/random_context.randbool(),

test/functional/p2p_blocksonly.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def blocks_relay_conn_tests(self):
9494

9595
self.nodes[0].sendrawtransaction(tx_hex)
9696

97-
# Bump time forward to ensure nNextInvSend timer pops
97+
# Bump time forward to ensure m_next_inv_send_time timer pops
9898
self.nodes[0].setmocktime(int(time.time()) + 60)
9999

100100
conn.sync_send_with_ping()

0 commit comments

Comments
 (0)