Skip to content

Commit eb92795

Browse files
committed
Adapt to rename of protocol::authority.
1 parent 83ab193 commit eb92795

10 files changed

+47
-47
lines changed

src/protocols/protocol_block_in_106.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,14 @@ bool protocol_block_in_106::handle_receive_inventory(const code& ec,
8181
if (!tracker_.ids.empty())
8282
{
8383
LOGP("Unrequested (" << block_count << ") block inventory from ["
84-
<< authority() << "] with (" << tracker_.ids.size()
84+
<< opposite() << "] with (" << tracker_.ids.size()
8585
<< ") pending.");
8686
return true;
8787
}
8888

8989
const auto getter = create_get_data(*message);
9090
LOGP("Received (" << block_count << ") block inventory from ["
91-
<< authority() << "] with (" << getter.items.size()
91+
<< opposite() << "] with (" << getter.items.size()
9292
<< ") new blocks.");
9393

9494
// If getter is empty it may be because we have them all.
@@ -103,12 +103,12 @@ bool protocol_block_in_106::handle_receive_inventory(const code& ec,
103103

104104
// A non-maximal inventory has no new blocks, assume complete.
105105
// Inventory completeness assumes empty response if caught up at 500.
106-
LOGP("Completed block inventory from [" << authority() << "].");
106+
LOGP("Completed block inventory from [" << opposite() << "].");
107107
return true;
108108
}
109109

110110
LOGP("Requested (" << getter.items.size() << ") blocks from ["
111-
<< authority() << "].");
111+
<< opposite() << "].");
112112

113113
// Track inventory and request blocks (to_hashes order is reversed).
114114
tracker_.announced = block_count;
@@ -136,7 +136,7 @@ bool protocol_block_in_106::handle_receive_block(const code& ec,
136136
if (tracker_.ids.find(block_ptr->get_hash()) == tracker_.ids.end())
137137
{
138138
LOGP("Unrequested block [" << encode_hash(block_ptr->get_hash())
139-
<< "] from [" << authority() << "].");
139+
<< "] from [" << opposite() << "].");
140140
return true;
141141
}
142142

@@ -176,20 +176,20 @@ void protocol_block_in_106::do_handle_organize(const code& ec, size_t height,
176176
// Many peers blindly broadcast blocks even at/above v31800, ugh.
177177
// If we are not caught up on headers this is useless information.
178178
LOGP("Block [" << encode_hash(block_ptr->get_hash()) << "] from ["
179-
<< authority() << "] " << ec.message());
179+
<< opposite() << "] " << ec.message());
180180
}
181181
else
182182
{
183183
LOGR("Block [" << encode_hash(block_ptr->hash()) << ":" << height
184-
<< "] from [" << authority() << "] " << ec.message());
184+
<< "] from [" << opposite() << "] " << ec.message());
185185
}
186186

187187
stop(ec);
188188
return;
189189
}
190190

191191
LOGP("Block [" << encode_hash(block_ptr->get_hash()) << ":" << height
192-
<< "] from [" << authority() << "].");
192+
<< "] from [" << opposite() << "].");
193193

194194
// Completion of tracked inventory.
195195
if (tracker_.ids.empty())
@@ -203,7 +203,7 @@ void protocol_block_in_106::do_handle_organize(const code& ec, size_t height,
203203
{
204204
// Completeness stalls if on 500 as empty message is ambiguous.
205205
// This is ok, since complete is not used for anything essential.
206-
LOGP("Completed blocks from [" << authority() << "] with ("
206+
LOGP("Completed blocks from [" << opposite() << "] with ("
207207
<< tracker_.announced << ") announced.");
208208
}
209209
}
@@ -238,13 +238,13 @@ get_blocks protocol_block_in_106::create_get_inventory(
238238
if (hashes.size() == one)
239239
{
240240
LOGP("Request block inventory after [" << encode_hash(hashes.front())
241-
<< "] from [" << authority() << "].");
241+
<< "] from [" << opposite() << "].");
242242
}
243243
else
244244
{
245245
LOGP("Request block inventory (" << hashes.size() << ") after ["
246246
<< encode_hash(hashes.front()) << "] from ["
247-
<< authority() << "].");
247+
<< opposite() << "].");
248248
}
249249

250250
return { std::move(hashes) };

src/protocols/protocol_block_in_31800.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ void protocol_block_in_31800::do_purge(peer_t) NOEXCEPT
183183

