code handle(std::istream& stream, Subscriber subscriber) const { const auto message_ptr = std::make_shared<Message>(); const bool parsed = message_ptr->from_data(stream); const code ec(parsed ? error::success : error::bad_stream); subscriber->do_relay(ec, message_ptr); return ec; }
bool stealth_record::from_data(reader& source, bool wire) { if (!wire) return from_data(source, 0, {}); reset(); unsigned_ephemeral_ = source.read_hash(); public_key_hash_ = source.read_short_hash(); transaction_hash_ = source.read_hash(); if (!source) reset(); return source; }
bool block_transactions::from_data(uint32_t version, const data_chunk& data) { data_source istream(data); return from_data(version, istream); }
bool stealth_record::from_data(std::istream& stream, bool wire) { istream_reader source(stream); return from_data(source, wire); }
bool alert_payload::from_data(const data_chunk& data) { boost::iostreams::stream<byte_source<data_chunk>> istream(data); return from_data(istream); }
bool alert::from_data(uint32_t version, std::istream& stream) { istream_reader source(stream); return from_data(version, source); }
bool nonce_::from_data(const data_chunk& data) { data_source istream(data); return from_data(istream); }
bool block::from_data(const data_chunk& data, bool with_transaction_count) { data_source istream(data); return from_data(istream, with_transaction_count); }
bool output::from_data(std::istream& stream) { istream_reader source(stream); return from_data(source); }
bool version::from_data(std::istream& stream) { istream_reader source(stream); return from_data(source); }
bool version::from_data(const data_chunk& data) { data_source istream(data); return from_data(istream); }
bool reject::from_data(const data_chunk& data) { boost::iostreams::stream<byte_source<data_chunk>> istream(data); return from_data(istream); }
bool heading::from_data(std::istream& stream) { istream_reader source(stream); return from_data(source); }
bool get_address::from_data(uint32_t version, std::istream& stream) { istream_reader source(stream); return from_data(version, source); }
bool filter_load::from_data(std::istream& stream) { istream_reader source(stream); return from_data(source); }
bool block_transactions::from_data(uint32_t version, std::istream& stream) { istream_reader source(stream); return from_data(version, source); }
bool output::from_data(const data_chunk& data) { data_source istream(data); return from_data(istream); }
bool block::from_data(std::istream& stream) { istream_reader source(stream); return from_data(source); }
bool headers::from_data(const data_chunk& data) { data_source istream(data); return from_data(istream); }
bool point::from_data(const data_chunk& data, bool wire) { data_source istream(data); return from_data(istream, wire); }
bool block::from_data(std::istream& stream, bool with_transaction_count) { istream_reader source(stream); return from_data(source, with_transaction_count); }
bool point::from_data(std::istream& stream, bool wire) { istream_reader source(stream); return from_data(source, wire); }
bool nonce_::from_data(std::istream& stream) { istream_reader source(stream); return from_data(source); }
bool filter_clear::from_data(uint32_t version, const data_chunk& data) { data_source istream(data); return from_data(version, istream); }
bool alert::from_data(uint32_t version, const data_chunk& data) { data_source istream(data); return from_data(version, istream); }
bool filter_clear::from_data(uint32_t version, std::istream& stream) { istream_reader source(stream); return from_data(version, source); }
bool alert_payload::from_data(std::istream& stream) { istream_reader source(stream); return from_data(source); }
bool stealth_record::from_data(const data_chunk& data, bool wire) { data_source istream(data); return from_data(istream, wire); }