[Dev] Documenting Feathercoin Specific Software settings - Part 5
-
Feathercoin specific changes made to convert Bitcoin to FTC 0.9.6.*
Add QR-Snap : - commit
https://github.com/FeatherCoin/Feathercoin/commit/8ba72918a0710ef66df39a5df97725b1a7b740b4
src/qt/snapwidget.h
New file
+ // Copyright (c) 2013-2014 The Feathercoin developers + + #ifndef SNAPWIDGET_H + #define SNAPWIDGET_H + #include "ui_snapwidget.h" + #include "addressbookpage.h" + + class SnapWidget :public QDialog, public Ui::SnapWidget + { + Q_OBJECT + public: + + SnapWidget(QWidget* _parent); + ~SnapWidget(); + void prepareMask(); + virtual void closeEvent(QCloseEvent *event); + void resizeEvent(QResizeEvent*); + public slots: + void on_cancelButton_clicked(); + void on_snapButton_clicked(); + + + signals: + void finished(QString s); + + public: + QString decodedString; + + }; + #endif // SNAPWIDGET_H
New file code
-
Feathercoin specific changes made to convert Bitcoin to FTC 0.9.6.*
Add QR-Snap : - commit
https://github.com/FeatherCoin/Feathercoin/commit/8ba72918a0710ef66df39a5df97725b1a7b740b4
src/qt/walletmodel.cpp
+#include "init.h"
Code added
+ // Get required locks upfront. This avoids the GUI from getting stuck on + // periodical polls if the core is holding the locks for a longer time - + // for example, during a wallet rescan. + TRY_LOCK(cs_main, lockMain); + if(!lockMain) + return; + TRY_LOCK(wallet->cs_wallet, lockWallet); + if(!lockWallet) + return; +
Code added
+ checkBalanceChanged(); + if(transactionTableModel) + transactionTableModel->updateConfirmations();
Code added
+ bool WalletModel::importPrivateKey(QString privKey) + { + CBitcoinSecret vchSecret; + bool fGood = vchSecret.SetString(privKey.toStdString()); + if (!fGood) + return false; + CKey key = vchSecret.GetKey(); + CPubKey pubkey = key.GetPubKey(); + CKeyID vchAddress = pubkey.GetID(); + { + LOCK2(cs_main, pwalletMain->cs_wallet); + pwalletMain->MarkDirty(); + pwalletMain->SetAddressBook(vchAddress, ("imported wallet"),"send"); + if (!pwalletMain->AddKeyPubKey(key, pubkey)) + return false; + pwalletMain->ScanForWalletTransactions(chainActive.Genesis(), true); + pwalletMain->ReacceptWalletTransactions(); + //printf("importing walling with public key %s\n", vchAddress.ToString().c_str()); + } + return true; + } +
Code added
+ LOCK2(cs_main, wallet->cs_wallet); + LOCK2(cs_main, wallet->cs_wallet); + LOCK2(cs_main, wallet->cs_wallet); // ListLockedCoins, mapWallet
Wallet lock interface change, numerous lock -> lock2 updates.
-
Feathercoin specific changes made to convert Bitcoin to FTC 0.9.6.*
Add QR-Snap : - commit
https://github.com/FeatherCoin/Feathercoin/commit/8ba72918a0710ef66df39a5df97725b1a7b740b4
src/qt/walletmodel.h
+#pragma warning(disable:4717) //bogus warning from MS
Add code
+ bool importPrivateKey(QString privKey);
Add code
-
Feathercoin specific changes made to convert Bitcoin to FTC 0.9.6.*
Add QR-Snap : - commit
https://github.com/FeatherCoin/Feathercoin/commit/8ba72918a0710ef66df39a5df97725b1a7b740b4
src/qt/walletview.cpp
+ connect(receiveCoinsPage, SIGNAL(importWallet(QString)), this, SLOT(importWallet(QString))); + // Clicking on "Send to QR" sends you to the send coins tab after snapping and reading image + connect(sendCoinsPage, SIGNAL(sendCoins(QString)), this, SLOT(gotoSendCoinsPage(QString)));
Code added
- connect(walletModel, SIGNAL(showProgress(QString,int)), this, SLOT(showProgress(QString,int))); + connect(walletModel, SIGNAL(showProgress(QString,int)), this, SLOT(showProgress(QString,int)));
Code replaced ??
+ void WalletView::importWallet(QString privateKey) + { + if(!walletModel) + return; + + bool b =walletModel->importPrivateKey(privateKey); + } +
Code added
-
Feathercoin specific changes made to convert Bitcoin to FTC 0.9.6.*
Add QR-Snap : - commit
https://github.com/FeatherCoin/Feathercoin/commit/8ba72918a0710ef66df39a5df97725b1a7b740b4
src/qt/walletview.h
QR codes first commit
+ /** Import a wallet from a string */ + void importWallet(QString privateKey);
Code added
-
- Copyright was updated in a later commit
- the zxing flag was removed in a later commit
- qrflag triggers use of zxing then