184184
if (!map_->empty())
185185
{
186-
LOGV("Purge work (" << map_->size() << ") from [" << authority() << "].");
186+
LOGV("Purge work (" << map_->size() << ") from [" << opposite() << "].");
187187
map_->clear();
188188
stop(error::sacrificed_channel);
189189
}
@@ -196,7 +196,7 @@ void protocol_block_in_31800::do_split(peer_t) NOEXCEPT
196196
if (stopped())
197197
return;
198198

199-
LOGV("Divide work (" << map_->size() << ") from [" << authority() << "].");
199+
LOGV("Divide work (" << map_->size() << ") from [" << opposite() << "].");
200200
restore(chaser_check::split(map_));
201201
restore(map_);
202202
map_ = chaser_check::empty_map();
@@ -209,7 +209,7 @@ void protocol_block_in_31800::do_report(count_t sequence) NOEXCEPT
209209

210210
// Uses application logging since it outputs to a runtime option.
211211
LOGA("Work report [" << sequence << "] is (" << map_->size() << ") for ["
212-
<< authority() << "].");
212+
<< opposite() << "].");
213213
}
214214

215215
// request hashes
@@ -279,7 +279,7 @@ bool protocol_block_in_31800::handle_receive_block(const code& ec,
279279
{
280280
// Allow unrequested block, not counted toward performance.
281281
LOGR("Unrequested block [" << encode_hash(hash) << "] from ["
282-
<< authority() << "].");
282+
<< opposite() << "].");
283283
return true;
284284
}
285285

