aboutsummaryrefslogtreecommitdiff
path: root/src/rpc
diff options
context:
space:
mode:
authorAntoine Riard <ariard@student.42.fr>2019-04-11 14:37:30 +0000
committerAntoine Riard <ariard@student.42.fr>2019-08-01 13:43:26 -0400
commit8c8aa19b4b4fa56cd359092ef099bcfc7b26c334 (patch)
treee534b3c295f52f3ab25e122256ebb753716a5850 /src/rpc
parent7821821a23b68cc9ec49d69829ad4c939cb762e8 (diff)
downloadbitcoin-8c8aa19b4b4fa56cd359092ef099bcfc7b26c334.tar.xz
Add BroadcastTransaction utility usage in Chain interface
Access through a broadcastTransaction method. Add a wait_callback flag to turn off race protection when wallet already track its tx being in mempool Standardise highfee, absurdfee variable name to max_tx_fee We drop the P2P check in BroadcastTransaction as g_connman is only called by RPCs and the wallet scheduler, both of which are initialized after g_connman is assigned and stopped before g_connman is reset.
Diffstat (limited to 'src/rpc')
-rw-r--r--src/rpc/rawtransaction.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/rpc/rawtransaction.cpp b/src/rpc/rawtransaction.cpp
index 0ab504de06..b8ec2178d2 100644
--- a/src/rpc/rawtransaction.cpp
+++ b/src/rpc/rawtransaction.cpp
@@ -810,14 +810,14 @@ static UniValue sendrawtransaction(const JSONRPCRequest& request)
max_raw_tx_fee = fr.GetFee((weight+3)/4);
}
- uint256 txid;
std::string err_string;
- const TransactionError err = BroadcastTransaction(tx, txid, err_string, max_raw_tx_fee);
+ AssertLockNotHeld(cs_main);
+ const TransactionError err = BroadcastTransaction(tx, err_string, max_raw_tx_fee, /*relay*/ true, /*wait_callback*/ true);
if (TransactionError::OK != err) {
throw JSONRPCTransactionError(err, err_string);
}
- return txid.GetHex();
+ return tx->GetHash().GetHex();
}
static UniValue testmempoolaccept(const JSONRPCRequest& request)