Part of https://github.com/bitcoin-core/gui-qml/issues/1008.
The QML GUI shows "Transaction sent" even when the node rejected the transaction, because CWallet::CommitTransaction() only logs the rejection and returns void.
This PR bubbles up the submission result through interfaces::Wallet::commitTransaction() so the GUI can report it.
Key changes
- Introduce
TransactionBroadcastError, holding aTransactionErrorcode and an untranslated message. - Commit/Broadcast functions returns
Expected<void, TransactionBroadcastError>.- Remove
TransactionError::OK, a success value in an error enum.
- Remove
- Add a
SUBMISSION_SKIPPEDcode for when the wallet doesn't submit the transaction (broadcasting disabled, abandoned, coinbase, confirmed or conflicted).SubmitTxMemoryPoolAndRelay()previously returnedfalsein these cases.
Note
- Existing callers (wallet RPCs, Qt widgets, fee bumper) ignore the new result, so their behavior and RPC responses don't change.
commitBumpTransaction()similarly reports success for a rejected replacement. This will be addressed in a follow-up PR.- gui-qml will need to update its
interfaces::Walletmock for the newcommitTransaction()signature.