policy: Treat segwit as always active
This commit is contained in:
@@ -54,7 +54,7 @@ bool IsDust(const CTxOut& txout, const CFeeRate& dustRelayFeeIn)
|
||||
return (txout.nValue < GetDustThreshold(txout, dustRelayFeeIn));
|
||||
}
|
||||
|
||||
bool IsStandard(const CScript& scriptPubKey, txnouttype& whichType, const bool witnessEnabled)
|
||||
bool IsStandard(const CScript& scriptPubKey, txnouttype& whichType)
|
||||
{
|
||||
std::vector<std::vector<unsigned char> > vSolutions;
|
||||
if (!Solver(scriptPubKey, whichType, vSolutions))
|
||||
@@ -73,13 +73,10 @@ bool IsStandard(const CScript& scriptPubKey, txnouttype& whichType, const bool w
|
||||
(!fAcceptDatacarrier || scriptPubKey.size() > nMaxDatacarrierBytes))
|
||||
return false;
|
||||
|
||||
else if (!witnessEnabled && (whichType == TX_WITNESS_V0_KEYHASH || whichType == TX_WITNESS_V0_SCRIPTHASH))
|
||||
return false;
|
||||
|
||||
return whichType != TX_NONSTANDARD && whichType != TX_WITNESS_UNKNOWN;
|
||||
}
|
||||
|
||||
bool IsStandardTx(const CTransaction& tx, std::string& reason, const bool witnessEnabled)
|
||||
bool IsStandardTx(const CTransaction& tx, std::string& reason)
|
||||
{
|
||||
if (tx.nVersion > CTransaction::MAX_STANDARD_VERSION || tx.nVersion < 1) {
|
||||
reason = "version";
|
||||
@@ -118,7 +115,7 @@ bool IsStandardTx(const CTransaction& tx, std::string& reason, const bool witnes
|
||||
unsigned int nDataOut = 0;
|
||||
txnouttype whichType;
|
||||
for (const CTxOut& txout : tx.vout) {
|
||||
if (!::IsStandard(txout.scriptPubKey, whichType, witnessEnabled)) {
|
||||
if (!::IsStandard(txout.scriptPubKey, whichType)) {
|
||||
reason = "scriptpubkey";
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user