[Dev] Documenting Feathercoin Specific Software settings - Part 8
-
Feathercoin specific changes made to convert Bitcoin to FTC 0.9.6.*
Fix sx and CKey/CPubKey : - commit
https://github.com/FeatherCoin/Feathercoin/commit/55252135009938926532ddeabb3ac52d991b4381
src/keystore.cpp
+bool CBasicKeyStore::AddKey(const CKey& key)
Code replaced
+ bool fCompressed = false; + CSecret secret = key.GetSecret(fCompressed); + { + LOCK(cs_KeyStore); + mapKeys[key.GetPubKey().GetID()] = make_pair(secret, fCompressed); + }
Code replaced
+ { + LOCK(cs_KeyStore); + mapScripts[redeemScript.GetID()] = redeemScript; + }
Code replaced
+ bool result; + { + LOCK(cs_KeyStore); + result = (mapScripts.count(hash) > 0); + } + return result;
Code replaced
+ LOCK(cs_KeyStore); + ScriptMap::const_iterator mi = mapScripts.find(hash); + if (mi != mapScripts.end()) + { + redeemScriptOut = (*mi).second; + return true;
Code replaced
-
Feathercoin specific changes made to convert Bitcoin to FTC 0.9.6.*
Fix sx and CKey/CPubKey : - commit
https://github.com/FeatherCoin/Feathercoin/commit/55252135009938926532ddeabb3ac52d991b4381
src/keystore.h
+ //virtual bool AddKeyPubKey(const CKey &key, const CPubKey &pubkey) =0; + //virtual bool AddKey(const CKey &key); + virtual bool AddKey(const CKey& key) =0;
Code replaced
+ + virtual bool GetSecret(const CKeyID &address, CSecret& vchSecret, bool &fCompressed) const + { + CKey key; + if (!GetKey(address, key)) + return false; + vchSecret = key.GetSecret(fCompressed); + return true; + }
Code replaced
+//typedef std::map<CKeyID, CKey> KeyMap; +typedef std::map<CKeyID, std::pair<CSecret, bool> > KeyMap;
Code replaced
+ //bool AddKeyPubKey(const CKey& key, const CPubKey &pubkey); + bool AddKey(const CKey& key);
Code replaced
+ keyOut.Reset(); + keyOut.SetSecret((*mi).second.first, (*mi).second.second);
Code replaced
-
Feathercoin specific changes made to convert Bitcoin to FTC 0.9.6.*
Fix sx and CKey/CPubKey : - commit
https://github.com/FeatherCoin/Feathercoin/commit/55252135009938926532ddeabb3ac52d991b4381
src/qt/bitcoingui.cpp
+ debugAction = new QAction(QIcon(":/icons/sx"), tr("&SX Tool"), this); + debugAction->setStatusTip(tr("SX Tool"));
Code replaced
-
Feathercoin specific changes made to convert Bitcoin to FTC 0.9.6.*
Fix sx and CKey/CPubKey : - commit
https://github.com/FeatherCoin/Feathercoin/commit/55252135009938926532ddeabb3ac52d991b4381
src/qt/bitcoingui.cpp
+ #include "stealth.h" + #include "base58.h" + #include "wallet.h" + #include "walletmodel.h" + #include "init.h"
Code added
+ + if (ui->addressEdit->text().length()>=75) + { + CStealthAddress sxAddr; + if (sxAddr.SetEncoded(ui->addressEdit->text().toStdString())) + { + ui->lblPubkey->setText(""); + ui->lblPrikey->setText(""); + ui->lblScanPubkey->setText(HexStr(sxAddr.scan_pubkey).c_str()); + ui->lblScanSecret->setText(HexStr(sxAddr.scan_secret).c_str()); + ui->lblSpendPubkey->setText(HexStr(sxAddr.spend_pubkey).c_str()); + ui->lblSpendSecret->setText(HexStr(sxAddr.spend_secret).c_str()); + } + } + else + { + CBitcoinAddress address(ui->addressEdit->text().toStdString()); + CKeyID keyID; + if ( !address.GetKeyID(keyID) ) + { + QMessageBox::warning(this, windowTitle(), + tr("Address \"%1\" doesn't have public key ").arg(ui->addressEdit->text()), + QMessageBox::Ok, QMessageBox::Ok); + return; + } + CPubKey vchPubKey; + if ( !pwalletMain->GetPubKey(keyID, vchPubKey)) + { + QMessageBox::warning(this, windowTitle(), + tr("Address \"%1\" doesn't have public key ").arg(ui->addressEdit->text()), + QMessageBox::Ok, QMessageBox::Ok); + return; + } + CSecret vchSecret; + bool fCompressed; + if (!pwalletMain->GetSecret(keyID, vchSecret, fCompressed)) + { + QMessageBox::warning(this, windowTitle(), + tr("Address \"%1\" doesn't have private key ").arg(ui->addressEdit->text()), + QMessageBox::Ok, QMessageBox::Ok); + return; + } + ui->lblPubkey->setText(HexStr(vchPubKey).c_str()); + ui->lblPrikey->setText(CBitcoinSecret(vchSecret, fCompressed).ToString().c_str()); + GUIUtil::setClipboard(QString::fromStdString(HexStr(vchPubKey))); + + ui->lblScanPubkey->setText(""); + ui->lblScanSecret->setText(""); + ui->lblSpendPubkey->setText(""); + ui->lblSpendSecret->setText(""); + }
Code added
-
Feathercoin specific changes made to convert Bitcoin to FTC 0.9.6.*
Fix sx and CKey/CPubKey : - commit
https://github.com/FeatherCoin/Feathercoin/commit/55252135009938926532ddeabb3ac52d991b4381
src/qt/feathercoin.qrc
+ <file alias="sx">res/icons/sx.png</file>
Code added
-
Feathercoin specific changes made to convert Bitcoin to FTC 0.9.6.*
Fix sx and CKey/CPubKey : - commit
https://github.com/FeatherCoin/Feathercoin/commit/55252135009938926532ddeabb3ac52d991b4381
src/qt/forms/debugdialog.ui
+ <string>Stealth Transaction Tool (experts only!)</string> + <string>Find My Stealth Transactions From Height:</string>
GUI changes done through Qt
-
Feathercoin specific changes made to convert Bitcoin to FTC 0.9.6.*
Fix sx and CKey/CPubKey : - commit
https://github.com/FeatherCoin/Feathercoin/commit/55252135009938926532ddeabb3ac52d991b4381
src/qt/forms/editaddressdialog.ui
+ <item row="3" column="0"> + <widget class="QLabel" name="label_3"> + <property name="text"> + <string>Public Key</string> + </property> + </widget> + </item> + <item row="4" column="0"> + <widget class="QLabel" name="label_4"> + <property name="text"> + <string>Private Key</string>
Various UI changes
-
Feathercoin specific changes made to convert Bitcoin to FTC 0.9.6.*
Fix sx and CKey/CPubKey : - commit
https://github.com/FeatherCoin/Feathercoin/commit/55252135009938926532ddeabb3ac52d991b4381
src/qt/locale/bitcoin_zh_CN.ts
Translation file
+ <source>&SX Tool</source> + <translation>隐身交易助手</translation> + </message> + <message>
Code added
+ <name>DebugDialog</name> + <message> + <source>Exit</source> + <translation>关闭</translation> + </message> + <message> + <source>Stealth Transaction Tool (experts only!)</source> + <translation>隐身交易助手(仅专家)</translation> + </message> + <message> + <source>Find My Stealth Transactions From Height:</source> + <translation>在块链中查找我的隐身交易,从开始块号</translation> + </message> + <message> + <source>To</source> + <translation>到</translation> + </message> + <message> + <source>Ending Height must be greater than beginning Height !</source> + <translation>结束块号必须大于开始块号</translation> + </message> + <message> + <source>Beginning Height must be greater than 556535.</source> + <translation>开始块号必须大于556535。</translation> + </message> + <message> + <source>Scan stealth transactions on blockchain,Yes!!!</source> + <translation>从块链中扫描隐身交易,完毕!</translation> + </message> + <message> + <source>Wallet Message</source> + <translation>钱包信息</translation> + </message> + <message> + <source>Block Number</source> + <translation>块编号</translation> + </message> + <message> + <source>Scan Stealth Transactions</source> + <translation>开始扫描隐身交易</translation> + </message> + </context> + <context>
Code added
-
Feathercoin specific changes made to convert Bitcoin to FTC 0.9.6.*
Fix sx and CKey/CPubKey : - commit
https://github.com/FeatherCoin/Feathercoin/commit/55252135009938926532ddeabb3ac52d991b4381
src/qt/res/icons/*
src/qt/res/icons/sx.png
icon file added
-
Feathercoin specific changes made to convert Bitcoin to FTC 0.9.6.*
Fix sx and CKey/CPubKey : - commit
https://github.com/FeatherCoin/Feathercoin/commit/55252135009938926532ddeabb3ac52d991b4381
src/qt/signverifymessagedialog.cpp
+ //CPubKey pubkey; + CKey key; + //if (!pubkey.RecoverCompact(Hash(ss.begin(), ss.end()), vchSig)) + if (!key.SetCompactSignature(Hash(ss.begin(), ss.end()), vchSig))
Code replaced
+ //if (!(CBitcoinAddress(pubkey.GetID()) == addr)) + if (!(CBitcoinAddress(key.GetPubKey().GetID()) == addr))
Code replaced