X-Git-Url: https://git.novaco.in/?p=novacoin.git;a=blobdiff_plain;f=src%2Fqt%2Ftransactionrecord.cpp;h=e28a64bdc37826fc67a87e50353d10a3b9c5b1ad;hp=7c50f91c7b717126bb87c0054a7de37c6ccf2a4d;hb=9c9ba366ebc85b0d8eef6d962a9fa84cffe0cae7;hpb=9179b06d4a286cd2555df1d94cf8772c918e81d3 diff --git a/src/qt/transactionrecord.cpp b/src/qt/transactionrecord.cpp index 7c50f91..e28a64b 100644 --- a/src/qt/transactionrecord.cpp +++ b/src/qt/transactionrecord.cpp @@ -46,48 +46,19 @@ QList TransactionRecord::decomposeTransaction(const CWallet * sub.idx = parts.size(); // sequence number sub.credit = txout.nValue; - txnouttype whichType; - std::vector vSolutions; - if (Solver(txout.scriptPubKey, whichType, vSolutions)) + std::string address; + if (pwalletMain->ExtractAddress(txout.scriptPubKey, address)) { - CTxDestination address; - if (whichType == TX_PUBKEY) - { - // Pay-to-Pubkey - address = CPubKey(vSolutions[0]).GetID(); - sub.type = TransactionRecord::RecvWithAddress; - sub.address = CBitcoinAddress(address).ToString(); - } - else if (whichType == TX_PUBKEYHASH) - { - // Pay-to-PubkeyHash - address = CKeyID(uint160(vSolutions[0])); - sub.type = TransactionRecord::RecvWithAddress; - sub.address = CBitcoinAddress(address).ToString(); - } - else if (whichType == TX_SCRIPTHASH) - { - // Pay-to-ScriptHash - address = CScriptID(uint160(vSolutions[0])); - sub.type = TransactionRecord::RecvWithAddress; - sub.address = CBitcoinAddress(address).ToString(); - } - else if (whichType == TX_PUBKEY_DROP) - { - // Pay-to-Pubkey-R - sub.type = TransactionRecord::RecvWithAddress; - - CMalleableKeyView view; - pwalletMain->CheckOwnership(CPubKey(vSolutions[0]), CPubKey(vSolutions[1]), view); - sub.address = view.GetMalleablePubKey().ToString(); - } - else - { - // Received by IP connection (deprecated features), or a multisignature or other non-simple transaction - sub.type = TransactionRecord::RecvFromOther; - sub.address = mapValue["from"]; - } + sub.type = TransactionRecord::RecvWithAddress; + sub.address = address; } + else + { + // Received by IP connection (deprecated features), or a multisignature or other non-simple transaction + sub.type = TransactionRecord::RecvFromOther; + sub.address = mapValue["from"]; + } + if (wtx.IsCoinBase()) { // Generated (proof-of-work)