@@ -302,7 +302,7 @@ bool protocol_block_in_31800::handle_receive_block(const code& ec,
302302
code == system::error::invalid_witness_commitment)
303303
{
304304
LOGR("Malleated block [" << encode_hash(hash) << ":" << height
305-
<< "] from [" << authority() << "] " << code.message()
305+
<< "] from [" << opposite() << "] " << code.message()
306306
<< " txs(" << block->transactions() << ")"
307307
<< " segregated(" << block->is_segregated() << ").");
308308
stop(code);
@@ -316,7 +316,7 @@ bool protocol_block_in_31800::handle_receive_block(const code& ec,
316316
}
317317

318318
LOGR("Block failed check [" << encode_hash(hash) << ":" << height
319-
<< "] from [" << authority() << "] " << code.message());
319+
<< "] from [" << opposite() << "] " << code.message());
320320
notify(error::success, chase::unchecked, link);
321321
fire(events::block_unconfirmable, height);
322322
stop(code);
@@ -329,7 +329,7 @@ bool protocol_block_in_31800::handle_receive_block(const code& ec,
329329
if (const auto code = query.set_code(*block, link, checked))
330330
{
331331
LOGF("Failure storing block [" << encode_hash(hash) << ":" << height
332-
<< "] from [" << authority() << "] " << code.message());
332+
<< "] from [" << opposite() << "] " << code.message());
333333

334334
stop(fault(code));
335335
return false;
@@ -339,7 +339,7 @@ bool protocol_block_in_31800::handle_receive_block(const code& ec,
339339
// ........................................................................
340340

341341
LOGP("Downloaded block [" << encode_hash(hash) << ":" << height
342-
<< "] from [" << authority() << "].");
342+
<< "] from [" << opposite() << "].");
343343

344344
notify(ec, chase::checked, height);
345345
fire(events::block_archived, height);
@@ -388,18 +388,18 @@ void protocol_block_in_31800::restore(const map_ptr& map) NOEXCEPT
388388
void protocol_block_in_31800::handle_put_hashes(const code& ec,
389389
size_t count) NOEXCEPT
390390
{
391-
LOGV("Put (" << count << ") work for [" << authority() << "].");
391+
LOGV("Put (" << count << ") work for [" << opposite() << "].");
392392

393393
if (ec)
394394
{
395-
LOGF("Error putting work for [" << authority() << "] " << ec.message());
395+
LOGF("Error putting work for [" << opposite() << "] " << ec.message());
396396
}
397397
}
398398

399399
void protocol_block_in_31800::handle_get_hashes(const code& ec,
400400
const map_ptr& map, const job::ptr& job) NOEXCEPT
401401
{
402-
LOGV("Got (" << map->size() << ") work for [" << authority() << "].");
402+
LOGV("Got (" << map->size() << ") work for [" << opposite() << "].");
403403

404404
if (stopped())
405405
{
@@ -409,7 +409,7 @@ void protocol_block_in_31800::handle_get_hashes(const code& ec,
409409

410410
if (ec)
411411
{
412-
LOGF("Error getting work for [" << authority() << "] " << ec.message());
412+
LOGF("Error getting work for [" << opposite() << "] " << ec.message());
413413
stop(ec);
414414
return;
415415
}

src/protocols/protocol_block_out_106.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ bool protocol_block_out_106::handle_receive_get_blocks(const code& ec,
131131
return false;
132132

133133
LOGP("Get headers above " << encode_hash(message->start_hash())
134-
<< " from [" << authority() << "].");
134+
<< " from [" << opposite() << "].");
135135

136136
SEND(create_inventory(*message), handle_send, _1);
137137
return true;
@@ -178,7 +178,7 @@ void protocol_block_out_106::send_block(const code& ec, size_t index,
178178
const auto witness = item.is_witness_type();
179179
if (!node_witness_ && witness)
180180
{
181-
LOGR("Unsupported witness get_data from [" << authority() << "].");
181+
LOGR("Unsupported witness get_data from [" << opposite() << "].");
182182
stop(network::error::protocol_violation);
183183
return;
184184
}
@@ -192,7 +192,7 @@ void protocol_block_out_106::send_block(const code& ec, size_t index,
192192
if (!ptr)
193193
{
194194
LOGR("Requested block " << encode_hash(item.hash)
195-
<< " from [" << authority() << "] not found.");
195+
<< " from [" << opposite() << "] not found.");
196196

197197
// This block could not have been advertised to the peer.
198198
stop(system::error::not_found);

src/protocols/protocol_header_in_31800.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ bool protocol_header_in_31800::handle_receive_headers(const code& ec,
6363
return false;
6464

6565
LOGP("Headers (" << message->header_ptrs.size() << ") from ["
66-
<< authority() << "].");
66+
<< opposite() << "].");
6767

6868
// Store each header, drop channel if invalid.
6969
for (const auto& ptr: message->header_ptrs)
@@ -89,7 +89,7 @@ bool protocol_header_in_31800::handle_receive_headers(const code& ec,
8989
{
9090
// Protocol presumes max_get_headers unless complete.
9191
// Completeness assumes empty response from peer if caught up at 2000.
92-
LOGP("Completed headers from [" << authority() << "].");
92+
LOGP("Completed headers from [" << opposite() << "].");
9393
complete();
9494
}
9595

@@ -111,20 +111,20 @@ void protocol_header_in_31800::handle_organize(const code& ec,
111111
if (is_zero(height))
112112
{
113113
LOGP("Header [" << encode_hash(header_ptr->get_hash()) << "] from ["
114-
<< authority() << "] " << ec.message());
114+
<< opposite() << "] " << ec.message());
115115
}
116116
else
117117
{
118118
LOGR("Header [" << encode_hash(header_ptr->get_hash()) << ":"
119-
<< height << "] from [" << authority() << "] " << ec.message());
119+
<< height << "] from [" << opposite() << "] " << ec.message());
120120
}
121121

122122
stop(ec);
123123
return;
124124
}
125125

126126
LOGP("Header [" << encode_hash(header_ptr->get_hash()) << ":" << height
127-
<< "] from [" << authority() << "] " << ec.message());
127+
<< "] from [" << opposite() << "] " << ec.message());
128128
}
129129

130130
// This could be the end of a catch-up sequence, or a singleton announcement.
@@ -138,7 +138,7 @@ void protocol_header_in_31800::complete() NOEXCEPT
138138
{
139139
subscribed = true;
140140
SUBSCRIBE_CHANNEL(inventory, handle_receive_inventory, _1, _2);
141-
LOGP("Subscribed to block announcements at [" << authority() << "].");
141+
LOGP("Subscribed to block announcements at [" << opposite() << "].");
142142
}
143143
}
144144

@@ -199,13 +199,13 @@ get_headers protocol_header_in_31800::create_get_headers(
199199
if (is_one(hashes.size()))
200200
{
201201
LOGP("Request headers after [" << encode_hash(hashes.front())
202-
<< "] from [" << authority() << "].");
202+
<< "] from [" << opposite() << "].");
203203
}
204204
else
205205
{
206-
LOGP("Request headers (" << hashes.size() << ") after ["
207-
<< encode_hash(hashes.front()) << "] from ["
208-
<< authority() << "].");
206+
LOGP("Request headers (" << hashes.size()
207+
<< ") after [" << encode_hash(hashes.front())
208+
<< "] from [" << opposite() << "].");
209209
}
210210

211211
return { std::move(hashes) };

src/protocols/protocol_header_in_70012.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ void protocol_header_in_70012::complete() NOEXCEPT
3636
{
3737
subscribed = true;
3838
SEND(send_headers{}, handle_send, _1);
39-
LOGP("Subscribed to header announcements at [" << authority() << "].");
39+
LOGP("Subscribed to header announcements at [" << opposite() << "].");
4040
}
4141

4242
// Must come after subscribed is updated.

src/protocols/protocol_header_out_31800.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ bool protocol_header_out_31800::handle_receive_get_headers(const code& ec,
6060
return false;
6161

6262
LOGP("Get headers above " << encode_hash(message->start_hash())
63-
<< " from [" << authority() << "].");
63+
<< " from [" << opposite() << "].");
6464

6565
SEND(create_headers(*message), handle_send, _1);
6666
return true;

src/protocols/protocol_header_out_70012.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ bool protocol_header_out_70012::do_announce(header_t link) NOEXCEPT
100100
if (was_announced(hash))
101101
{
102102
LOGP("Suppress " << encode_hash(hash) << " to ["
103-
<< authority() << "].");
103+
<< opposite() << "].");
104104
return true;
105105
}
106106

@@ -112,7 +112,7 @@ bool protocol_header_out_70012::do_announce(header_t link) NOEXCEPT
112112
return true;
113113
}
114114

