Beispiel #1
0
bool backend_cluster::process_as_reply(const incoming_message& response)
{
    auto handle_it = handlers_.find(response.id());
    // Unknown response. Not in our map.
    if (handle_it == handlers_.end())
        return false;
    handle_it->second(response.data(), response.origin());
    handlers_.erase(handle_it);
    size_t n_erased = retry_queue_.erase(response.id());
    BITCOIN_ASSERT(n_erased == 1);
    return true;
}
Beispiel #2
0
outgoing_message::outgoing_message(
    const incoming_message& request, const data_chunk& data)
  : dest_(request.origin()), command_(request.command()),
    id_(request.id()), data_(data)
{
}