Changeset View
Changeset View
Standalone View
Standalone View
src/node/transaction.cpp
// Copyright (c) 2010 Satoshi Nakamoto | // Copyright (c) 2010 Satoshi Nakamoto | ||||
// Copyright (c) 2009-2018 The Bitcoin Core developers | // Copyright (c) 2009-2018 The Bitcoin Core developers | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
#include <node/transaction.h> | #include <node/transaction.h> | ||||
#include <config.h> | #include <config.h> | ||||
#include <consensus/validation.h> | #include <consensus/validation.h> | ||||
#include <net.h> | #include <net.h> | ||||
#include <net_processing.h> | |||||
#include <primitives/txid.h> | #include <primitives/txid.h> | ||||
#include <txmempool.h> | #include <txmempool.h> | ||||
#include <util/validation.h> | #include <util/validation.h> | ||||
#include <validation.h> | #include <validation.h> | ||||
#include <validationinterface.h> | #include <validationinterface.h> | ||||
#include <future> | #include <future> | ||||
▲ Show 20 Lines • Show All 52 Lines • ▼ Show 20 Lines | TransactionError BroadcastTransaction(const Config &config, | ||||
} // cs_main | } // cs_main | ||||
promise.get_future().wait(); | promise.get_future().wait(); | ||||
if (!g_connman) { | if (!g_connman) { | ||||
return TransactionError::P2P_DISABLED; | return TransactionError::P2P_DISABLED; | ||||
} | } | ||||
CInv inv(MSG_TX, txid); | RelayTransaction(txid, *g_connman); | ||||
g_connman->ForEachNode([&inv](CNode *pnode) { pnode->PushInventory(inv); }); | |||||
return TransactionError::OK; | return TransactionError::OK; | ||||
} | } |