aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/coincontrol.h4
-rw-r--r--src/hash.cpp4
-rw-r--r--src/qt/bitcoingui.cpp6
-rw-r--r--src/qt/bitcoingui.h1
-rw-r--r--src/qt/optionsdialog.cpp7
-rw-r--r--src/qt/optionsdialog.h2
-rw-r--r--src/random.cpp5
-rw-r--r--src/random.h2
-rw-r--r--src/script/sign.cpp8
-rw-r--r--src/script/sign.h2
-rw-r--r--src/wallet.cpp6
11 files changed, 27 insertions, 20 deletions
diff --git a/src/coincontrol.h b/src/coincontrol.h
index c9057017d8..c8bdd3b39d 100644
--- a/src/coincontrol.h
+++ b/src/coincontrol.h
@@ -35,12 +35,12 @@ public:
return (setSelected.count(outpt) > 0);
}
- void Select(COutPoint& output)
+ void Select(const COutPoint& output)
{
setSelected.insert(output);
}
- void UnSelect(COutPoint& output)
+ void UnSelect(const COutPoint& output)
{
setSelected.erase(output);
}
diff --git a/src/hash.cpp b/src/hash.cpp
index 29376b45aa..2cca06ae23 100644
--- a/src/hash.cpp
+++ b/src/hash.cpp
@@ -1,3 +1,7 @@
+// Copyright (c) 2013-2014 The Bitcoin developers
+// Distributed under the MIT software license, see the accompanying
+// file COPYING or http://www.opensource.org/licenses/mit-license.php.
+
#include "hash.h"
inline uint32_t ROTL32(uint32_t x, int8_t r)
diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp
index 77cfdceef0..450b83a8c6 100644
--- a/src/qt/bitcoingui.cpp
+++ b/src/qt/bitcoingui.cpp
@@ -103,9 +103,9 @@ BitcoinGUI::BitcoinGUI(const NetworkStyle *networkStyle, QWidget *parent) :
QString windowTitle = tr("Bitcoin Core") + " - ";
#ifdef ENABLE_WALLET
/* if compiled with wallet support, -disablewallet can still disable the wallet */
- bool enableWallet = !GetBoolArg("-disablewallet", false);
+ enableWallet = !GetBoolArg("-disablewallet", false);
#else
- bool enableWallet = false;
+ enableWallet = false;
#endif // ENABLE_WALLET
if(enableWallet)
{
@@ -554,7 +554,7 @@ void BitcoinGUI::optionsClicked()
if(!clientModel || !clientModel->getOptionsModel())
return;
- OptionsDialog dlg(this);
+ OptionsDialog dlg(this, enableWallet);
dlg.setModel(clientModel->getOptionsModel());
dlg.exec();
}
diff --git a/src/qt/bitcoingui.h b/src/qt/bitcoingui.h
index 35b36811c4..662ef9d9e8 100644
--- a/src/qt/bitcoingui.h
+++ b/src/qt/bitcoingui.h
@@ -64,6 +64,7 @@ public:
bool setCurrentWallet(const QString& name);
void removeAllWallets();
#endif // ENABLE_WALLET
+ bool enableWallet;
protected:
void changeEvent(QEvent *e);
diff --git a/src/qt/optionsdialog.cpp b/src/qt/optionsdialog.cpp
index 67be174d55..f5a0759c92 100644
--- a/src/qt/optionsdialog.cpp
+++ b/src/qt/optionsdialog.cpp
@@ -30,7 +30,7 @@
#include <QMessageBox>
#include <QTimer>
-OptionsDialog::OptionsDialog(QWidget *parent) :
+OptionsDialog::OptionsDialog(QWidget *parent, bool enableWallet) :
QDialog(parent),
ui(new Ui::OptionsDialog),
model(0),
@@ -66,6 +66,11 @@ OptionsDialog::OptionsDialog(QWidget *parent) :
ui->tabWidget->removeTab(ui->tabWidget->indexOf(ui->tabWindow));
#endif
+ /* remove Wallet tab in case of -disablewallet */
+ if (!enableWallet) {
+ ui->tabWidget->removeTab(ui->tabWidget->indexOf(ui->tabWallet));
+ }
+
/* Display elements init */
QDir translations(":translations");
ui->lang->addItem(QString("(") + tr("default") + QString(")"), QVariant(""));
diff --git a/src/qt/optionsdialog.h b/src/qt/optionsdialog.h
index 108609610d..794a39590c 100644
--- a/src/qt/optionsdialog.h
+++ b/src/qt/optionsdialog.h
@@ -24,7 +24,7 @@ class OptionsDialog : public QDialog
Q_OBJECT
public:
- explicit OptionsDialog(QWidget *parent);
+ explicit OptionsDialog(QWidget *parent, bool enableWallet);
~OptionsDialog();
void setModel(OptionsModel *model);
diff --git a/src/random.cpp b/src/random.cpp
index 998e7dfb08..fc9505ae73 100644
--- a/src/random.cpp
+++ b/src/random.cpp
@@ -82,13 +82,12 @@ void RandAddSeedPerfmon()
#endif
}
-bool GetRandBytes(unsigned char* buf, int num)
+void GetRandBytes(unsigned char* buf, int num)
{
if (RAND_bytes(buf, num) != 1) {
LogPrintf("%s: OpenSSL RAND_bytes() failed with error: %s\n", __func__, ERR_error_string(ERR_get_error(), NULL));
- return false;
+ assert(false);
}
- return true;
}
uint64_t GetRand(uint64_t nMax)
diff --git a/src/random.h b/src/random.h
index 161ebe8986..ec73d910c4 100644
--- a/src/random.h
+++ b/src/random.h
@@ -19,7 +19,7 @@ void RandAddSeedPerfmon();
/**
* Functions to gather random data via the OpenSSL PRNG
*/
-bool GetRandBytes(unsigned char* buf, int num);
+void GetRandBytes(unsigned char* buf, int num);
uint64_t GetRand(uint64_t nMax);
int GetRandInt(int nMax);
uint256 GetRandHash();
diff --git a/src/script/sign.cpp b/src/script/sign.cpp
index 0eab0626e5..9dfd640dfb 100644
--- a/src/script/sign.cpp
+++ b/src/script/sign.cpp
@@ -144,9 +144,9 @@ static CScript PushAll(const vector<valtype>& values)
return result;
}
-static CScript CombineMultisig(CScript scriptPubKey, const CMutableTransaction& txTo, unsigned int nIn,
+static CScript CombineMultisig(const CScript& scriptPubKey, const CTransaction& txTo, unsigned int nIn,
const vector<valtype>& vSolutions,
- vector<valtype>& sigs1, vector<valtype>& sigs2)
+ const vector<valtype>& sigs1, const vector<valtype>& sigs2)
{
// Combine all the signatures we've got:
set<valtype> allsigs;
@@ -199,7 +199,7 @@ static CScript CombineMultisig(CScript scriptPubKey, const CMutableTransaction&
return result;
}
-static CScript CombineSignatures(CScript scriptPubKey, const CTransaction& txTo, unsigned int nIn,
+static CScript CombineSignatures(const CScript& scriptPubKey, const CTransaction& txTo, unsigned int nIn,
const txnouttype txType, const vector<valtype>& vSolutions,
vector<valtype>& sigs1, vector<valtype>& sigs2)
{
@@ -244,7 +244,7 @@ static CScript CombineSignatures(CScript scriptPubKey, const CTransaction& txTo,
return CScript();
}
-CScript CombineSignatures(CScript scriptPubKey, const CTransaction& txTo, unsigned int nIn,
+CScript CombineSignatures(const CScript& scriptPubKey, const CTransaction& txTo, unsigned int nIn,
const CScript& scriptSig1, const CScript& scriptSig2)
{
txnouttype txType;
diff --git a/src/script/sign.h b/src/script/sign.h
index c84d3f9a94..99d5516adb 100644
--- a/src/script/sign.h
+++ b/src/script/sign.h
@@ -19,6 +19,6 @@ bool SignSignature(const CKeyStore& keystore, const CTransaction& txFrom, CMutab
// Given two sets of signatures for scriptPubKey, possibly with OP_0 placeholders,
// combine them intelligently and return the result.
-CScript CombineSignatures(CScript scriptPubKey, const CTransaction& txTo, unsigned int nIn, const CScript& scriptSig1, const CScript& scriptSig2);
+CScript CombineSignatures(const CScript& scriptPubKey, const CTransaction& txTo, unsigned int nIn, const CScript& scriptSig1, const CScript& scriptSig2);
#endif // BITCOIN_SCRIPT_SIGN_H
diff --git a/src/wallet.cpp b/src/wallet.cpp
index d392149dbb..ec439c5aad 100644
--- a/src/wallet.cpp
+++ b/src/wallet.cpp
@@ -422,15 +422,13 @@ bool CWallet::EncryptWallet(const SecureString& strWalletPassphrase)
RandAddSeedPerfmon();
vMasterKey.resize(WALLET_CRYPTO_KEY_SIZE);
- if (!GetRandBytes(&vMasterKey[0], WALLET_CRYPTO_KEY_SIZE))
- return false;
+ GetRandBytes(&vMasterKey[0], WALLET_CRYPTO_KEY_SIZE);
CMasterKey kMasterKey;
RandAddSeedPerfmon();
kMasterKey.vchSalt.resize(WALLET_CRYPTO_SALT_SIZE);
- if (!GetRandBytes(&kMasterKey.vchSalt[0], WALLET_CRYPTO_SALT_SIZE))
- return false;
+ GetRandBytes(&kMasterKey.vchSalt[0], WALLET_CRYPTO_SALT_SIZE);
CCrypter crypter;
int64_t nStartTime = GetTimeMillis();