From eb92795ab7f5e4fc3eddb534bf5d04a4b2ae80d2 Mon Sep 17 00:00:00 2001 From: evoskuil Date: Sat, 10 Jan 2026 16:01:06 -0500 Subject: [PATCH] Adapt to rename of protocol::authority. --- src/protocols/protocol_block_in_106.cpp | 22 ++++++++--------- src/protocols/protocol_block_in_31800.cpp | 24 +++++++++---------- src/protocols/protocol_block_out_106.cpp | 6 ++--- src/protocols/protocol_header_in_31800.cpp | 20 ++++++++-------- src/protocols/protocol_header_in_70012.cpp | 2 +- src/protocols/protocol_header_out_31800.cpp | 2 +- src/protocols/protocol_header_out_70012.cpp | 4 ++-- src/protocols/protocol_observer.cpp | 6 ++--- src/protocols/protocol_performer.cpp | 4 ++-- .../protocol_transaction_out_106.cpp | 4 ++-- 10 files changed, 47 insertions(+), 47 deletions(-) diff --git a/src/protocols/protocol_block_in_106.cpp b/src/protocols/protocol_block_in_106.cpp index ddb3e4629..25af131da 100644 --- a/src/protocols/protocol_block_in_106.cpp +++ b/src/protocols/protocol_block_in_106.cpp @@ -81,14 +81,14 @@ bool protocol_block_in_106::handle_receive_inventory(const code& ec, if (!tracker_.ids.empty()) { LOGP("Unrequested (" << block_count << ") block inventory from [" - << authority() << "] with (" << tracker_.ids.size() + << opposite() << "] with (" << tracker_.ids.size() << ") pending."); return true; } const auto getter = create_get_data(*message); LOGP("Received (" << block_count << ") block inventory from [" - << authority() << "] with (" << getter.items.size() + << opposite() << "] with (" << getter.items.size() << ") new blocks."); // 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, // A non-maximal inventory has no new blocks, assume complete. // Inventory completeness assumes empty response if caught up at 500. - LOGP("Completed block inventory from [" << authority() << "]."); + LOGP("Completed block inventory from [" << opposite() << "]."); return true; } LOGP("Requested (" << getter.items.size() << ") blocks from [" - << authority() << "]."); + << opposite() << "]."); // Track inventory and request blocks (to_hashes order is reversed). tracker_.announced = block_count; @@ -136,7 +136,7 @@ bool protocol_block_in_106::handle_receive_block(const code& ec, if (tracker_.ids.find(block_ptr->get_hash()) == tracker_.ids.end()) { LOGP("Unrequested block [" << encode_hash(block_ptr->get_hash()) - << "] from [" << authority() << "]."); + << "] from [" << opposite() << "]."); return true; } @@ -176,12 +176,12 @@ void protocol_block_in_106::do_handle_organize(const code& ec, size_t height, // Many peers blindly broadcast blocks even at/above v31800, ugh. // If we are not caught up on headers this is useless information. LOGP("Block [" << encode_hash(block_ptr->get_hash()) << "] from [" - << authority() << "] " << ec.message()); + << opposite() << "] " << ec.message()); } else { LOGR("Block [" << encode_hash(block_ptr->hash()) << ":" << height - << "] from [" << authority() << "] " << ec.message()); + << "] from [" << opposite() << "] " << ec.message()); } stop(ec); @@ -189,7 +189,7 @@ void protocol_block_in_106::do_handle_organize(const code& ec, size_t height, } LOGP("Block [" << encode_hash(block_ptr->get_hash()) << ":" << height - << "] from [" << authority() << "]."); + << "] from [" << opposite() << "]."); // Completion of tracked inventory. if (tracker_.ids.empty()) @@ -203,7 +203,7 @@ void protocol_block_in_106::do_handle_organize(const code& ec, size_t height, { // Completeness stalls if on 500 as empty message is ambiguous. // This is ok, since complete is not used for anything essential. - LOGP("Completed blocks from [" << authority() << "] with (" + LOGP("Completed blocks from [" << opposite() << "] with (" << tracker_.announced << ") announced."); } } @@ -238,13 +238,13 @@ get_blocks protocol_block_in_106::create_get_inventory( if (hashes.size() == one) { LOGP("Request block inventory after [" << encode_hash(hashes.front()) - << "] from [" << authority() << "]."); + << "] from [" << opposite() << "]."); } else { LOGP("Request block inventory (" << hashes.size() << ") after [" << encode_hash(hashes.front()) << "] from [" - << authority() << "]."); + << opposite() << "]."); } return { std::move(hashes) }; diff --git a/src/protocols/protocol_block_in_31800.cpp b/src/protocols/protocol_block_in_31800.cpp index 51c0ed151..82ca22e63 100644 --- a/src/protocols/protocol_block_in_31800.cpp +++ b/src/protocols/protocol_block_in_31800.cpp @@ -183,7 +183,7 @@ void protocol_block_in_31800::do_purge(peer_t) NOEXCEPT if (!map_->empty()) { - LOGV("Purge work (" << map_->size() << ") from [" << authority() << "]."); + LOGV("Purge work (" << map_->size() << ") from [" << opposite() << "]."); map_->clear(); stop(error::sacrificed_channel); } @@ -196,7 +196,7 @@ void protocol_block_in_31800::do_split(peer_t) NOEXCEPT if (stopped()) return; - LOGV("Divide work (" << map_->size() << ") from [" << authority() << "]."); + LOGV("Divide work (" << map_->size() << ") from [" << opposite() << "]."); restore(chaser_check::split(map_)); restore(map_); map_ = chaser_check::empty_map(); @@ -209,7 +209,7 @@ void protocol_block_in_31800::do_report(count_t sequence) NOEXCEPT // Uses application logging since it outputs to a runtime option. LOGA("Work report [" << sequence << "] is (" << map_->size() << ") for [" - << authority() << "]."); + << opposite() << "]."); } // request hashes @@ -279,7 +279,7 @@ bool protocol_block_in_31800::handle_receive_block(const code& ec, { // Allow unrequested block, not counted toward performance. LOGR("Unrequested block [" << encode_hash(hash) << "] from [" - << authority() << "]."); + << opposite() << "]."); return true; } @@ -302,7 +302,7 @@ bool protocol_block_in_31800::handle_receive_block(const code& ec, code == system::error::invalid_witness_commitment) { LOGR("Malleated block [" << encode_hash(hash) << ":" << height - << "] from [" << authority() << "] " << code.message() + << "] from [" << opposite() << "] " << code.message() << " txs(" << block->transactions() << ")" << " segregated(" << block->is_segregated() << ")."); stop(code); @@ -316,7 +316,7 @@ bool protocol_block_in_31800::handle_receive_block(const code& ec, } LOGR("Block failed check [" << encode_hash(hash) << ":" << height - << "] from [" << authority() << "] " << code.message()); + << "] from [" << opposite() << "] " << code.message()); notify(error::success, chase::unchecked, link); fire(events::block_unconfirmable, height); stop(code); @@ -329,7 +329,7 @@ bool protocol_block_in_31800::handle_receive_block(const code& ec, if (const auto code = query.set_code(*block, link, checked)) { LOGF("Failure storing block [" << encode_hash(hash) << ":" << height - << "] from [" << authority() << "] " << code.message()); + << "] from [" << opposite() << "] " << code.message()); stop(fault(code)); return false; @@ -339,7 +339,7 @@ bool protocol_block_in_31800::handle_receive_block(const code& ec, // ........................................................................ LOGP("Downloaded block [" << encode_hash(hash) << ":" << height - << "] from [" << authority() << "]."); + << "] from [" << opposite() << "]."); notify(ec, chase::checked, height); fire(events::block_archived, height); @@ -388,18 +388,18 @@ void protocol_block_in_31800::restore(const map_ptr& map) NOEXCEPT void protocol_block_in_31800::handle_put_hashes(const code& ec, size_t count) NOEXCEPT { - LOGV("Put (" << count << ") work for [" << authority() << "]."); + LOGV("Put (" << count << ") work for [" << opposite() << "]."); if (ec) { - LOGF("Error putting work for [" << authority() << "] " << ec.message()); + LOGF("Error putting work for [" << opposite() << "] " << ec.message()); } } void protocol_block_in_31800::handle_get_hashes(const code& ec, const map_ptr& map, const job::ptr& job) NOEXCEPT { - LOGV("Got (" << map->size() << ") work for [" << authority() << "]."); + LOGV("Got (" << map->size() << ") work for [" << opposite() << "]."); if (stopped()) { @@ -409,7 +409,7 @@ void protocol_block_in_31800::handle_get_hashes(const code& ec, if (ec) { - LOGF("Error getting work for [" << authority() << "] " << ec.message()); + LOGF("Error getting work for [" << opposite() << "] " << ec.message()); stop(ec); return; } diff --git a/src/protocols/protocol_block_out_106.cpp b/src/protocols/protocol_block_out_106.cpp index 037992047..004761ff4 100644 --- a/src/protocols/protocol_block_out_106.cpp +++ b/src/protocols/protocol_block_out_106.cpp @@ -131,7 +131,7 @@ bool protocol_block_out_106::handle_receive_get_blocks(const code& ec, return false; LOGP("Get headers above " << encode_hash(message->start_hash()) - << " from [" << authority() << "]."); + << " from [" << opposite() << "]."); SEND(create_inventory(*message), handle_send, _1); return true; @@ -178,7 +178,7 @@ void protocol_block_out_106::send_block(const code& ec, size_t index, const auto witness = item.is_witness_type(); if (!node_witness_ && witness) { - LOGR("Unsupported witness get_data from [" << authority() << "]."); + LOGR("Unsupported witness get_data from [" << opposite() << "]."); stop(network::error::protocol_violation); return; } @@ -192,7 +192,7 @@ void protocol_block_out_106::send_block(const code& ec, size_t index, if (!ptr) { LOGR("Requested block " << encode_hash(item.hash) - << " from [" << authority() << "] not found."); + << " from [" << opposite() << "] not found."); // This block could not have been advertised to the peer. stop(system::error::not_found); diff --git a/src/protocols/protocol_header_in_31800.cpp b/src/protocols/protocol_header_in_31800.cpp index f2b0c1cf1..8094a687d 100644 --- a/src/protocols/protocol_header_in_31800.cpp +++ b/src/protocols/protocol_header_in_31800.cpp @@ -63,7 +63,7 @@ bool protocol_header_in_31800::handle_receive_headers(const code& ec, return false; LOGP("Headers (" << message->header_ptrs.size() << ") from [" - << authority() << "]."); + << opposite() << "]."); // Store each header, drop channel if invalid. for (const auto& ptr: message->header_ptrs) @@ -89,7 +89,7 @@ bool protocol_header_in_31800::handle_receive_headers(const code& ec, { // Protocol presumes max_get_headers unless complete. // Completeness assumes empty response from peer if caught up at 2000. - LOGP("Completed headers from [" << authority() << "]."); + LOGP("Completed headers from [" << opposite() << "]."); complete(); } @@ -111,12 +111,12 @@ void protocol_header_in_31800::handle_organize(const code& ec, if (is_zero(height)) { LOGP("Header [" << encode_hash(header_ptr->get_hash()) << "] from [" - << authority() << "] " << ec.message()); + << opposite() << "] " << ec.message()); } else { LOGR("Header [" << encode_hash(header_ptr->get_hash()) << ":" - << height << "] from [" << authority() << "] " << ec.message()); + << height << "] from [" << opposite() << "] " << ec.message()); } stop(ec); @@ -124,7 +124,7 @@ void protocol_header_in_31800::handle_organize(const code& ec, } LOGP("Header [" << encode_hash(header_ptr->get_hash()) << ":" << height - << "] from [" << authority() << "] " << ec.message()); + << "] from [" << opposite() << "] " << ec.message()); } // 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 { subscribed = true; SUBSCRIBE_CHANNEL(inventory, handle_receive_inventory, _1, _2); - LOGP("Subscribed to block announcements at [" << authority() << "]."); + LOGP("Subscribed to block announcements at [" << opposite() << "]."); } } @@ -199,13 +199,13 @@ get_headers protocol_header_in_31800::create_get_headers( if (is_one(hashes.size())) { LOGP("Request headers after [" << encode_hash(hashes.front()) - << "] from [" << authority() << "]."); + << "] from [" << opposite() << "]."); } else { - LOGP("Request headers (" << hashes.size() << ") after [" - << encode_hash(hashes.front()) << "] from [" - << authority() << "]."); + LOGP("Request headers (" << hashes.size() + << ") after [" << encode_hash(hashes.front()) + << "] from [" << opposite() << "]."); } return { std::move(hashes) }; diff --git a/src/protocols/protocol_header_in_70012.cpp b/src/protocols/protocol_header_in_70012.cpp index 0470c8e84..bcad7c82f 100644 --- a/src/protocols/protocol_header_in_70012.cpp +++ b/src/protocols/protocol_header_in_70012.cpp @@ -36,7 +36,7 @@ void protocol_header_in_70012::complete() NOEXCEPT { subscribed = true; SEND(send_headers{}, handle_send, _1); - LOGP("Subscribed to header announcements at [" << authority() << "]."); + LOGP("Subscribed to header announcements at [" << opposite() << "]."); } // Must come after subscribed is updated. diff --git a/src/protocols/protocol_header_out_31800.cpp b/src/protocols/protocol_header_out_31800.cpp index 22bcc95fa..927a7746a 100644 --- a/src/protocols/protocol_header_out_31800.cpp +++ b/src/protocols/protocol_header_out_31800.cpp @@ -60,7 +60,7 @@ bool protocol_header_out_31800::handle_receive_get_headers(const code& ec, return false; LOGP("Get headers above " << encode_hash(message->start_hash()) - << " from [" << authority() << "]."); + << " from [" << opposite() << "]."); SEND(create_headers(*message), handle_send, _1); return true; diff --git a/src/protocols/protocol_header_out_70012.cpp b/src/protocols/protocol_header_out_70012.cpp index cb12f8521..3bee8281c 100644 --- a/src/protocols/protocol_header_out_70012.cpp +++ b/src/protocols/protocol_header_out_70012.cpp @@ -100,7 +100,7 @@ bool protocol_header_out_70012::do_announce(header_t link) NOEXCEPT if (was_announced(hash)) { LOGP("Suppress " << encode_hash(hash) << " to [" - << authority() << "]."); + << opposite() << "]."); return true; } @@ -112,7 +112,7 @@ bool protocol_header_out_70012::do_announce(header_t link) NOEXCEPT return true; } - LOGN("Announce " << encode_hash(hash) << " to [" << authority() << "]."); + LOGN("Announce " << encode_hash(hash) << " to [" << opposite() << "]."); SEND(headers{ { ptr } }, handle_send, _1); return true; } diff --git a/src/protocols/protocol_observer.cpp b/src/protocols/protocol_observer.cpp index e0c79e8e1..084bd00eb 100644 --- a/src/protocols/protocol_observer.cpp +++ b/src/protocols/protocol_observer.cpp @@ -109,7 +109,7 @@ bool protocol_observer::handle_receive_inventory(const code& ec, // Common with Satoshi 25.0 and 25.1. if (relay_disallowed_ && message->any_transaction()) { - LOGR("Unrequested tx relay from [" << authority() << "] " + LOGR("Unrequested tx relay from [" << opposite() << "] " << peer_version()->user_agent); stop(network::error::protocol_violation); @@ -119,7 +119,7 @@ bool protocol_observer::handle_receive_inventory(const code& ec, ////// Witness types never allowed in inventory (wxtid excluded). ////if (message->any_witness()) ////{ - //// LOGR("Unsupported witness inventory from [" << authority() << "]."); + //// LOGR("Unsupported witness inventory from [" << opposite() << "]."); //// stop(network::error::protocol_violation); //// return false; ////} @@ -138,7 +138,7 @@ bool protocol_observer::handle_receive_inventory(const code& ec, //// // Witness types only allowed in get_data if witness service advertised. //// if (!node_witness_ && message->any_witness()) //// { -//// LOGR("Unsupported witness get_data from [" << authority() << "]."); +//// LOGR("Unsupported witness get_data from [" << authority42() << "]."); //// stop(network::error::protocol_violation); //// return false; //// } diff --git a/src/protocols/protocol_performer.cpp b/src/protocols/protocol_performer.cpp index 0160f92fa..6edb8f23d 100644 --- a/src/protocols/protocol_performer.cpp +++ b/src/protocols/protocol_performer.cpp @@ -135,14 +135,14 @@ void protocol_performer::do_handle_performance(const code& ec) NOEXCEPT // Caused only by performance(zero|xxx) - had outstanding work. if (ec == error::stalled_channel || ec == error::slow_channel) { - LOGP("Channel dropped [" << authority() << "] " << ec.message()); + LOGP("Channel dropped [" << opposite() << "] " << ec.message()); stop(ec); return; } if (ec) { - LOGF("Performance failure [" << authority() << "] " << ec.message()); + LOGF("Performance failure [" << opposite() << "] " << ec.message()); stop(ec); return; } diff --git a/src/protocols/protocol_transaction_out_106.cpp b/src/protocols/protocol_transaction_out_106.cpp index b34591360..6ebee78c8 100644 --- a/src/protocols/protocol_transaction_out_106.cpp +++ b/src/protocols/protocol_transaction_out_106.cpp @@ -163,7 +163,7 @@ void protocol_transaction_out_106::send_transaction(const code& ec, const auto witness = item.is_witness_type(); if (!node_witness_ && witness) { - LOGR("Unsupported witness get_data from [" << authority() << "]."); + LOGR("Unsupported witness get_data from [" << opposite() << "]."); stop(network::error::protocol_violation); return; } @@ -176,7 +176,7 @@ void protocol_transaction_out_106::send_transaction(const code& ec, if (!ptr) { LOGR("Requested tx " << encode_hash(item.hash) - << " from [" << authority() << "] not found."); + << " from [" << opposite() << "] not found."); // This tx could not have been advertised to the peer. stop(system::error::not_found);