Changeset View
Changeset View
Standalone View
Standalone View
src/node/transaction.cpp
Show All 17 Lines | |||||
#include <future> | #include <future> | ||||
TransactionError BroadcastTransaction(NodeContext &node, const Config &config, | TransactionError BroadcastTransaction(NodeContext &node, const Config &config, | ||||
const CTransactionRef tx, | const CTransactionRef tx, | ||||
std::string &err_string, | std::string &err_string, | ||||
const Amount max_tx_fee, bool relay, | const Amount max_tx_fee, bool relay, | ||||
bool wait_callback) { | bool wait_callback) { | ||||
// BroadcastTransaction can be called by either sendrawtransaction RPC or | |||||
// wallet RPCs. node.connman is assigned both before chain clients and | |||||
// before RPC server is accepting calls, and reset after chain clients and | |||||
// RPC sever are stopped. node.connman should never be null here. | |||||
assert(node.connman); | assert(node.connman); | ||||
std::promise<void> promise; | std::promise<void> promise; | ||||
TxId txid = tx->GetId(); | TxId txid = tx->GetId(); | ||||
bool callback_set = false; | bool callback_set = false; | ||||
{ // cs_main scope | { // cs_main scope | ||||
LOCK(cs_main); | LOCK(cs_main); | ||||
// If the transaction is already confirmed in the chain, don't do | // If the transaction is already confirmed in the chain, don't do | ||||
▲ Show 20 Lines • Show All 58 Lines • Show Last 20 Lines |