mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-19 14:53:43 +01:00
validation: Remove RECENT_CONSENSUS_CHANGE validation result
The *_RECENT_CONSENSUS_CHANGE variants in the validation result enumerations were always unused. They seem to have been kept around speculatively for a soft fork after segwit, however they were never used for taproot either. This points at them not having a clear purpose. Based on the original pull requests' comments their usage was never entirely clear: https://github.com/bitcoin/bitcoin/pull/11639#issuecomment-370234133 https://github.com/bitcoin/bitcoin/pull/15141#discussion_r271039747 Since they are part of the validation interface and need to exposed by the kernel library keeping them around may also be confusing to future users of the library.
This commit is contained in:
@@ -2201,15 +2201,9 @@ bool CheckInputScripts(const CTransaction& tx, TxValidationState& state,
|
||||
// string by reporting the error from the second check.
|
||||
error = check2.GetScriptError();
|
||||
}
|
||||
|
||||
// MANDATORY flag failures correspond to
|
||||
// TxValidationResult::TX_CONSENSUS. Because CONSENSUS
|
||||
// failures are the most serious case of validation
|
||||
// failures, we may need to consider using
|
||||
// RECENT_CONSENSUS_CHANGE for any script failure that
|
||||
// could be due to non-upgraded nodes which we may want to
|
||||
// support, to avoid splitting the network (but this
|
||||
// depends on the details of how net_processing handles
|
||||
// such errors).
|
||||
// TxValidationResult::TX_CONSENSUS.
|
||||
return state.Invalid(TxValidationResult::TX_CONSENSUS, strprintf("mandatory-script-verify-flag-failed (%s)", ScriptErrorString(error)));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user