aboutsummaryrefslogtreecommitdiff
path: root/src/qt
diff options
context:
space:
mode:
Diffstat (limited to 'src/qt')
-rw-r--r--src/qt/optionsmodel.cpp7
-rw-r--r--src/qt/transactiondesc.cpp6
-rw-r--r--src/qt/transactionrecord.cpp6
3 files changed, 10 insertions, 9 deletions
diff --git a/src/qt/optionsmodel.cpp b/src/qt/optionsmodel.cpp
index efc216dab8..a68c84c957 100644
--- a/src/qt/optionsmodel.cpp
+++ b/src/qt/optionsmodel.cpp
@@ -2,6 +2,7 @@
#include "bitcoinunits.h"
#include "headers.h"
+#include "init.h"
OptionsModel::OptionsModel(CWallet *wallet, QObject *parent) :
QAbstractListModel(parent),
@@ -27,7 +28,7 @@ QVariant OptionsModel::data(const QModelIndex & index, int role) const
switch(index.row())
{
case StartAtStartup:
- return QVariant();
+ return QVariant(GetStartOnSystemStartup());
case MinimizeToTray:
return QVariant(fMinimizeToTray);
case MapPortUPnP:
@@ -62,7 +63,7 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in
switch(index.row())
{
case StartAtStartup:
- successful = false; /*TODO*/
+ successful = SetStartOnSystemStartup(value.toBool());
break;
case MinimizeToTray:
fMinimizeToTray = value.toBool();
@@ -101,7 +102,7 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in
case ProxyPort:
{
int nPort = atoi(value.toString().toAscii().data());
- if (nPort > 0 && nPort < USHRT_MAX)
+ if (nPort > 0 && nPort < std::numeric_limits<unsigned short>::max())
{
addrProxy.port = htons(nPort);
walletdb.WriteSetting("addrProxy", addrProxy);
diff --git a/src/qt/transactiondesc.cpp b/src/qt/transactiondesc.cpp
index 6ca3ac8c4b..821ef98131 100644
--- a/src/qt/transactiondesc.cpp
+++ b/src/qt/transactiondesc.cpp
@@ -99,7 +99,7 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx)
if (wallet->IsMine(txout))
{
CBitcoinAddress address;
- if (ExtractAddress(txout.scriptPubKey, wallet, address))
+ if (ExtractAddress(txout.scriptPubKey, address) && wallet->HaveKey(address))
{
if (wallet->mapAddressBook.count(address))
{
@@ -184,7 +184,7 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx)
{
// Offline transaction
CBitcoinAddress address;
- if (ExtractAddress(txout.scriptPubKey, 0, address))
+ if (ExtractAddress(txout.scriptPubKey, address))
{
strHTML += tr("<b>To:</b> ");
if (wallet->mapAddressBook.count(address) && !wallet->mapAddressBook[address].empty())
@@ -271,7 +271,7 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx)
strHTML += "<li>";
const CTxOut &vout = prev.vout[prevout.n];
CBitcoinAddress address;
- if (ExtractAddress(vout.scriptPubKey, 0, address))
+ if (ExtractAddress(vout.scriptPubKey, address))
{
if (wallet->mapAddressBook.count(address) && !wallet->mapAddressBook[address].empty())
strHTML += HtmlEscape(wallet->mapAddressBook[address]) + " ";
diff --git a/src/qt/transactionrecord.cpp b/src/qt/transactionrecord.cpp
index 77c5a01260..f3dbd45c6d 100644
--- a/src/qt/transactionrecord.cpp
+++ b/src/qt/transactionrecord.cpp
@@ -80,7 +80,7 @@ QList<TransactionRecord> TransactionRecord::decomposeTransaction(const CWallet *
if(wallet->IsMine(txout))
{
CBitcoinAddress address;
- if (ExtractAddress(txout.scriptPubKey, wallet, address))
+ if (ExtractAddress(txout.scriptPubKey, address) && wallet->HaveKey(address))
{
sub.address = address.ToString();
}
@@ -138,7 +138,7 @@ QList<TransactionRecord> TransactionRecord::decomposeTransaction(const CWallet *
// Sent to Bitcoin Address
sub.type = TransactionRecord::SendToAddress;
CBitcoinAddress address;
- if (ExtractAddress(txout.scriptPubKey, 0, address))
+ if (ExtractAddress(txout.scriptPubKey, address))
{
sub.address = address.ToString();
}
@@ -187,7 +187,7 @@ void TransactionRecord::updateStatus(const CWalletTx &wtx)
// Sort order, unrecorded transactions sort to the top
status.sortKey = strprintf("%010d-%01d-%010u-%03d",
- (pindex ? pindex->nHeight : INT_MAX),
+ (pindex ? pindex->nHeight : std::numeric_limits<int>::max()),
(wtx.IsCoinBase() ? 1 : 0),
wtx.nTimeReceived,
idx);