Fix sign comparison warning & replace unsigned int with uint32_t for nIn.
[novacoin.git] / src / qt / multisigdialog.cpp
index 8f9beea..6f0851c 100644 (file)
@@ -149,7 +149,7 @@ void MultisigDialog::on_createAddressButton_clicked()
     if(!model)
         return;
 
-    std::vector<CKey> pubkeys;
+    std::vector<CPubKey> pubkeys;
     pubkeys.resize(ui->pubkeyEntries->count());
     unsigned int required = ui->requiredSignatures->text().toUInt();
 
@@ -162,7 +162,7 @@ void MultisigDialog::on_createAddressButton_clicked()
         CPubKey vchPubKey(ParseHex(str.toStdString().c_str()));
         if(!vchPubKey.IsValid())
             return;
-        pubkeys[i].SetPubKey(vchPubKey);
+        pubkeys[i] = vchPubKey;
     }
 
     if(pubkeys.size() > 16)
@@ -243,8 +243,8 @@ void MultisigDialog::on_saveMultisigAddressButton_clicked()
     LOCK(wallet->cs_wallet);
     if(!wallet->HaveCScript(scriptID))
         wallet->AddCScript(script);
-    if(!wallet->mapAddressBook.count(CBitcoinAddress(address).Get()))
-        wallet->SetAddressBookName(CBitcoinAddress(address).Get(), label);
+    if(!wallet->mapAddressBook.count(CBitcoinAddress(address)))
+        wallet->SetAddressBookName(CBitcoinAddress(address), label);
 }
 
 void MultisigDialog::clear()
@@ -347,15 +347,14 @@ void MultisigDialog::on_transaction_textChanged()
     {
         ss >> tx;
     }
-    catch(std::exception &e)
+    catch(const std::exception&)
     {
-        (void)e;
         return;
     }
 
     // Fill input list
     int index = -1;
-    BOOST_FOREACH(const CTxIn& txin, tx.vin)
+    for(const CTxIn& txin :  tx.vin)
     {
         uint256 prevoutHash = txin.prevout.hash;
         addInput();
@@ -370,7 +369,7 @@ void MultisigDialog::on_transaction_textChanged()
 
     // Fill output list
     index = -1;
-    BOOST_FOREACH(const CTxOut& txout, tx.vout)
+    for(const CTxOut& txout :  tx.vout)
     {
         CScript scriptPubKey = txout.scriptPubKey;
         CTxDestination addr;
@@ -418,9 +417,8 @@ void MultisigDialog::on_signTransactionButton_clicked()
     {
         ss >> tx;
     }
-    catch(std::exception &e)
+    catch(const std::exception&)
     {
-        (void)e;
         return;
     }
     CTransaction mergedTx(tx);
@@ -438,7 +436,7 @@ void MultisigDialog::on_signTransactionButton_clicked()
         tempTx.vin.push_back(mergedTx.vin[i]);
         tempTx.FetchInputs(txdb, unused, false, false, mapPrevTx, fInvalid);
 
-        BOOST_FOREACH(const CTxIn& txin, tempTx.vin)
+        for(const CTxIn& txin :  tempTx.vin)
         {
             const uint256& prevHash = txin.prevout.hash;
             if(mapPrevTx.count(prevHash) && mapPrevTx[prevHash].second.vout.size() > txin.prevout.n)
@@ -468,7 +466,7 @@ void MultisigDialog::on_signTransactionButton_clicked()
 
     // Sign what we can
     bool fComplete = true;
-    for(unsigned int i = 0; i < mergedTx.vin.size(); i++)
+    for(uint32_t i = 0; i < mergedTx.vin.size(); i++)
     {
         CTxIn& txin = mergedTx.vin[i];
         if(mapPrevOut.count(txin.prevout) == 0)
@@ -538,9 +536,8 @@ void MultisigDialog::on_sendTransactionButton_clicked()
     {
         ssData >> tx;
     }
-    catch(std::exception &e)
+    catch(const std::exception&)
     {
-        (void)e;
         return;
     }
     uint256 txHash = tx.GetHash();