Skip to content

Commit 6de63a0

Browse files
MarcoFalkeknst
MarcoFalke
authored andcommitted
Merge bitcoin#20941: rpc: document RPC_TRANSACTION_ALREADY_IN_CHAIN exception
74d23bf rpc: document RPC_TRANSACTION_ALREADY_IN_CHAIN exception (Jarol Rodriguez) Pull request description: It is not documented in the `RPCHelpMan` of `sendrawtransaction` that if you attempt to send a transaction which already exists in a block, an `RPC_TRANSACTION_ALREADY_IN_CHAIN` exception will be raised. It is best to make developers aware of this so that it can be properly caught and avoid any headaches. Closes dashpay#5638 ACKs for top commit: jonatack: ACK 74d23bf Tree-SHA512: d1d5fc242574377c8a76b4ef7b12239996424d8bee186533b5a8fe337bbeb3186e51dbdd28c5eafb982601e44e17b68a7f52db5dd7bc647429f6f95e2de289f6
1 parent 3abd63f commit 6de63a0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/rpc/rawtransaction.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -991,10 +991,11 @@ static UniValue signrawtransactionwithkey(const JSONRPCRequest& request)
991991
UniValue sendrawtransaction(const JSONRPCRequest& request)
992992
{
993993
RPCHelpMan{"sendrawtransaction", "\nSubmit a raw transaction (serialized, hex-encoded) to local node and network.\n"
994-
"\nNote that the transaction will be sent unconditionally to all peers, so using this\n"
994+
"\nThe transaction will be sent unconditionally to all peers, so using this\n"
995995
"for manual rebroadcast may degrade privacy by leaking the transaction's origin, as\n"
996996
"nodes will normally not rebroadcast non-wallet transactions already in their mempool.\n"
997-
"\nAlso see createrawtransaction and signrawtransactionwithkey calls.\n",
997+
"\nA specific exception, RPC_TRANSACTION_ALREADY_IN_CHAIN, may throw if the transaction cannot be added to the mempool.\n"
998+
"\nRelated RPCs: createrawtransaction, signrawtransactionwithkey\n",
998999
{
9991000
{"hexstring", RPCArg::Type::STR_HEX, RPCArg::Optional::NO, "The hex string of the raw transaction"},
10001001
{"maxfeerate", RPCArg::Type::AMOUNT, /* default */ FormatMoney(DEFAULT_MAX_RAW_TX_FEE_RATE.GetFeePerK()),

0 commit comments

Comments
 (0)