Skip to content

Commit bca3627

Browse files
committed
Remove dead code.
1 parent bca3960 commit bca3627

File tree

2 files changed

+1
-36
lines changed

2 files changed

+1
-36
lines changed

include/bitcoin/node/protocols/protocol_block_in.hpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,6 @@ class BCN_API protocol_block_in
6262

6363
void handle_stop(const code& ec);
6464

65-
bool handle_reorganized(code ec, size_t fork_height,
66-
block_const_ptr_list_const_ptr incoming,
67-
block_const_ptr_list_const_ptr outgoing);
68-
6965
full_node& node_;
7066
blockchain::safe_chain& chain_;
7167
bc::atomic<hash_digest> last_locator_top_;

src/protocols/protocol_block_in.cpp

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,6 @@ void protocol_block_in::start()
9696
SEND2(send_headers(), handle_send, _1, send_headers::command);
9797
}
9898

99-
// Subscribe to block acceptance notifications (for gap fill).
100-
chain_.subscribe_reorganize(BIND4(handle_reorganized, _1, _2, _3, _4));
101-
10299
// Send initial get_[blocks|headers] message by simulating first heartbeat.
103100
set_event(error::success);
104101
}
@@ -330,6 +327,7 @@ void protocol_block_in::handle_store_block(const code& ec,
330327
return;
331328
}
332329

330+
// TODO: send reject as applicable.
333331
if (ec)
334332
{
335333
LOG_DEBUG(LOG_NODE)
@@ -356,35 +354,6 @@ void protocol_block_in::handle_store_block(const code& ec,
356354
// Subscription.
357355
//-----------------------------------------------------------------------------
358356

359-
// At least one block was accepted into the chain, originating from any peer.
360-
bool protocol_block_in::handle_reorganized(code ec, size_t fork_height,
361-
block_const_ptr_list_const_ptr incoming, block_const_ptr_list_const_ptr)
362-
{
363-
if (stopped(ec))
364-
return false;
365-
366-
// TODO: differentiate failure conditions and send reject as applicable.
367-
368-
if (ec)
369-
{
370-
LOG_ERROR(LOG_NODE)
371-
<< "Failure handling reorganization for [" << authority() << "] "
372-
<< ec.message();
373-
stop(ec);
374-
return false;
375-
}
376-
377-
////// Report the blocks that originated from this peer.
378-
////// If originating peer is dropped there will be no report here.
379-
////for (const auto block: *incoming)
380-
//// if (block->validation.originator == nonce())
381-
//// LOG_DEBUG(LOG_NODE)
382-
//// << "Reorganized block [" << encode_hash(block->header().hash())
383-
//// << "] from [" << authority() << "].";
384-
385-
return true;
386-
}
387-
388357
void protocol_block_in::handle_stop(const code&)
389358
{
390359
LOG_DEBUG(LOG_NETWORK)

0 commit comments

Comments
 (0)