X-Git-Url: https://git.novaco.in/?p=novacoin.git;a=blobdiff_plain;f=src%2Fqt%2Fcoincontroldialog.cpp;h=998a992914ae0701aea841fcf8b8823b3c28a4ce;hp=ae73042b5207a1e4984cf59f5b69d2b556791015;hb=9c9ba366ebc85b0d8eef6d962a9fa84cffe0cae7;hpb=9179b06d4a286cd2555df1d94cf8772c918e81d3 diff --git a/src/qt/coincontroldialog.cpp b/src/qt/coincontroldialog.cpp index ae73042..998a992 100644 --- a/src/qt/coincontroldialog.cpp +++ b/src/qt/coincontroldialog.cpp @@ -631,6 +631,7 @@ void CoinControlDialog::updateView() itemOutput->setCheckState(COLUMN_CHECKBOX,Qt::Unchecked); // address +/* CTxDestination outputAddress; QString sAddress = ""; if(ExtractDestination(out.tx->vout[out.i].scriptPubKey, outputAddress)) @@ -646,6 +647,52 @@ void CoinControlDialog::updateView() if (keyid && model->getPubKey(*keyid, pubkey) && !pubkey.IsCompressed()) nInputSize = 180; } +*/ + QString sAddress = ""; + txnouttype whichType; + std::vector vSolutions; + if (Solver(out.tx->vout[out.i].scriptPubKey, whichType, vSolutions)) + { + CTxDestination address; + if (whichType == TX_PUBKEY) + { + // Pay-to-Pubkey + CPubKey pubKey = CPubKey(vSolutions[0]); + address = pubKey.GetID(); + sAddress = CBitcoinAddress(address).ToString().c_str(); + + if (!pubKey.IsCompressed()) + nInputSize = 180; + } + else if (whichType == TX_PUBKEYHASH) + { + // Pay-to-PubkeyHash + address = CKeyID(uint160(vSolutions[0])); + sAddress = CBitcoinAddress(address).ToString().c_str(); + + CPubKey pubkey; + CKeyID *keyid = boost::get< CKeyID >(&address); + if (keyid && model->getPubKey(*keyid, pubkey) && !pubkey.IsCompressed()) + nInputSize = 180; + } + else if (whichType == TX_SCRIPTHASH) + { + // Pay-to-ScriptHash + address = CScriptID(uint160(vSolutions[0])); + sAddress = CBitcoinAddress(address).ToString().c_str(); + } + else if (whichType == TX_PUBKEY_DROP) + { + // Pay-to-Pubkey-R + CMalleableKeyView view; + pwalletMain->CheckOwnership(CPubKey(vSolutions[0]), CPubKey(vSolutions[1]), view); + sAddress = view.GetMalleablePubKey().ToString().c_str(); + } + + // if listMode or change => show bitcoin address. In tree mode, address is not shown again for direct wallet address outputs + if (!treeMode || (!(sAddress == sWalletAddress))) + itemOutput->setText(COLUMN_ADDRESS, sAddress); + } // label if (!(sAddress == sWalletAddress)) // change