Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions src/protocols/protocol_transaction_out_106.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,19 @@ void protocol_transaction_out_106::start() NOEXCEPT

// Events subscription is asynchronous, events may be missed.
subscribe_chase(BIND(handle_chase, _1, _2, _3));

SUBSCRIBE_BROADCAST(transaction, handle_broadcast_transaction, _1, _2, _3);
SUBSCRIBE_CHANNEL(get_data, handle_receive_get_data, _1, _2);
protocol_peer::start();
}

void protocol_transaction_out_106::stopping(const code& ec) NOEXCEPT
{
// Unsubscriber race is ok.
BC_ASSERT(stranded());

// Unsubscriber race is ok.
unsubscribe_chase();

UNSUBSCRIBE_BROADCAST();
protocol_peer::stopping(ec);
}
Expand Down Expand Up @@ -95,12 +98,11 @@ bool protocol_transaction_out_106::handle_chase(const code&, chase event_,
bool protocol_transaction_out_106::do_announce(transaction_t link) NOEXCEPT
{
BC_ASSERT(stranded());
const auto& query = archive();

if (stopped())
return false;

return announce(query.get_tx_key(link));
return announce(archive().get_tx_key(link));
}

bool protocol_transaction_out_106::handle_broadcast_transaction(const code& ec,
Expand All @@ -114,9 +116,6 @@ bool protocol_transaction_out_106::handle_broadcast_transaction(const code& ec,
if (sender == identifier())
return true;

if (!message || !message->transaction_ptr)
return true;

return announce(message->transaction_ptr->hash(false));
}

Expand Down
Loading