コード例 #1
0
void address_subscriber::post_updates(
    const bc::payment_address& address, const worker_uuid& worker,
    size_t height, const bc::hash_digest& blk_hash,
    const bc::transaction_type& tx)
{
    for (const subscription& sub: subs_)
    {
        if (!stealth_match(sub.prefix, address.hash().data()))
            continue;
        sub.handle_update(std::error_code(), height, blk_hash, tx);
    }
}
コード例 #2
0
ファイル: Watcher.cpp プロジェクト: MoeAfilal/airbitz-core
void Watcher::send_watch_addr(bc::payment_address address, unsigned poll_ms)
{
    std::lock_guard<std::mutex> lock(socket_mutex_);

    std::basic_ostringstream<uint8_t> stream;
    auto serial = bc::make_serializer(std::ostreambuf_iterator<uint8_t>(stream));
    serial.write_byte(msg_watch_addr);
    serial.write_byte(address.version());
    serial.write_short_hash(address.hash());
    serial.write_4_bytes(poll_ms);
    auto str = stream.str();
    socket_.send(str.data(), str.size());
}