@ -51,13 +51,10 @@ bool Solver(const CScript& scriptPubKey, txnouttype& typeRet, vector<vector<unsi
// Sender provides N pubkeys, receivers provides M signatures
// Sender provides N pubkeys, receivers provides M signatures
mTemplates . insert ( make_pair ( TX_MULTISIG , CScript ( ) < < OP_SMALLINTEGER < < OP_PUBKEYS < < OP_SMALLINTEGER < < OP_CHECKMULTISIG ) ) ;
mTemplates . insert ( make_pair ( TX_MULTISIG , CScript ( ) < < OP_SMALLINTEGER < < OP_PUBKEYS < < OP_SMALLINTEGER < < OP_CHECKMULTISIG ) ) ;
// Empty, provably prunable, data-carrying output
if ( GetBoolArg ( " -datacarrier " , true ) )
mTemplates . insert ( make_pair ( TX_NULL_DATA , CScript ( ) < < OP_RETURN < < OP_SMALLDATA ) ) ;
mTemplates . insert ( make_pair ( TX_NULL_DATA , CScript ( ) < < OP_RETURN ) ) ;
}
}
vSolutionsRet . clear ( ) ;
// Shortcut for pay-to-script-hash, which are more constrained than the other types:
// Shortcut for pay-to-script-hash, which are more constrained than the other types:
// it is always OP_HASH160 20 [20 byte hash] OP_EQUAL
// it is always OP_HASH160 20 [20 byte hash] OP_EQUAL
if ( scriptPubKey . IsPayToScriptHash ( ) )
if ( scriptPubKey . IsPayToScriptHash ( ) )
@ -68,6 +65,16 @@ bool Solver(const CScript& scriptPubKey, txnouttype& typeRet, vector<vector<unsi
return true ;
return true ;
}
}
// Provably prunable, data-carrying output
//
// So long as script passes the IsUnspendable() test and all but the first
// byte passes the IsPushOnly() test we don't care what exactly is in the
// script.
if ( scriptPubKey . size ( ) > = 1 & & scriptPubKey [ 0 ] = = OP_RETURN & & scriptPubKey . IsPushOnly ( scriptPubKey . begin ( ) + 1 ) ) {
typeRet = TX_NULL_DATA ;
return true ;
}
// Scan templates
// Scan templates
const CScript & script1 = scriptPubKey ;
const CScript & script1 = scriptPubKey ;
BOOST_FOREACH ( const PAIRTYPE ( txnouttype , CScript ) & tplate , mTemplates )
BOOST_FOREACH ( const PAIRTYPE ( txnouttype , CScript ) & tplate , mTemplates )
@ -140,12 +147,6 @@ bool Solver(const CScript& scriptPubKey, txnouttype& typeRet, vector<vector<unsi
else
else
break ;
break ;
}
}
else if ( opcode2 = = OP_SMALLDATA )
{
// small pushdata, <= nMaxDatacarrierBytes
if ( vch1 . size ( ) > nMaxDatacarrierBytes )
break ;
}
else if ( opcode1 ! = opcode2 | | vch1 ! = vch2 )
else if ( opcode1 ! = opcode2 | | vch1 ! = vch2 )
{
{
// Others must match exactly
// Others must match exactly