mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-23 14:10:15 +01:00
Merge #15408: Remove unused TransactionError constants
fa9b60c842 Remove unused TransactionError constants (MarcoFalke)
Pull request description:
Fixup to #14978, which introduced a bunch of unused enum values, such as `UNKNOWN_ERROR`, `ERROR_COUNT` and `TRANSACTION_ERR_LAST`. None of those have a meaning in the context of an `enum class`, where the compiler can infer if all cases have been covered in a switch-case.
Also, move the global `::maxTxFee` back to the rpc caller, so it can be set on a per call basis (in the future).
Tree-SHA512: 7f1e2d795f1c1278ecd54ddab2b92c2a862f3c637b482d1d008208925befa1c9dd4b3c4bb1bfcbc5ca4b66a41004aaf01ea96ea95236f944250b8a6cf99ff173
This commit is contained in:
10
src/psbt.cpp
10
src/psbt.cpp
@@ -309,21 +309,19 @@ bool FinalizeAndExtractPSBT(PartiallySignedTransaction& psbtx, CMutableTransacti
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CombinePSBTs(PartiallySignedTransaction& out, TransactionError& error, const std::vector<PartiallySignedTransaction>& psbtxs)
|
||||
TransactionError CombinePSBTs(PartiallySignedTransaction& out, const std::vector<PartiallySignedTransaction>& psbtxs)
|
||||
{
|
||||
out = psbtxs[0]; // Copy the first one
|
||||
|
||||
// Merge
|
||||
for (auto it = std::next(psbtxs.begin()); it != psbtxs.end(); ++it) {
|
||||
if (!out.Merge(*it)) {
|
||||
error = TransactionError::PSBT_MISMATCH;
|
||||
return false;
|
||||
return TransactionError::PSBT_MISMATCH;
|
||||
}
|
||||
}
|
||||
if (!out.IsSane()) {
|
||||
error = TransactionError::INVALID_PSBT;
|
||||
return false;
|
||||
return TransactionError::INVALID_PSBT;
|
||||
}
|
||||
|
||||
return true;
|
||||
return TransactionError::OK;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user