Forum Home
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Popular

    [Dev] Documenting Feathercoin Specific Software settings - Part 6

    Technical Development
    1
    50
    10004
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • wrapper
      wrapper Moderators last edited by wrapper

      Feathercoin specific changes made to convert Bitcoin to FTC 0.9.6.*

      Add stealth address : - commit

      https://github.com/FeatherCoin/Feathercoin/commit/e993143a1688a6aa57c03da6f181f8bf2f375bf6

      src/base58.cpp

       +        bool operator()(const CScriptID &id) const { return addr->Set(id); }   
      
       +        bool operator()(const CStealthAddress &stxAddr) const { return false; }
      

      Code added

      1 Reply Last reply Reply Quote 1
      • wrapper
        wrapper Moderators last edited by wrapper

        Feathercoin specific changes made to convert Bitcoin to FTC 0.9.6.*

        Add stealth address : - commit

        https://github.com/FeatherCoin/Feathercoin/commit/e993143a1688a6aa57c03da6f181f8bf2f375bf6

        src/bitcoin-config.h

         +/* Define to 1 libzxing must be available for support */
         +#define USE_ZXING 1
        

        Code added

        1 Reply Last reply Reply Quote 1
        • wrapper
          wrapper Moderators last edited by

          Feathercoin specific changes made to convert Bitcoin to FTC 0.9.6.*

          Add stealth address : - commit

          https://github.com/FeatherCoin/Feathercoin/commit/e993143a1688a6aa57c03da6f181f8bf2f375bf6

          src/crypter.cpp

           +bool CCryptoKeyStore::LockKeyStore()
          

          Code replaced

          1 Reply Last reply Reply Quote 1
          • wrapper
            wrapper Moderators last edited by wrapper

            Feathercoin specific changes made to convert Bitcoin to FTC 0.9.6.*

            Add stealth address : - commit

            https://github.com/FeatherCoin/Feathercoin/commit/e993143a1688a6aa57c03da6f181f8bf2f375bf6

            src/crypter.h

             -    CryptedKeyMap mapCryptedKeys;
             -
             -    CKeyingMaterial vMasterKey;
             -
            

            Code removed

             +     CryptedKeyMap mapCryptedKeys;
             + 
             +     CKeyingMaterial vMasterKey;
             + 
            

            Code added

             +    //bool Lock();
             +    bool LockKeyStore();
            

            code replaced

            1 Reply Last reply Reply Quote 1
            • wrapper
              wrapper Moderators last edited by

              Feathercoin specific changes made to convert Bitcoin to FTC 0.9.6.*

              Add stealth address : - commit

              https://github.com/FeatherCoin/Feathercoin/commit/e993143a1688a6aa57c03da6f181f8bf2f375bf6

              src/key.cpp

               + bool CKey::SetSecret(const CSecret& vchSecret, bool fCompressedIn)
               + {
               +     if (vchSecret.size() != 32)
               +         return false;
               +         
               + 		CECKey key;       
               + 		key.SetSecretBytes(&vchSecret[0]);
               +     
               +     fCompressed = fCompressedIn;
               +     fValid = true;
               + 		return true;
               + 		
               +     /*EC_KEY_free(pkey);
               +     pkey = EC_KEY_new_by_curve_name(NID_secp256k1);
               +     if (pkey == NULL)
               +         return false;
               +     if (vchSecret.size() != 32)
               +         return false;
               +     BIGNUM *bn = BN_bin2bn(&vchSecret[0],32,BN_new());
               +     if (bn == NULL)
               +         return false;
               +     if (!EC_KEY_regenerate_key(pkey,bn))
               +     {
               +         BN_clear_free(bn);
               +         return false;
               +     }
               +     BN_clear_free(bn);
               +     fValid = true;
               +     if (fCompressed )
               +         SetCompressedPubKey();
               +     return true;*/
               + }
               + 
              

              Code added

              1 Reply Last reply Reply Quote 1
              • wrapper
                wrapper Moderators last edited by wrapper

                Feathercoin specific changes made to convert Bitcoin to FTC 0.9.6.*

                Add stealth address : - commit

                https://github.com/FeatherCoin/Feathercoin/commit/e993143a1688a6aa57c03da6f181f8bf2f375bf6

                src/key.h

                 +     std::vector<unsigned char> Raw() const {
                 +     		std::vector<unsigned char> vchPubKey(begin(),end());  
                 +         return vchPubKey;
                 +     }
                 +     
                

                Code added

                  +// CSecret is a serialization of just the secret parameter (32 bytes)
                 +typedef std::vector<unsigned char, secure_allocator<unsigned char> > CSecret;
                

                Code added

                +		bool SetSecret(const CSecret& vchSecret, bool fCompressed = false);
                

                Code added

                1 Reply Last reply Reply Quote 1
                • wrapper
                  wrapper Moderators last edited by wrapper

                  Feathercoin specific changes made to convert Bitcoin to FTC 0.9.6.*

                  Add stealth address : - commit

                  https://github.com/FeatherCoin/Feathercoin/commit/e993143a1688a6aa57c03da6f181f8bf2f375bf6

                  src/main.cpp

                   +    unsigned int nTxnOut = 0;
                  

                  Code added

                   +        {
                           nDataOut++;
                    +        } 
                  

                  Bracketing added

                  1 Reply Last reply Reply Quote 1
                  • wrapper
                    wrapper Moderators last edited by

                    Feathercoin specific changes made to convert Bitcoin to FTC 0.9.6.*

                    Add stealth address : - commit

                    https://github.com/FeatherCoin/Feathercoin/commit/e993143a1688a6aa57c03da6f181f8bf2f375bf6

                    src/qt/addressbookpage.cpp

                     + 		ui->tableView->horizontalHeader()->resizeSection(0, 140);
                     + 		ui->tableView->horizontalHeader()->resizeSection(1, 600);
                    

                    Code added

                    1 Reply Last reply Reply Quote 1
                    • wrapper
                      wrapper Moderators last edited by wrapper

                      Feathercoin specific changes made to convert Bitcoin to FTC 0.9.6.*

                      Add stealth address : - commit

                      https://github.com/FeatherCoin/Feathercoin/commit/e993143a1688a6aa57c03da6f181f8bf2f375bf6

                      src/qt/addresstablemodel.cpp

                      + #include "stealth.h"
                      
                      + bool stealth;
                      

                      Code added

                       +    AddressTableEntry(Type type, const QString &label, const QString &address, const bool &stealth = false):
                       +        type(type), label(label), address(address), stealth(stealth) {}
                      

                      Code replaced

                       +             std::set<CStealthAddress>::iterator it;
                       +             for (it = wallet->stealthAddresses.begin(); it != wallet->stealthAddresses.end();      +      + it)
                       +             {
                       +                 bool fMine = !(it->scan_secret.size() < 1);
                       +                 cachedAddressTable.append(AddressTableEntry(fMine ? AddressTableEntry::Receiving : AddressTableEntry::Sending,
                       +                                   QString::fromStdString(it->label),
                       +                                   QString::fromStdString(it->Encoded()),
                       +                                   true));
                       +             };
                      

                      Code added

                        +    std::string strTemp, strValue;
                      

                      Code added

                       -            wallet->SetAddressBook(curAddress, value.toString().toStdString(), strPurpose);
                      

                      Code removed

                       +             //wallet->SetAddressBook(curAddress, value.toString().toStdString(), strPurpose);
                       +             strTemp = rec->address.toStdString();
                       +             if (IsStealthAddress(strTemp))
                       +             {
                       +                 strValue = value.toString().toStdString();
                       +                 wallet->UpdateStealthAddress(strTemp, strValue, false);
                       +             } else
                       +             {
                       +                 //wallet->SetAddressBookName(CBitcoinAddress(strTemp).Get(), value.toString().toStdString());
                       +                 wallet->SetAddressBook(CBitcoinAddress(strTemp).Get(), value.toString().toStdString(), strPurpose);
                       +    
                      

                      Code added

                       +             std::string sTemp = value.toString().toStdString();
                       +             if (IsStealthAddress(sTemp))
                       +             {
                       +                 printf("IsStealthAddress = INVALID_ADDRESS\n");
                       +                 editStatus = INVALID_ADDRESS;
                       +                 return false;
                       +             }
                      

                      Code added

                       - QString AddressTableModel::addRow(const QString &type, const QString &label, const QString &address)
                       + QString AddressTableModel::addRow(const QString &type, const QString &label, const QString &address, int addressType)
                      

                      Code replaced

                       +      /*  if(!walletModel->validateAddress(address))
                      

                      Code added

                       +         }*/
                       +         if (strAddress.length() > 75)
                       +         {
                       +             CStealthAddress sxAddr;
                       +             if (!sxAddr.SetEncoded(strAddress))
                       +             {
                       +                 editStatus = INVALID_ADDRESS;
                       +                 return QString();
                       +             }
                       +             
                       +             // Check for duplicate addresses
                       +             {
                       +                 LOCK(wallet->cs_wallet);
                       +                 
                       +                 if (wallet->stealthAddresses.count(sxAddr))
                       +                 {
                       +                     editStatus = DUPLICATE_ADDRESS;
                       +                     return QString();
                       +                 };
                       +                 
                       +                 sxAddr.label = strLabel;
                       +                 wallet->AddStealthAddress(sxAddr);
                       +             }
                       +         } else {
                       +             if (!walletModel->validateAddress(address))
                       +             {
                       +                 editStatus = INVALID_ADDRESS;
                       +                 return QString();
                       +             }
                       +             // Check for duplicate addresses
                       +             {
                       +                 LOCK(wallet->cs_wallet);
                       +                 if (wallet->mapAddressBook.count(CBitcoinAddress(strAddress).Get()))
                       +                 {
                       +                     editStatus = DUPLICATE_ADDRESS;
                       +                     return QString();
                       +                 };
                       +                 //wallet->SetAddressBookName(CBitcoinAddress(strAddress).Get(), strLabel);
                       +                 wallet->SetAddressBook(CBitcoinAddress(strAddress).Get(), strLabel,(type == Send ? "send" : "receive"));
                       +             }
                      

                      Code added

                       -        CPubKey newKey;
                       +       /* CPubKey newKey;
                      

                      Code removed

                       +         */
                       +         WalletModel::UnlockContext ctx(walletModel->requestUnlock());
                       +         if(!ctx.isValid())
                       +         {
                       +             // Unlock wallet failed or was cancelled
                       +             editStatus = WALLET_UNLOCK_FAILURE;
                       +             return QString();
                       +         }
                       +         if (addressType == AT_Stealth)
                       +         {
                       +             CStealthAddress newStealthAddr;
                       +             std::string sError;
                       +             if (!wallet->NewStealthAddress(sError, strLabel, newStealthAddr)
                       +                 || !wallet->AddStealthAddress(newStealthAddr))
                       +             {
                       +                 editStatus = KEY_GENERATION_FAILURE;
                       +                 return QString();
                       +             }
                       +             strAddress = newStealthAddr.Encoded();
                       +         } else {
                       +             CPubKey newKey;
                       +             //if(!wallet->GetKeyFromPool(newKey, true))
                       +             if(!wallet->GetKeyFromPool(newKey))
                       +             {
                       +                 editStatus = KEY_GENERATION_FAILURE;
                       +                 return QString();
                       +             }
                       +             strAddress = CBitcoinAddress(newKey.GetID()).ToString();
                       +             
                       +             {
                       +                 LOCK(wallet->cs_wallet);
                       +                 //wallet->SetAddressBookName(CBitcoinAddress(strAddress).Get(), strLabel);
                       +                 wallet->SetAddressBook(CBitcoinAddress(strAddress).Get(), strLabel,(type == Send ? "send" : "receive"));
                       +             }
                       +         }
                      

                      Code added

                      -    {
                      +     /*{
                           LOCK(wallet->cs_wallet);
                            wallet->SetAddressBook(CBitcoinAddress(strAddress).Get(), strLabel,
                                                  (type == Send ? "send" : "receive"));
                      
                       -    }
                       +     }*/
                      

                      Bracketing removed

                       +   /*  {
                               LOCK(wallet->cs_wallet);
                               CBitcoinAddress address_parsed(address.toStdString());
                               std::map<CTxDestination, CAddressBookData>::iterator mi = wallet->mapAddressBook.find(address_parsed.Get());
                               if (mi != wallet->mapAddressBook.end())
                               {
                                   return QString::fromStdString(mi->second.name);
                               }
                       +     }*/
                      

                      Bracketing commented out.

                       +     {
                       +         LOCK(wallet->cs_wallet);
                       +         std::string sAddr = address.toStdString();
                       +         
                       +         if (sAddr.length() > 75)
                       +         {
                       +             CStealthAddress sxAddr;
                       +             if (!sxAddr.SetEncoded(sAddr))
                       +                 return QString();
                       +             
                       +             std::set<CStealthAddress>::iterator it;
                       +             it = wallet->stealthAddresses.find(sxAddr);
                       +             if (it == wallet->stealthAddresses.end())
                       +                 return QString();
                       +             
                       +             return QString::fromStdString(it->label);
                       +         } else
                       +         {
                       +             CBitcoinAddress address_parsed(sAddr);
                       +             std::map<CTxDestination, CAddressBookData>::iterator mi = wallet->mapAddressBook.find(address_parsed.Get());
                       +             if (mi != wallet->mapAddressBook.end())
                       +             {
                       +                 return QString::fromStdString(mi->second.name);
                       +             }
                       +         }
                      

                      Code added

                      1 Reply Last reply Reply Quote 1
                      • wrapper
                        wrapper Moderators last edited by wrapper

                        Feathercoin specific changes made to convert Bitcoin to FTC 0.9.6.*

                        Add stealth address : - commit

                        https://github.com/FeatherCoin/Feathercoin/commit/e993143a1688a6aa57c03da6f181f8bf2f375bf6

                        src/qt/addresstablemodel.h

                         +     enum AddressType {
                         +         AT_Unknown = 0, /**< User specified label */
                         +         AT_Normal = 1,  /**< Bitcoin address */
                         +         AT_Stealth = 2  /**< Stealth address */
                         +     };
                         +     
                        

                        Code added

                         -        Address = 1  /**< Bitcoin address */
                        +        Address = 1,  /**< Bitcoin address */
                        +        Type = 2  /**< Address type  */
                        

                        ? review

                         -    QString addRow(const QString &type, const QString &label, const QString &address);
                         +     //QString addRow(const QString &type, const QString &label, const QString &address);
                         +     QString addRow(const QString &type, const QString &label, const QString &address, int addressType);
                        

                        Bitcoin code commented out, review.

                        1 Reply Last reply Reply Quote 1
                        • wrapper
                          wrapper Moderators last edited by

                          Feathercoin specific changes made to convert Bitcoin to FTC 0.9.6.*

                          Add stealth address : - commit

                          https://github.com/FeatherCoin/Feathercoin/commit/e993143a1688a6aa57c03da6f181f8bf2f375bf6

                          src/qt/bitcoingui.cpp

                           + 	
                           + ActiveLabel::ActiveLabel(const QString & text, QWidget * parent):
                           +     QLabel(parent){}
                           + 
                           + void ActiveLabel::mouseReleaseEvent(QMouseEvent * event)
                           + {
                           +     emit clicked();
                           + }
                          

                          Code added

                           +    walletModel(0),
                          

                          Code added

                          -    labelEncryptionIcon = new QLabel();
                          +    labelEncryptionIcon = new ActiveLabel();
                          

                          Code replaced

                           +    connect(labelEncryptionIcon, SIGNAL(clicked()), unlockWalletAction, SLOT(trigger()));
                          

                          Code added

                           +         disconnect(labelEncryptionIcon, SIGNAL(clicked()), unlockWalletAction, SLOT(trigger()));
                           +         disconnect(labelEncryptionIcon, SIGNAL(clicked()),   lockWalletAction, SLOT(trigger()));
                           +         connect   (labelEncryptionIcon, SIGNAL(clicked()),   lockWalletAction, SLOT(trigger()));
                          

                          Code added

                           +         disconnect(labelEncryptionIcon, SIGNAL(clicked()), unlockWalletAction, SLOT(trigger()));
                           +         disconnect(labelEncryptionIcon, SIGNAL(clicked()),   lockWalletAction, SLOT(trigger()));
                           +         connect   (labelEncryptionIcon, SIGNAL(clicked()), unlockWalletAction, SLOT(trigger()));
                          

                          Code added

                          1 Reply Last reply Reply Quote 0
                          • wrapper
                            wrapper Moderators last edited by wrapper

                            Feathercoin specific changes made to convert Bitcoin to FTC 0.9.6.*

                            Add stealth address : - commit

                            https://github.com/FeatherCoin/Feathercoin/commit/e993143a1688a6aa57c03da6f181f8bf2f375bf6

                            src/qt/bitcoingui.h

                            +#include <QLabel>
                            

                            Code added

                             + class ActiveLabel : public QLabel
                             + {
                             +     Q_OBJECT
                             + public:
                             +     ActiveLabel(const QString & text = "", QWidget * parent = 0);
                             +     ~ActiveLabel(){}
                             + 
                             + signals:
                             +     void clicked();
                             + 
                             + protected:
                             +     void mouseReleaseEvent (QMouseEvent * event) ;
                             + 
                             + };
                             + 
                            

                            Code added

                              -    QLabel *labelEncryptionIcon;
                              +    ActiveLabel *labelEncryptionIcon;
                            

                            Code replaced

                            1 Reply Last reply Reply Quote 0
                            • wrapper
                              wrapper Moderators last edited by

                              Feathercoin specific changes made to convert Bitcoin to FTC 0.9.6.*

                              Add stealth address : - commit

                              https://github.com/FeatherCoin/Feathercoin/commit/e993143a1688a6aa57c03da6f181f8bf2f375bf6

                              src/qt/editaddressdialog.cpp

                               +         ui->addressEdit->setVisible(false);
                               +         ui->stealthCB->setEnabled(true);
                               +         ui->stealthCB->setVisible(true);
                              
                               +         ui->stealthCB->setVisible(false);
                              
                               +         ui->addressEdit->setVisible(true);
                               +         ui->stealthCB->setEnabled(false);
                               +         ui->stealthCB->setVisible(true);
                              
                               +         ui->stealthCB->setVisible(false);
                              
                               +     mapper->addMapping(ui->stealthCB, AddressTableModel::Type);
                              

                              Code added

                               -        address = model     ->addRow(
                               -                mode == NewSendingAddress ? AddressTableModel::Send : AddressTableModel::Receive,
                               -                ui     ->labelEdit     ->text(),
                               -                ui     ->addressEdit     ->text());
                              

                              Code removed

                               +     	  {
                               +     	   int typeInd  = ui->stealthCB->isChecked() ? AddressTableModel::AT_Stealth : AddressTableModel::AT_Normal;
                               +          address = model->addRow(
                               +                    mode == NewSendingAddress ? AddressTableModel::Send : AddressTableModel::Receive,
                               +                    ui->labelEdit->text(),
                               +                    ui->addressEdit->text(),
                               +                    typeInd);
                               +         }
                              

                              Code replaced

                              1 Reply Last reply Reply Quote 1
                              • wrapper
                                wrapper Moderators last edited by

                                Feathercoin specific changes made to convert Bitcoin to FTC 0.9.6.*

                                Add stealth address : - commit

                                https://github.com/FeatherCoin/Feathercoin/commit/e993143a1688a6aa57c03da6f181f8bf2f375bf6

                                src/qt/forms/editaddressdialog.ui

                                 +      <item row="2" column="0">
                                 +       <widget class="QCheckBox" name="stealthCB">
                                 +        <property name="text">
                                 +         <string>Stealth Address</string>
                                 +        </property>
                                 +       </widget>
                                 +      </item>
                                

                                Code added

                                1 Reply Last reply Reply Quote 1
                                • wrapper
                                  wrapper Moderators last edited by wrapper

                                  Feathercoin specific changes made to convert Bitcoin to FTC 0.9.6.*

                                  Add stealth address : - commit

                                  https://github.com/FeatherCoin/Feathercoin/commit/e993143a1688a6aa57c03da6f181f8bf2f375bf6

                                  src/qt/receivecoinsdialog.cpp

                                   -        address = model     ->getAddressTableModel()     ->addRow(AddressTableModel::Receive, label, "");
                                   +      int typeInd  = AddressTableModel::AT_Normal;
                                   +      address = model     ->getAddressTableModel()     ->addRow(AddressTableModel::Receive, label, "",typeInd);
                                  

                                  Code replaced

                                   -    ui->reqAmount->value(), ui->reqMessage->text());
                                   +   ui->reqAmount->value(), ui->reqMessage->text());
                                  

                                  Code replaced

                                  1 Reply Last reply Reply Quote 1
                                  • wrapper
                                    wrapper Moderators last edited by wrapper

                                    Feathercoin specific changes made to convert Bitcoin to FTC 0.9.6.*

                                    Add stealth address : - commit

                                    https://github.com/FeatherCoin/Feathercoin/commit/e993143a1688a6aa57c03da6f181f8bf2f375bf6

                                    src/qt/sendcoinsdialog.cpp

                                    +		//QMessageBox::information(NULL, "Info1", "Click_SendButton", QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes);
                                    

                                    Code added

                                    1 Reply Last reply Reply Quote 1
                                    • wrapper
                                      wrapper Moderators last edited by wrapper

                                      Add stealth address : - commit

                                      https://github.com/FeatherCoin/Feathercoin/commit/e993143a1688a6aa57c03da6f181f8bf2f375bf6

                                      src/qt/sendcoinsentry.cpp

                                       + #include "stealth.h"
                                      
                                       + #include <QDebug>
                                      

                                      Code added

                                       +     
                                       +     if (recipient.address.length() > 75 
                                       +         && IsStealthAddress(recipient.address.toStdString()))
                                       +         recipient.typeInd = AddressTableModel::AT_Stealth;
                                       +     else
                                       +         recipient.typeInd = AddressTableModel::AT_Normal;
                                       +         	
                                       +     qDebug() << "SendCoinsEntry::getValue,recipient.typeInd ="     + QString::number(recipient.typeInd);
                                      

                                      Code added

                                       +     
                                       +     if (recipient.address.length() > 75 
                                       +         && IsStealthAddress(recipient.address.toStdString()))
                                       +         recipient.typeInd = AddressTableModel::AT_Stealth;
                                       +     else
                                       +         recipient.typeInd = AddressTableModel::AT_Normal;
                                       +         	
                                       +     qDebug() << "SendCoinsEntry::getValue,recipient.typeInd ="+ QString::number(recipient.typeInd);
                                      

                                      Code added

                                      1 Reply Last reply Reply Quote 1
                                      • wrapper
                                        wrapper Moderators last edited by wrapper

                                        Add stealth address : - commit

                                        https://github.com/FeatherCoin/Feathercoin/commit/e993143a1688a6aa57c03da6f181f8bf2f375bf6

                                        src/qt/transactiondesc.cpp

                                         +         char cbuf[256];
                                         +         for (int k = 0; k < wtx.vout.size();      +      + k)
                                         +         {
                                         +             snprintf(cbuf, sizeof(cbuf), "n_%d", k);
                                         +             if (wtx.mapValue.count(cbuf) && !wtx.mapValue[cbuf].empty())
                                         +                 strHTML      + = "<br><b>"      +  tr(cbuf)      +  ":</b> "      +  GUIUtil::HtmlEscape(wtx.mapValue[cbuf], true)      +  "<br>";
                                         +         }
                                         +         
                                        

                                        Code added

                                        1 Reply Last reply Reply Quote 1
                                        • wrapper
                                          wrapper Moderators last edited by

                                          Add stealth address : - commit

                                          https://github.com/FeatherCoin/Feathercoin/commit/e993143a1688a6aa57c03da6f181f8bf2f375bf6

                                          src/qt/walletmodel.cpp

                                           + #include <QMessageBox>
                                           + 
                                           + #if defined(_MSC_VER) || defined(__MSVCRT__)
                                           +   /* (s)size_t and ptrdiff_t have the same size specifier in MSVC:
                                           +      http://msdn.microsoft.com/en-us/library/tcxf1dw6%28v=vs.100%29.aspx
                                           +    */
                                           +   #define PRIszx    "Ix"
                                           +   #define PRIszu    "Iu"
                                           +   #define PRIszd    "Id"
                                           +   #define PRIpdx    "Ix"
                                           +   #define PRIpdu    "Iu"
                                           +   #define PRIpdd    "Id"
                                           + #else /* C99 standard */
                                           +   #define PRIszx    "zx"
                                           +   #define PRIszu    "zu"
                                           +   #define PRIszd    "zd"
                                           +   #define PRIpdx    "tx"
                                           +   #define PRIpdu    "tu"
                                           +   #define PRIpdd    "td"
                                           + #endif
                                          

                                          Additional code

                                           -    CBitcoinAddress addressParsed(address.toStdString());
                                          

                                          Code removed

                                           +     std::string sAddr = address.toStdString();
                                           +     
                                           +     if (sAddr.length() > 75)
                                           +     {
                                           +         if (IsStealthAddress(sAddr))
                                           +             return true;
                                           +     };
                                           +     
                                           +     CBitcoinAddress addressParsed(sAddr);
                                          

                                          Code replaced

                                          •    {   // User-entered feathercoin address / amount:
                                            

                                          Comment changed? name to Feathercoin

                                           +             std::string sAddr = rcp.address.toStdString();            
                                           +             if (rcp.typeInd == AddressTableModel::AT_Stealth)
                                           +             {
                                           +                 CStealthAddress sxAddr;
                                           +                 if (sxAddr.SetEncoded(sAddr))
                                           +                 {
                                           +                     ec_secret ephem_secret;
                                           +                     ec_secret secretShared;
                                           +                     ec_point pkSendTo;
                                           +                     ec_point ephem_pubkey;
                                           +                     
                                           +                     
                                           +                     if (GenerateRandomSecret(ephem_secret) != 0)
                                           +                     {
                                           +                         printf("GenerateRandomSecret failed.\n");
                                           +                         return Aborted;
                                           +                     };
                                           +                     
                                           +                     if (StealthSecret(ephem_secret, sxAddr.scan_pubkey, sxAddr.spend_pubkey, secretShared, pkSendTo) != 0)
                                           +                     {
                                           +                         printf("Could not generate receiving public key.\n");
                                           +                         return Aborted;
                                           +                     };
                                           +                     
                                           +                     CPubKey cpkTo(pkSendTo);
                                           +                     if (!cpkTo.IsValid())
                                           +                     {
                                           +                         printf("Invalid public key generated.\n");
                                           +                         return Aborted;
                                           +                     };
                                           +                     
                                           +                     CKeyID ckidTo = cpkTo.GetID();
                                           +                     
                                           +                     CBitcoinAddress addrTo(ckidTo);
                                           +                     
                                           +                     if (SecretToPublicKey(ephem_secret, ephem_pubkey) != 0)
                                           +                     {
                                           +                         printf("Could not generate ephem public key.\n");
                                           +                         return Aborted;
                                           +                     };
                                           +                     
                                           +                     //if (fDebug)
                                           +                     if (true)
                                           +                     {
                                           +                         LogPrintf("Stealth send to generated pubkey %"PRIszu": %s\n", pkSendTo.size(), HexStr(pkSendTo).c_str());
                                           +                         LogPrintf("hash %s\n", addrTo.ToString().c_str());
                                           +                         LogPrintf("ephem_pubkey %"PRIszu": %s\n", ephem_pubkey.size(), HexStr(ephem_pubkey).c_str());
                                           +                     };
                                           +                     
                                           +                     CScript scriptPubKey;
                                           +                     scriptPubKey.SetDestination(addrTo.Get());
                                           +                     LogPrintf("scriptPubKey= %s \n", scriptPubKey.ToString());
                                           +                     
                                           +                     vecSend.push_back(make_pair(scriptPubKey, rcp.amount));
                                           +                     
                                           +                     CScript scriptP = CScript() << OP_RETURN << ephem_pubkey;
                                           +                     vecSend.push_back(make_pair(scriptP, 0));
                                           +                     
                                           +                     continue;
                                           +                 }; // else drop through to normal
                                           +             }
                                           +     
                                          

                                          Code added

                                           -            scriptPubKey.SetDestination(CBitcoinAddress(rcp.address.toStdString()).Get());
                                           +            //scriptPubKey.SetDestination(CBitcoinAddress(rcp.address.toStdString()).Get());
                                          
                                           +            scriptPubKey.SetDestination(CBitcoinAddress(sAddr).Get());
                                          

                                          Code commented out?? review

                                           +        int nChangePos = -1;
                                          

                                          Code added

                                           -        bool fCreated = wallet->CreateTransaction(vecSend, *newTx, *keyChange, nFeeRequired, strFailReason, coinControl);
                                           +         bool fCreated = wallet->CreateTransaction(vecSend, *newTx, *keyChange, nFeeRequired, nChangePos, strFailReason, coinControl);
                                          

                                          Code replaced

                                          +            else if (!rcp.message.isEmpty()) // Message from normal feathercoin:URI (feathercoin:123...?message=example)
                                          

                                          Code replaced name

                                           + 	//Run//QMessageBox::information(NULL, "Info2", "Click_sendCoins", QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes);
                                                     CReserveKey *keyChange = transaction.getPossibleKeyChange();
                                           +         LogPrintf("sendCoins: newTx= \n%s", newTx->ToString());
                                           +     
                                          

                                          Code commented out ? code added

                                           +				//string strError =wallet->SendMoneyToDestination(rcp.label, transaction.GetValueOut(), *newTx);
                                          

                                          Code added

                                           +    //No Run//
                                          

                                          Comment added

                                           -                std::map<CTxDestination, CAddressBookData>::iterator mi = wallet     ->mapAddressBook.find(dest);
                                           -
                                           -                // Check if we have a new address or an updated label
                                           -                if (mi == wallet     ->mapAddressBook.end())
                                           -                {
                                           -                    wallet     ->SetAddressBook(dest, strLabel, "send");
                                           -                }
                                           -                else if (mi     ->second.name != strLabel)
                                           -                {
                                           -                    wallet     ->SetAddressBook(dest, strLabel, ""); // "" means don't change purpose
                                           -                }
                                           -            }
                                          

                                          Code removed

                                           + 		            if (rcp.typeInd == AddressTableModel::AT_Stealth)
                                           + 		            {
                                           + 		                wallet->UpdateStealthAddress(strAddress, strLabel, true);
                                           + 		            } else 
                                           + 		            {
                                           + 		                std::map<CTxDestination, CAddressBookData>::iterator mi = wallet->mapAddressBook.find(dest);
                                           + 		                // Check if we have a new address or an updated label
                                           + 		                if (mi == wallet->mapAddressBook.end())
                                           + 		                {
                                           + 		                    wallet->SetAddressBook(dest, strLabel, "send");
                                           + 		                }
                                           + 		                else if (mi->second.name != strLabel)
                                           + 		                {
                                           + 		                    wallet->SetAddressBook(dest, strLabel, ""); // "" means don't change purpose
                                           + 		                }
                                           + 		            }
                                           +           	}
                                          

                                          Code added

                                          +        LogPrintf("sendCoins: updateAddressBook. \n");
                                          

                                          Log interface message added

                                          - static void NotifyAddressBookChanged(WalletModel *walletmodel, CWallet *wallet,
                                          + /*static void NotifyAddressBookChanged(WalletModel *walletmodel, CWallet *wallet,
                                          

                                          Commented out? should be deleted if not used…

                                           + }*/
                                           + static void NotifyAddressBookChanged(WalletModel *walletmodel, CWallet *wallet, 
                                           +         const CTxDestination &address, const std::string &label, bool isMine, 
                                           +         const std::string &purpose, ChangeType status)
                                           + {
                                           +     QString strAddress = QString::fromStdString(CBitcoinAddress(address).ToString());
                                           +     QString strLabel = QString::fromStdString(label);
                                           +     QString strPurpose = QString::fromStdString(purpose);
                                           + 	
                                           +     if (address.type() == typeid(CStealthAddress))
                                           +     {
                                           +         CStealthAddress sxAddr = boost::get<CStealthAddress>(address);
                                           +         std::string enc = sxAddr.Encoded();
                                           +         //OutputDebugStringF("NotifyAddressBookChanged %s %s isMine=%i status=%i\n", enc.c_str(), label.c_str(), isMine, status);
                                           +         qDebug() << "NotifyAddressBookChanged : "      +  QString::fromStdString(enc)      +  " "      +  QString::fromStdString(label)      +  " isMine="      +  QString::number(isMine)      +  " purpose="      +  strPurpose      +  " status="      +  QString::number(status);
                                           +         QMetaObject::invokeMethod(walletmodel, "updateAddressBook", Qt::QueuedConnection,
                                           +                                   Q_ARG(QString, QString::fromStdString(enc)),
                                           +                                   Q_ARG(QString, QString::fromStdString(label)),
                                           +                                   Q_ARG(bool, isMine),
                                           +                                   Q_ARG(QString, strPurpose),
                                           +                                   Q_ARG(int, status));
                                           +     } else {
                                           +         //OutputDebugStringF("NotifyAddressBookChanged %s %s isMine=%i status=%i\n", CBitcoinAddress(address).ToString().c_str(), label.c_str(), isMine, status);
                                           +         qDebug() << "NotifyAddressBookChanged : "      +  strAddress      +  " "      +  strLabel      +  " isMine="      +  QString::number(isMine)      +  " purpose="      +  strPurpose      +  " status="      +  QString::number(status);
                                           +         QMetaObject::invokeMethod(walletmodel, "updateAddressBook", Qt::QueuedConnection,
                                           +                                   Q_ARG(QString, QString::fromStdString(CBitcoinAddress(address).ToString())),
                                           +                                   Q_ARG(QString, QString::fromStdString(label)),
                                           +                                   Q_ARG(bool, isMine),
                                           +                                   Q_ARG(QString, strPurpose),
                                           +                                   Q_ARG(int, status));
                                           +     }
                                          

                                          Code added

                                          1 Reply Last reply Reply Quote 1
                                          • wrapper
                                            wrapper Moderators last edited by

                                            Add stealth address : - commit

                                            https://github.com/FeatherCoin/Feathercoin/commit/e993143a1688a6aa57c03da6f181f8bf2f375bf6

                                            src/qt/walletmodel.h

                                            +    int typeInd;
                                            

                                            Code added

                                              -        TransactionCommitFailed
                                             +        TransactionCommitFailed,
                                             +        Aborted
                                            

                                            ?? code added?

                                            1 Reply Last reply Reply Quote 1
                                            • First post
                                              Last post