Skip to content

Commit

Permalink
Merge pull request #1020 from AntelopeIO/GH-767-p2p-net-opt
Browse files Browse the repository at this point in the history
P2P:  Inform peer if not accepting transactions
  • Loading branch information
heifner authored Apr 12, 2023
2 parents dec181b + 3e1f05b commit be11e4f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion plugins/net_plugin/net_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3598,7 +3598,11 @@ namespace eosio {
hello.token = sha256();
hello.p2p_address = my_impl->p2p_address;
if( is_transactions_only_connection() ) hello.p2p_address += ":trx";
if( is_blocks_only_connection() ) hello.p2p_address += ":blk";
// if we are not accepting transactions tell peer we are blocks only
if( is_blocks_only_connection() || !my_impl->p2p_accept_transactions ) hello.p2p_address += ":blk";
if( !is_blocks_only_connection() && !my_impl->p2p_accept_transactions ) {
peer_dlog( this, "p2p-accept-transactions=false inform peer blocks only connection ${a}", ("a", hello.p2p_address) );
}
hello.p2p_address += " - " + hello.node_id.str().substr(0,7);
#if defined( __APPLE__ )
hello.os = "osx";
Expand Down

0 comments on commit be11e4f

Please sign in to comment.