If a transaction is already in the block chain, and all of its outputs are spent, the BroadcastTransaction()
fails to detect the correct transaction status. It returns TransactionError::MISSING_INPUTS
instead of TransactionError::ALREADY_IN_CHAIN
.
The related code: https://github.com/bitcoin/bitcoin/blob/80fd474e402bb003c3a427f1997eb649e69138ba/src/node/transaction.cpp#L32-L37
I think that TransactionError::ALREADY_IN_CHAIN
should be returned in all cases when the transaction is in the block chain, or it should be dropped from the code at all as inconsistent.
What are other opinions?