View in context in the libbitcoin Slack #general mirror.
(and you distinguish based on the value of the error code).
...
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)