aboutsummaryrefslogtreecommitdiff
path: root/src/node/transaction.cpp
diff options
context:
space:
mode:
authorMarcoFalke <[email protected]>2019-08-09 09:46:46 -0400
committerMarcoFalke <[email protected]>2019-08-09 09:47:35 -0400
commit9ab9d6356938ffe069ffc005a371d5405976823e (patch)
treed9b74c68f911c04de7800f643c5a977b3a1778de /src/node/transaction.cpp
parentMerge #16574: doc: Add historical release notes for 0.18.1 (diff)
parentRemove p2pEnabled from Chain interface (diff)
downloaddiscoin-9ab9d6356938ffe069ffc005a371d5405976823e.tar.xz
discoin-9ab9d6356938ffe069ffc005a371d5405976823e.zip
Merge #16503: Remove p2pEnabled from Chain interface
b7b9f6e4cee262004643e2fe03d56cb47fdbf5c2 Remove p2pEnabled from Chain interface (Antoine Riard) Pull request description: RPC server starts in warmup mode, it can't process yet calls, then follows connection manager initialization and finally RPC server get out of warmup mode. RPC calls shouldn't be able to get P2P disabled errors because once we initialize g_connman it's not unset until shutdown, after RPC server has been stopped. @mzumsande comment in #15713 let me thought that `p2pEnabled` was maybe useless, `g_connman` is always initialized before RPC server is getting out of warmup. These checks against P2P state were introduced in https://github.com/bitcoin/bitcoin/pull/8085/commits/5b446dd5b11d4f403554bc2dd5a7a94c7d20422a. ACKs for top commit: promag: ACK b7b9f6e4cee262004643e2fe03d56cb47fdbf5c2 jnewbery: ACK b7b9f6e4cee262004643e2fe03d56cb47fdbf5c2 Tree-SHA512: 4de2b9fc496bf8347ff5cc645848a5a44c8ca7596cd134f17f3088f5f8262d1d88b8e2a052df93e309ec9a81956a808df17a9eb9f10d4f4d693c95d607fe3561
Diffstat (limited to 'src/node/transaction.cpp')
-rw-r--r--src/node/transaction.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/node/transaction.cpp b/src/node/transaction.cpp
index 8e5649635..a28136a8e 100644
--- a/src/node/transaction.cpp
+++ b/src/node/transaction.cpp
@@ -16,6 +16,9 @@
TransactionError BroadcastTransaction(const CTransactionRef tx, std::string& err_string, const CAmount& max_tx_fee, bool relay, bool wait_callback)
{
+ // BroadcastTransaction can be called by either sendrawtransaction RPC or wallet RPCs.
+ // g_connman is assigned both before chain clients and before RPC server is accepting calls,
+ // and reset after chain clients and RPC sever are stopped. g_connman should never be null here.
assert(g_connman);
std::promise<void> promise;
uint256 hashTx = tx->GetHash();