From: CryptoManiac Date: Fri, 19 Feb 2016 17:04:45 +0000 (+0300) Subject: Raw transactions: TX_PUBKEY_DROP parsing X-Git-Tag: nvc-v0.5.6~68 X-Git-Url: https://git.novaco.in/?p=novacoin.git;a=commitdiff_plain;h=c69eb1bd70e0dc94095d63b0de50dc8d2910ea0e Raw transactions: TX_PUBKEY_DROP parsing --- diff --git a/src/rpcrawtransaction.cpp b/src/rpcrawtransaction.cpp index fd40d5f..4bcf911 100644 --- a/src/rpcrawtransaction.cpp +++ b/src/rpcrawtransaction.cpp @@ -40,6 +40,16 @@ void ScriptPubKeyToJSON(const CScript& scriptPubKey, Object& out, bool fIncludeH out.push_back(Pair("reqSigs", nRequired)); out.push_back(Pair("type", GetTxnOutputType(type))); + if (type == TX_PUBKEY_DROP) + { + vector vSolutions; + if (!Solver(scriptPubKey, type, vSolutions)) + { + out.push_back(Pair("keyVariant", HexStr(vSolutions[0]))); + out.push_back(Pair("R", HexStr(vSolutions[1]))); + } + } + Array a; BOOST_FOREACH(const CTxDestination& addr, addresses) a.push_back(CBitcoinAddress(addr).ToString()); diff --git a/src/script.cpp b/src/script.cpp index b79dc23..e8bfab5 100644 --- a/src/script.cpp +++ b/src/script.cpp @@ -1507,14 +1507,9 @@ isminetype IsMine(const CKeyStore &keystore, const CScript& scriptPubKey) case TX_PUBKEY_DROP: { CPubKey key = CPubKey(vSolutions[0]); - if (keystore.HaveKey(key.GetID())) + CPubKey R = CPubKey(vSolutions[1]); + if (keystore.CheckOwnership(key, R)) return MINE_SPENDABLE; - else - { - CPubKey R = CPubKey(vSolutions[1]); - if (keystore.CheckOwnership(key, R)) - return MINE_SPENDABLE; - } } break; case TX_PUBKEYHASH: @@ -1559,7 +1554,7 @@ bool ExtractDestination(const CScript& scriptPubKey, CTxDestination& addressRet) if (!Solver(scriptPubKey, whichType, vSolutions)) return false; - if (whichType == TX_PUBKEY || whichType == TX_PUBKEY_DROP) + if (whichType == TX_PUBKEY) { addressRet = CPubKey(vSolutions[0]).GetID(); return true; @@ -1623,7 +1618,7 @@ bool ExtractDestinations(const CScript& scriptPubKey, txnouttype& typeRet, vecto vector vSolutions; if (!Solver(scriptPubKey, typeRet, vSolutions)) return false; - if (typeRet == TX_NULL_DATA) + if (typeRet == TX_NULL_DATA || typeRet == TX_PUBKEY_DROP) return true; if (typeRet == TX_MULTISIG)