Bitcoin full node and query server

Dec 18, 2018

View in context in the libbitcoin Slack #general mirror.

neillm13:55
@Julian The broadcast call can only tell you if it failed (or succeeded) to broadcast the tx. There's no way to determine which nodes think it's valid from that call. You could verify the tx before broadcast, which can tell you if your node think it's valid.
J
Julian23:55
(and you distinguish based on the value of the error code).
I think this is what I'm having trouble with. Can I assume that any of these error codes are related to verifying the transaction? Also, what if there's a network error when sending the transaction to the libbitcoin-server? Is there something similar to:
...
auto on_error = [](const bc::code& ec) {
    if (bc::is_network_error(ec)) {
        // network error handling
    }
    if (bc::is_validation_error(ec)) {
        // validation error handling
    }
    // do on_error
};

auto on_done = [](const bc::code& ec) {
    if (bc::is_network_error(ec)) {
        // network error handling
    }
    if (bc::is_validation_error(ec)) {
        // validation error handling
    }
    // do on_done
};

client.transaction_pool_broadcast(on_error, on_done, transaction);
...
(edited)