diff options
| author | Gavin Andresen <[email protected]> | 2013-11-01 12:06:03 +1000 |
|---|---|---|
| committer | Gavin Andresen <[email protected]> | 2013-11-01 12:13:38 +1000 |
| commit | 837369806ac39717b3294e5b698307f0f0011a6d (patch) | |
| tree | 66ea7ef00247c589ac7ebf9e3466e892f730b8a0 /src/script.cpp | |
| parent | Merge pull request #3114 (diff) | |
| parent | Show short scriptPubKeys correctly (diff) | |
| download | discoin-837369806ac39717b3294e5b698307f0f0011a6d.tar.xz discoin-837369806ac39717b3294e5b698307f0f0011a6d.zip | |
Merge pull request #3128
0056095 Show short scriptPubKeys correctly (Peter Todd)
22de68d Relay OP_RETURN TxOut as standard transaction type (Peter Todd)
Signed-off-by: Gavin Andresen <[email protected]>
Diffstat (limited to 'src/script.cpp')
| -rw-r--r-- | src/script.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/script.cpp b/src/script.cpp index 63f632795..ec9e9d61d 100644 --- a/src/script.cpp +++ b/src/script.cpp @@ -1195,7 +1195,7 @@ bool CheckSig(vector<unsigned char> vchSig, const vector<unsigned char> &vchPubK bool Solver(const CScript& scriptPubKey, txnouttype& typeRet, vector<vector<unsigned char> >& vSolutionsRet) { // Templates - static map<txnouttype, CScript> mTemplates; + static multimap<txnouttype, CScript> mTemplates; if (mTemplates.empty()) { // Standard tx, sender provides pubkey, receiver adds signature @@ -1209,6 +1209,7 @@ bool Solver(const CScript& scriptPubKey, txnouttype& typeRet, vector<vector<unsi // Empty, provably prunable, data-carrying output mTemplates.insert(make_pair(TX_NULL_DATA, CScript() << OP_RETURN << OP_SMALLDATA)); + mTemplates.insert(make_pair(TX_NULL_DATA, CScript() << OP_RETURN)); } // Shortcut for pay-to-script-hash, which are more constrained than the other types: @@ -1392,9 +1393,8 @@ int ScriptSigArgsExpected(txnouttype t, const std::vector<std::vector<unsigned c switch (t) { case TX_NONSTANDARD: - return -1; case TX_NULL_DATA: - return 1; + return -1; case TX_PUBKEY: return 1; case TX_PUBKEYHASH: @@ -1532,8 +1532,10 @@ bool ExtractDestinations(const CScript& scriptPubKey, txnouttype& typeRet, vecto vector<valtype> vSolutions; if (!Solver(scriptPubKey, typeRet, vSolutions)) return false; - if (typeRet == TX_NULL_DATA) - return true; + if (typeRet == TX_NULL_DATA){ + // This is data, not addresses + return false; + } if (typeRet == TX_MULTISIG) { |