Changeset View
Changeset View
Standalone View
Standalone View
src/policy/policy.cpp
Show All 31 Lines | bool IsStandard(const CScript &scriptPubKey, txnouttype &whichType) { | ||||
if (!Solver(scriptPubKey, whichType, vSolutions)) return false; | if (!Solver(scriptPubKey, whichType, vSolutions)) return false; | ||||
if (whichType == TX_MULTISIG) { | if (whichType == TX_MULTISIG) { | ||||
uint8_t m = vSolutions.front()[0]; | uint8_t m = vSolutions.front()[0]; | ||||
uint8_t n = vSolutions.back()[0]; | uint8_t n = vSolutions.back()[0]; | ||||
// Support up to x-of-3 multisig txns as standard | // Support up to x-of-3 multisig txns as standard | ||||
if (n < 1 || n > 3) return false; | if (n < 1 || n > 3) return false; | ||||
if (m < 1 || m > n) return false; | if (m < 1 || m > n) return false; | ||||
} else if (whichType == TX_NULL_DATA && | } else if (whichType == TX_NULL_DATA) { | ||||
(!fAcceptDatacarrier || | if (!fAcceptDatacarrier) { | ||||
scriptPubKey.size() > nMaxDatacarrierBytes)) | |||||
return false; | return false; | ||||
} | |||||
unsigned nMaxDatacarrierBytes = | |||||
gArgs.GetArg("-datacarriersize", MAX_OP_RETURN_RELAY); | |||||
if (scriptPubKey.size() > nMaxDatacarrierBytes) { | |||||
return false; | |||||
} | |||||
} | |||||
return whichType != TX_NONSTANDARD; | return whichType != TX_NONSTANDARD; | ||||
} | } | ||||
bool IsStandardTx(const CTransaction &tx, std::string &reason) { | bool IsStandardTx(const CTransaction &tx, std::string &reason) { | ||||
if (tx.nVersion > CTransaction::MAX_STANDARD_VERSION || tx.nVersion < 1) { | if (tx.nVersion > CTransaction::MAX_STANDARD_VERSION || tx.nVersion < 1) { | ||||
reason = "version"; | reason = "version"; | ||||
return false; | return false; | ||||
▲ Show 20 Lines • Show All 94 Lines • Show Last 20 Lines |