@@ -72,28 +72,34 @@ void protocol_version_70016::shake(result_handler&& handle_event) NOEXCEPT
7272 if (started ())
7373 return ;
7474
75+ SUBSCRIBE_CHANNEL (send_address_v2, handle_receive_send_address_v2, _1, _2);
76+ SUBSCRIBE_CHANNEL (witness_tx_id_relay, handle_receive_witness_tx_id_relay, _1, _2);
77+
7578 // Protocol versions are cumulative, but reject is optional.
7679 if (reject_)
7780 {
7881 protocol_version_70002::shake (std::move (handle_event));
7982 return ;
8083 }
81-
84+
8285 protocol_version_70001::shake (std::move (handle_event));
8386}
8487
8588// Incoming [send_address_v2 => negotiated state change].
8689// Incoming [witness_tx_id_relay => negotiated state change].
8790// ----------------------------------------------------------------------------
8891
89- void protocol_version_70016::handle_send_version (const code& ec) NOEXCEPT
90- {
91- BC_ASSERT_MSG (stranded (), " protocol_version_70016" );
92-
93- SUBSCRIBE_CHANNEL (send_address_v2, handle_receive_send_address_v2, _1, _2);
94- SUBSCRIBE_CHANNEL (witness_tx_id_relay, handle_receive_witness_tx_id_relay, _1, _2);
95- protocol_version_70002::handle_send_version (ec);
96- }
92+ // //void protocol_version_70016::handle_send_version(const code& ec) NOEXCEPT
93+ // //{
94+ // // BC_ASSERT_MSG(stranded(), "protocol_version_70016");
95+ // //
96+ // // // BUGBUG: subtle race here, as the peer can send these after receiving
97+ // // // version but before this methods is invoked, despite both being stranded.
98+ // // // The resolution is to subscribe these in method where version is sent.
99+ // // SUBSCRIBE_CHANNEL(send_address_v2, handle_receive_send_address_v2, _1, _2);
100+ // // SUBSCRIBE_CHANNEL(witness_tx_id_relay, handle_receive_witness_tx_id_relay, _1, _2);
101+ // // protocol_version_70002::handle_send_version(ec);
102+ // //}
97103
98104bool protocol_version_70016::handle_receive_acknowledge (const code& ec,
99105 const messages::peer::version_acknowledge::cptr& message) NOEXCEPT
0 commit comments