aboutsummaryrefslogtreecommitdiff
path: root/src/policy/policy.cpp
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2018-04-29 19:34:57 -0400
committerMarcoFalke <falke.marco@gmail.com>2018-05-29 16:49:52 -0400
commitfa7a6cf1b36284db70e941bd2915fd6edbb0f9d6 (patch)
tree7a69ae65066c91fec3f7a0c23debf8905d793f55 /src/policy/policy.cpp
parent3a8e3f480612e29f5a8b208f31cedc687f66b9df (diff)
policy: Treat segwit as always active
Diffstat (limited to 'src/policy/policy.cpp')
-rw-r--r--src/policy/policy.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/policy/policy.cpp b/src/policy/policy.cpp
index 5963bf371a..aac3fe5c14 100644
--- a/src/policy/policy.cpp
+++ b/src/policy/policy.cpp
@@ -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;
}