mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-06 10:42:46 +01:00
rpc: clarify ALREADY_IN_CHAIN rpc errors
When using `sendrawtransaction` the ALREADY_IN_CHAIN error help string may be confusing. Rename TransactionError::ALREADY_IN_CHAIN to TransactionError::ALREADY_IN_UTXO_SET and update the rpc help string. Remove backwards compatibility alias as no longer required.
This commit is contained in:
@@ -55,7 +55,7 @@ TransactionError BroadcastTransaction(NodeContext& node, const CTransactionRef t
|
||||
const Coin& existingCoin = view.AccessCoin(COutPoint(txid, o));
|
||||
// IsSpent doesn't mean the coin is spent, it means the output doesn't exist.
|
||||
// So if the output does exist, then this transaction exists in the chain.
|
||||
if (!existingCoin.IsSpent()) return TransactionError::ALREADY_IN_CHAIN;
|
||||
if (!existingCoin.IsSpent()) return TransactionError::ALREADY_IN_UTXO_SET;
|
||||
}
|
||||
|
||||
if (auto mempool_tx = node.mempool->get(txid); mempool_tx) {
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace node {
|
||||
enum class TransactionError {
|
||||
OK, //!< No error
|
||||
MISSING_INPUTS,
|
||||
ALREADY_IN_CHAIN,
|
||||
ALREADY_IN_UTXO_SET,
|
||||
MEMPOOL_REJECTED,
|
||||
MEMPOOL_ERROR,
|
||||
MAX_FEE_EXCEEDED,
|
||||
|
||||
Reference in New Issue
Block a user