115-
LOGN("Announce " << encode_hash(hash) << " to [" << authority() << "].");
115+
LOGN("Announce " << encode_hash(hash) << " to [" << opposite() << "].");
116116
SEND(headers{ { ptr } }, handle_send, _1);
117117
return true;
118118
}

src/protocols/protocol_observer.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ bool protocol_observer::handle_receive_inventory(const code& ec,
109109
// Common with Satoshi 25.0 and 25.1.
110110
if (relay_disallowed_ && message->any_transaction())
111111
{
112-
LOGR("Unrequested tx relay from [" << authority() << "] "
112+
LOGR("Unrequested tx relay from [" << opposite() << "] "
113113
<< peer_version()->user_agent);
114114

115115
stop(network::error::protocol_violation);
@@ -119,7 +119,7 @@ bool protocol_observer::handle_receive_inventory(const code& ec,
119119
////// Witness types never allowed in inventory (wxtid excluded).
120120
////if (message->any_witness())
121121
////{
122-
//// LOGR("Unsupported witness inventory from [" << authority() << "].");
122+
//// LOGR("Unsupported witness inventory from [" << opposite() << "].");
123123
//// stop(network::error::protocol_violation);
124124
//// return false;
125125
////}
@@ -138,7 +138,7 @@ bool protocol_observer::handle_receive_inventory(const code& ec,
138138
//// // Witness types only allowed in get_data if witness service advertised.
139139
//// if (!node_witness_ && message->any_witness())
140140
//// {
141-
//// LOGR("Unsupported witness get_data from [" << authority() << "].");
141+
//// LOGR("Unsupported witness get_data from [" << authority42() << "].");
142142
//// stop(network::error::protocol_violation);
143143
//// return false;
144144
//// }

src/protocols/protocol_performer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,14 +135,14 @@ void protocol_performer::do_handle_performance(const code& ec) NOEXCEPT
135135
// Caused only by performance(zero|xxx) - had outstanding work.
136136
if (ec == error::stalled_channel || ec == error::slow_channel)
137137
{
138-
LOGP("Channel dropped [" << authority() << "] " << ec.message());
138+
LOGP("Channel dropped [" << opposite() << "] " << ec.message());
139139
stop(ec);
140140
return;
141141
}
142142

143143
if (ec)
144144
{
145-
LOGF("Performance failure [" << authority() << "] " << ec.message());
145+
LOGF("Performance failure [" << opposite() << "] " << ec.message());
146146
stop(ec);
147147
return;
148148
}

src/protocols/protocol_transaction_out_106.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ void protocol_transaction_out_106::send_transaction(const code& ec,
163163
const auto witness = item.is_witness_type();
164164
if (!node_witness_ && witness)
165165
{
166-
LOGR("Unsupported witness get_data from [" << authority() << "].");
166+
LOGR("Unsupported witness get_data from [" << opposite() << "].");
167167
stop(network::error::protocol_violation);
168168
return;
169169
}
@@ -176,7 +176,7 @@ void protocol_transaction_out_106::send_transaction(const code& ec,
176176
if (!ptr)
177177
{
178178
LOGR("Requested tx " << encode_hash(item.hash)
179-
<< " from [" << authority() << "] not found.");
179+
<< " from [" << opposite() << "] not found.");
180180

181181
// This tx could not have been advertised to the peer.
182182
stop(system::error::not_found);

0 commit comments

Comments
 (0)