Reduce build warnings and enable Qt build
This commit is contained in:
@@ -122,7 +122,7 @@ if test "x$want_boost" = "xyes"; then
|
||||
dnl this location ist chosen if boost libraries are installed with the --layout=system option
|
||||
dnl or if you install boost with RPM
|
||||
if test "$ac_boost_path" != ""; then
|
||||
BOOST_CPPFLAGS="-I$ac_boost_path/include"
|
||||
BOOST_CPPFLAGS="-isystem $ac_boost_path/include"
|
||||
for ac_boost_path_tmp in $libsubdirs; do
|
||||
if test -d "$ac_boost_path"/"$ac_boost_path_tmp" ; then
|
||||
BOOST_LDFLAGS="-L$ac_boost_path/$ac_boost_path_tmp"
|
||||
@@ -136,7 +136,7 @@ if test "x$want_boost" = "xyes"; then
|
||||
if ls "$ac_boost_path_tmp/$libsubdir/libboost_"* >/dev/null 2>&1 ; then break; fi
|
||||
done
|
||||
BOOST_LDFLAGS="-L$ac_boost_path_tmp/$libsubdir"
|
||||
BOOST_CPPFLAGS="-I$ac_boost_path_tmp/include"
|
||||
BOOST_CPPFLAGS="-isystem $ac_boost_path_tmp/include"
|
||||
break;
|
||||
fi
|
||||
done
|
||||
@@ -193,12 +193,12 @@ if test "x$want_boost" = "xyes"; then
|
||||
_version=$_version_tmp
|
||||
fi
|
||||
VERSION_UNDERSCORE=`echo $_version | sed 's/\./_/'`
|
||||
BOOST_CPPFLAGS="-I$ac_boost_path/include/boost-$VERSION_UNDERSCORE"
|
||||
BOOST_CPPFLAGS="-isystem $ac_boost_path/include/boost-$VERSION_UNDERSCORE"
|
||||
done
|
||||
dnl if nothing found search for layout used in Windows distributions
|
||||
if test -z "$BOOST_CPPFLAGS"; then
|
||||
if test -d "$ac_boost_path/boost" && test -r "$ac_boost_path/boost"; then
|
||||
BOOST_CPPFLAGS="-I$ac_boost_path"
|
||||
BOOST_CPPFLAGS="-isystem $ac_boost_path"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
@@ -218,7 +218,7 @@ if test "x$want_boost" = "xyes"; then
|
||||
done
|
||||
|
||||
VERSION_UNDERSCORE=`echo $_version | sed 's/\./_/'`
|
||||
BOOST_CPPFLAGS="-I$best_path/include/boost-$VERSION_UNDERSCORE"
|
||||
BOOST_CPPFLAGS="-isystem $best_path/include/boost-$VERSION_UNDERSCORE"
|
||||
if test "$ac_boost_lib_path" = ""; then
|
||||
for libsubdir in $libsubdirs ; do
|
||||
if ls "$best_path/$libsubdir/libboost_"* >/dev/null 2>&1 ; then break; fi
|
||||
@@ -238,7 +238,7 @@ if test "x$want_boost" = "xyes"; then
|
||||
V_CHECK=`expr $stage_version_shorten \>\= $_version`
|
||||
if test "$V_CHECK" = "1" -a "$ac_boost_lib_path" = "" ; then
|
||||
AC_MSG_NOTICE(We will use a staged boost library from $BOOST_ROOT)
|
||||
BOOST_CPPFLAGS="-I$BOOST_ROOT"
|
||||
BOOST_CPPFLAGS="-isystem $BOOST_ROOT"
|
||||
BOOST_LDFLAGS="-L$BOOST_ROOT/stage/$libsubdir"
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -62,7 +62,7 @@ if test -z "@allow_host_packages@"; then
|
||||
export PKGCONFIG_LIBDIR=
|
||||
fi
|
||||
|
||||
CPPFLAGS="-I$depends_prefix/include/ $CPPFLAGS"
|
||||
CPPFLAGS="-isystem $depends_prefix/include/ $CPPFLAGS"
|
||||
LDFLAGS="-L$depends_prefix/lib $LDFLAGS"
|
||||
|
||||
if test -n "@CC@" -a -z "${CC}"; then
|
||||
|
||||
@@ -246,8 +246,8 @@ int CommandLineRPC(int argc, char* argv[])
|
||||
const UniValue reply = CallRPC(strMethod, params);
|
||||
|
||||
// Parse reply
|
||||
const UniValue& result = find_value(reply, "result");
|
||||
const UniValue& error = find_value(reply, "error");
|
||||
const UniValue result = find_value(reply, "result");
|
||||
const UniValue error = find_value(reply, "error");
|
||||
|
||||
if (!error.isNull()) {
|
||||
// Error
|
||||
|
||||
@@ -29,6 +29,7 @@ public:
|
||||
explicit CFeeRate(const CAmount& _nSatoshisPerK) : nSatoshisPerK(_nSatoshisPerK) {}
|
||||
CFeeRate(const CAmount& nFeePaid, size_t nSize);
|
||||
CFeeRate(const CFeeRate& other) { nSatoshisPerK = other.nSatoshisPerK; }
|
||||
CFeeRate& operator=(const CFeeRate& other) = default;
|
||||
|
||||
CAmount GetFee(size_t size) const; // unit returned is satoshis
|
||||
CAmount GetFeePerK() const { return GetFee(1000); } // satoshis-per-1000-bytes
|
||||
|
||||
+3
-2
@@ -8,6 +8,7 @@
|
||||
#include "hash.h"
|
||||
#include "uint256.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <assert.h>
|
||||
#include <boost/variant/apply_visitor.hpp>
|
||||
#include <boost/variant/static_visitor.hpp>
|
||||
@@ -270,7 +271,7 @@ CTxDestination CBitcoinAddress::Get() const
|
||||
if (!IsValid())
|
||||
return CNoDestination();
|
||||
uint160 id;
|
||||
memcpy(&id, &vchData[0], 20);
|
||||
std::copy(vchData.begin(), vchData.end(), id.begin());
|
||||
if (vchVersion == Params().Base58Prefix(CChainParams::PUBKEY_ADDRESS))
|
||||
return CKeyID(id);
|
||||
else if (vchVersion == Params().Base58Prefix(CChainParams::SCRIPT_ADDRESS))
|
||||
@@ -284,7 +285,7 @@ bool CBitcoinAddress::GetKeyID(CKeyID& keyID) const
|
||||
if (!IsValid() || vchVersion != Params().Base58Prefix(CChainParams::PUBKEY_ADDRESS))
|
||||
return false;
|
||||
uint160 id;
|
||||
memcpy(&id, &vchData[0], 20);
|
||||
std::copy(vchData.begin(), vchData.end(), id.begin());
|
||||
keyID = CKeyID(id);
|
||||
return true;
|
||||
}
|
||||
|
||||
+4
-2
@@ -10,10 +10,12 @@
|
||||
#include "pubkey.h"
|
||||
#include "script/standard.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
bool CScriptCompressor::IsToKeyID(CKeyID& hash) const
|
||||
{
|
||||
if (script.size() == 25 && script[0] == OP_DUP && script[1] == OP_HASH160 && script[2] == 20 && script[23] == OP_EQUALVERIFY && script[24] == OP_CHECKSIG) {
|
||||
memcpy(&hash, &script[3], 20);
|
||||
std::copy(script.begin() + 3, script.begin() + 23, hash.begin());
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -22,7 +24,7 @@ bool CScriptCompressor::IsToKeyID(CKeyID& hash) const
|
||||
bool CScriptCompressor::IsToScriptID(CScriptID& hash) const
|
||||
{
|
||||
if (script.size() == 23 && script[0] == OP_HASH160 && script[1] == 20 && script[22] == OP_EQUAL) {
|
||||
memcpy(&hash, &script[2], 20);
|
||||
std::copy(script.begin() + 2, script.begin() + 22, hash.begin());
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -167,7 +167,8 @@ PBKDF2_SHA256(const uint8_t *passwd, size_t passwdlen, const uint8_t *salt,
|
||||
}
|
||||
|
||||
/* Clean PShctx, since we never called _Final on it. */
|
||||
memset(&PShctx, 0, sizeof(HMAC_SHA256_CTX));
|
||||
PShctx.ictx.Reset();
|
||||
PShctx.octx.Reset();
|
||||
}
|
||||
|
||||
static inline uint32_t
|
||||
|
||||
@@ -55,8 +55,10 @@ void InitOnce(OnceType* once, void (*initializer)()) {
|
||||
|
||||
bool HasAcceleratedCRC32C() {
|
||||
#if (defined(__x86_64__) || defined(__i386__)) && defined(__GNUC__)
|
||||
unsigned int eax, ebx, ecx, edx;
|
||||
__get_cpuid(1, &eax, &ebx, &ecx, &edx);
|
||||
unsigned int eax = 0, ebx = 0, ecx = 0, edx = 0;
|
||||
if (__get_cpuid(1, &eax, &ebx, &ecx, &edx) == 0) {
|
||||
return false;
|
||||
}
|
||||
return (ecx & (1 << 20)) != 0;
|
||||
#else
|
||||
return false;
|
||||
|
||||
@@ -55,7 +55,7 @@ bool ConsumeDecimalNumber(Slice* in, uint64_t* val) {
|
||||
const int delta = (c - '0');
|
||||
static const uint64_t kMaxUint64 = ~static_cast<uint64_t>(0);
|
||||
if (v > kMaxUint64/10 ||
|
||||
(v == kMaxUint64/10 && delta > kMaxUint64%10)) {
|
||||
(v == kMaxUint64/10 && static_cast<uint64_t>(delta) > kMaxUint64%10)) {
|
||||
// Overflow
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ void CLightWorker::ThreadLightZAGRSimplified() {
|
||||
heightStop
|
||||
);
|
||||
|
||||
} catch (NotEnoughMintsException e) {
|
||||
} catch (const NotEnoughMintsException& e) {
|
||||
LogPrintStr(std::string("ThreadLightZAGRSimplified: ") + e.message + "\n");
|
||||
rejectWork(genWit, blockHeight, NOT_ENOUGH_MINTS);
|
||||
continue;
|
||||
|
||||
@@ -47,6 +47,7 @@ public:
|
||||
|
||||
CMasternodePing();
|
||||
CMasternodePing(CTxIn& newVin);
|
||||
CMasternodePing(const CMasternodePing& other) = default;
|
||||
|
||||
ADD_SERIALIZE_METHODS;
|
||||
|
||||
|
||||
@@ -159,6 +159,8 @@ CTransaction::CTransaction(const CMutableTransaction &tx) : nVersion(tx.nVersion
|
||||
UpdateHash();
|
||||
}
|
||||
|
||||
CTransaction::CTransaction(const CTransaction &tx) : hash(tx.hash), nVersion(tx.nVersion), vin(tx.vin), vout(tx.vout), nLockTime(tx.nLockTime) { }
|
||||
|
||||
CTransaction& CTransaction::operator=(const CTransaction &tx) {
|
||||
*const_cast<int*>(&nVersion) = tx.nVersion;
|
||||
*const_cast<std::vector<CTxIn>*>(&vin) = tx.vin;
|
||||
|
||||
@@ -226,6 +226,7 @@ public:
|
||||
/** Convert a CMutableTransaction into a CTransaction. */
|
||||
CTransaction(const CMutableTransaction &tx);
|
||||
|
||||
CTransaction(const CTransaction& tx);
|
||||
CTransaction& operator=(const CTransaction& tx);
|
||||
|
||||
ADD_SERIALIZE_METHODS;
|
||||
|
||||
+1
-1
@@ -51,7 +51,7 @@ CMessageHeader::CMessageHeader(const char* pszCommand, unsigned int nMessageSize
|
||||
{
|
||||
memcpy(pchMessageStart, Params().MessageStart(), MESSAGE_START_SIZE);
|
||||
memset(pchCommand, 0, sizeof(pchCommand));
|
||||
strncpy(pchCommand, pszCommand, COMMAND_SIZE);
|
||||
memcpy(pchCommand, pszCommand, strnlen(pszCommand, COMMAND_SIZE));
|
||||
nMessageSize = nMessageSizeIn;
|
||||
nChecksum = 0;
|
||||
}
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
#include "wallet/wallet.h"
|
||||
#include "askpassphrasedialog.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#include <QDebug>
|
||||
#include <QFont>
|
||||
|
||||
@@ -82,7 +84,7 @@ public:
|
||||
cachedAddressTable.clear();
|
||||
{
|
||||
LOCK(wallet->cs_wallet);
|
||||
for (const PAIRTYPE(CTxDestination, CAddressBookData) & item : wallet->mapAddressBook) {
|
||||
for (const auto& item : wallet->mapAddressBook) {
|
||||
const CBitcoinAddress& address = item.first;
|
||||
bool fMine = IsMine(*wallet, address.Get());
|
||||
AddressTableEntry::Type addressType = translateTransactionType(
|
||||
@@ -96,15 +98,15 @@ public:
|
||||
// qLowerBound() and qUpperBound() require our cachedAddressTable list to be sorted in asc order
|
||||
// Even though the map is already sorted this re-sorting step is needed because the originating map
|
||||
// is sorted by binary address, not by base58() address.
|
||||
qSort(cachedAddressTable.begin(), cachedAddressTable.end(), AddressTableEntryLessThan());
|
||||
std::sort(cachedAddressTable.begin(), cachedAddressTable.end(), AddressTableEntryLessThan());
|
||||
}
|
||||
|
||||
void updateEntry(const QString& address, const QString& label, bool isMine, const QString& purpose, int status)
|
||||
{
|
||||
// Find address / label in model
|
||||
QList<AddressTableEntry>::iterator lower = qLowerBound(
|
||||
QList<AddressTableEntry>::iterator lower = std::lower_bound(
|
||||
cachedAddressTable.begin(), cachedAddressTable.end(), address, AddressTableEntryLessThan());
|
||||
QList<AddressTableEntry>::iterator upper = qUpperBound(
|
||||
QList<AddressTableEntry>::iterator upper = std::upper_bound(
|
||||
cachedAddressTable.begin(), cachedAddressTable.end(), address, AddressTableEntryLessThan());
|
||||
int lowerIndex = (lower - cachedAddressTable.begin());
|
||||
int upperIndex = (upper - cachedAddressTable.begin());
|
||||
@@ -145,9 +147,9 @@ public:
|
||||
void updateEntry(const QString &pubCoin, const QString &isUsed, int status)
|
||||
{
|
||||
// Find address / label in model
|
||||
QList<AddressTableEntry>::iterator lower = qLowerBound(
|
||||
QList<AddressTableEntry>::iterator lower = std::lower_bound(
|
||||
cachedAddressTable.begin(), cachedAddressTable.end(), pubCoin, AddressTableEntryLessThan());
|
||||
QList<AddressTableEntry>::iterator upper = qUpperBound(
|
||||
QList<AddressTableEntry>::iterator upper = std::upper_bound(
|
||||
cachedAddressTable.begin(), cachedAddressTable.end(), pubCoin, AddressTableEntryLessThan());
|
||||
int lowerIndex = (lower - cachedAddressTable.begin());
|
||||
bool inModel = (lower != upper);
|
||||
@@ -317,7 +319,7 @@ QVariant AddressTableModel::headerData(int section, Qt::Orientation orientation,
|
||||
Qt::ItemFlags AddressTableModel::flags(const QModelIndex& index) const
|
||||
{
|
||||
if (!index.isValid())
|
||||
return 0;
|
||||
return Qt::ItemFlags();
|
||||
AddressTableEntry* rec = static_cast<AddressTableEntry*>(index.internalPointer());
|
||||
|
||||
Qt::ItemFlags retval = Qt::ItemIsSelectable | Qt::ItemIsEnabled;
|
||||
|
||||
+2
-2
@@ -357,7 +357,7 @@ void BitcoinApplication::createWindow(const NetworkStyle* networkStyle)
|
||||
|
||||
void BitcoinApplication::createSplashScreen(const NetworkStyle* networkStyle)
|
||||
{
|
||||
SplashScreen* splash = new SplashScreen(0, networkStyle);
|
||||
SplashScreen* splash = new SplashScreen(Qt::WindowFlags(), networkStyle);
|
||||
// We don't hold a direct pointer to the splash screen after creation, so use
|
||||
// Qt::WA_DeleteOnClose to make sure that the window will be deleted eventually.
|
||||
splash->setAttribute(Qt::WA_DeleteOnClose);
|
||||
@@ -502,7 +502,6 @@ int main(int argc, char* argv[])
|
||||
Q_INIT_RESOURCE(agrarian_locale);
|
||||
Q_INIT_RESOURCE(agrarian);
|
||||
|
||||
BitcoinApplication app(argc, argv);
|
||||
#if QT_VERSION > 0x050100
|
||||
// Generate high-dpi pixmaps
|
||||
QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
|
||||
@@ -513,6 +512,7 @@ int main(int argc, char* argv[])
|
||||
#ifdef Q_OS_MAC
|
||||
QApplication::setAttribute(Qt::AA_DontShowIconsInMenus);
|
||||
#endif
|
||||
BitcoinApplication app(argc, argv);
|
||||
|
||||
// Register meta types used for QMetaObject::invokeMethod
|
||||
qRegisterMetaType<bool*>();
|
||||
|
||||
@@ -12,6 +12,8 @@
|
||||
#include "sync.h"
|
||||
#include "utiltime.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#include <QDebug>
|
||||
#include <QList>
|
||||
|
||||
@@ -63,7 +65,7 @@ public:
|
||||
|
||||
if (sortColumn >= 0)
|
||||
// sort cachedBanlist (use stable sort to prevent rows jumping around unneceesarily)
|
||||
qStableSort(cachedBanlist.begin(), cachedBanlist.end(), BannedNodeLessThan(sortColumn, sortOrder));
|
||||
std::stable_sort(cachedBanlist.begin(), cachedBanlist.end(), BannedNodeLessThan(sortColumn, sortOrder));
|
||||
}
|
||||
|
||||
int size() const
|
||||
@@ -147,7 +149,7 @@ QVariant BanTableModel::headerData(int section, Qt::Orientation orientation, int
|
||||
Qt::ItemFlags BanTableModel::flags(const QModelIndex &index) const
|
||||
{
|
||||
if(!index.isValid())
|
||||
return 0;
|
||||
return Qt::ItemFlags();
|
||||
|
||||
Qt::ItemFlags retval = Qt::ItemIsSelectable | Qt::ItemIsEnabled;
|
||||
return retval;
|
||||
|
||||
@@ -98,7 +98,11 @@ public:
|
||||
|
||||
const QFontMetrics fm(fontMetrics());
|
||||
int h = lineEdit()->minimumSizeHint().height();
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0)
|
||||
int w = fm.horizontalAdvance(BitcoinUnits::format(BitcoinUnits::AGR, BitcoinUnits::maxMoney(), false, BitcoinUnits::separatorAlways));
|
||||
#else
|
||||
int w = fm.width(BitcoinUnits::format(BitcoinUnits::AGR, BitcoinUnits::maxMoney(), false, BitcoinUnits::separatorAlways));
|
||||
#endif
|
||||
w += 2; // cursor blinking space
|
||||
|
||||
QStyleOptionSpinBox opt;
|
||||
@@ -159,7 +163,7 @@ protected:
|
||||
|
||||
StepEnabled stepEnabled() const
|
||||
{
|
||||
StepEnabled rv = 0;
|
||||
StepEnabled rv = StepEnabled();
|
||||
if (isReadOnly()) // Disable steps when AmountSpinBox is read-only
|
||||
return StepNone;
|
||||
if (text().isEmpty()) // Allow step-up with empty field
|
||||
|
||||
@@ -1283,7 +1283,11 @@ void BitcoinGUI::updateTorIcon()
|
||||
bool tor_enabled = clientModel->getTorInfo(ip_port);
|
||||
|
||||
if (tor_enabled) {
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
|
||||
if (labelTorIcon->pixmap(Qt::ReturnByValue).isNull()) {
|
||||
#else
|
||||
if (labelTorIcon->pixmap() == 0) {
|
||||
#endif
|
||||
QString ip_port_q = QString::fromStdString(ip_port);
|
||||
labelTorIcon->setPixmap(QIcon(":/icons/onion").pixmap(STATUSBAR_ICONSIZE, STATUSBAR_ICONSIZE));
|
||||
labelTorIcon->setToolTip(tr("Tor is <b>enabled</b>: %1").arg(ip_port_q));
|
||||
|
||||
@@ -52,7 +52,9 @@
|
||||
#include <QDoubleValidator>
|
||||
#include <QFileDialog>
|
||||
#include <QFont>
|
||||
#include <QGuiApplication>
|
||||
#include <QLineEdit>
|
||||
#include <QScreen>
|
||||
#include <QSettings>
|
||||
#include <QTextDocument> // for Qt::mightBeRichText
|
||||
#include <QThread>
|
||||
@@ -787,7 +789,12 @@ void restoreWindowGeometry(const QString& strSetting, const QSize& defaultSize,
|
||||
QSize size = settings.value(strSetting + "Size", defaultSize).toSize();
|
||||
|
||||
if (!pos.x() && !pos.y()) {
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
|
||||
QScreen* screenHandle = QGuiApplication::primaryScreen();
|
||||
QRect screen = screenHandle ? screenHandle->geometry() : QRect(QPoint(), size);
|
||||
#else
|
||||
QRect screen = QApplication::desktop()->screenGeometry();
|
||||
#endif
|
||||
pos.setX((screen.width() - size.width()) / 2);
|
||||
pos.setY((screen.height() - size.height()) / 2);
|
||||
}
|
||||
|
||||
@@ -219,12 +219,12 @@ QVariant OptionsModel::data(const QModelIndex& index, int role) const
|
||||
return settings.value("fUseProxy", false);
|
||||
case ProxyIP: {
|
||||
// contains IP at index 0 and port at index 1
|
||||
QStringList strlIpPort = settings.value("addrProxy").toString().split(":", QString::SkipEmptyParts);
|
||||
QStringList strlIpPort = settings.value("addrProxy").toString().split(":", Qt::SkipEmptyParts);
|
||||
return strlIpPort.at(0);
|
||||
}
|
||||
case ProxyPort: {
|
||||
// contains IP at index 0 and port at index 1
|
||||
QStringList strlIpPort = settings.value("addrProxy").toString().split(":", QString::SkipEmptyParts);
|
||||
QStringList strlIpPort = settings.value("addrProxy").toString().split(":", Qt::SkipEmptyParts);
|
||||
return strlIpPort.at(1);
|
||||
}
|
||||
|
||||
@@ -308,7 +308,7 @@ bool OptionsModel::setData(const QModelIndex& index, const QVariant& value, int
|
||||
break;
|
||||
case ProxyIP: {
|
||||
// contains current IP at index 0 and current port at index 1
|
||||
QStringList strlIpPort = settings.value("addrProxy").toString().split(":", QString::SkipEmptyParts);
|
||||
QStringList strlIpPort = settings.value("addrProxy").toString().split(":", Qt::SkipEmptyParts);
|
||||
// if that key doesn't exist or has a changed IP
|
||||
if (!settings.contains("addrProxy") || strlIpPort.at(0) != value.toString()) {
|
||||
// construct new value from new IP and current port
|
||||
@@ -319,7 +319,7 @@ bool OptionsModel::setData(const QModelIndex& index, const QVariant& value, int
|
||||
} break;
|
||||
case ProxyPort: {
|
||||
// contains current IP at index 0 and current port at index 1
|
||||
QStringList strlIpPort = settings.value("addrProxy").toString().split(":", QString::SkipEmptyParts);
|
||||
QStringList strlIpPort = settings.value("addrProxy").toString().split(":", Qt::SkipEmptyParts);
|
||||
// if that key doesn't exist or has a changed port
|
||||
if (!settings.contains("addrProxy") || strlIpPort.at(1) != value.toString()) {
|
||||
// construct new value from current IP and new port
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
#include <QNetworkReply>
|
||||
#include <QNetworkRequest>
|
||||
#include <QSslCertificate>
|
||||
#include <QSslConfiguration>
|
||||
#include <QSslError>
|
||||
#include <QSslSocket>
|
||||
#include <QStringList>
|
||||
@@ -129,9 +130,11 @@ void PaymentServer::LoadRootCAs(X509_STORE* _store)
|
||||
if (certFile != "-system-") {
|
||||
certList = QSslCertificate::fromPath(certFile);
|
||||
// Use those certificates when fetching payment requests, too:
|
||||
QSslSocket::setDefaultCaCertificates(certList);
|
||||
QSslConfiguration sslConfiguration = QSslConfiguration::defaultConfiguration();
|
||||
sslConfiguration.setCaCertificates(certList);
|
||||
QSslConfiguration::setDefaultConfiguration(sslConfiguration);
|
||||
} else
|
||||
certList = QSslSocket::systemCaCertificates();
|
||||
certList = QSslConfiguration::systemCaCertificates();
|
||||
|
||||
int nRootCerts = 0;
|
||||
const QDateTime currentTime = QDateTime::currentDateTime();
|
||||
@@ -372,7 +375,7 @@ void PaymentServer::handleURIOrFile(const QString& s)
|
||||
if (uri.hasQueryItem("r")) // payment request URI
|
||||
{
|
||||
QByteArray temp;
|
||||
temp.append(uri.queryItemValue("r"));
|
||||
temp.append(uri.queryItemValue("r").toUtf8());
|
||||
QString decoded = QUrl::fromPercentEncoding(temp);
|
||||
QUrl fetchUrl(decoded, QUrl::StrictMode);
|
||||
|
||||
@@ -507,7 +510,7 @@ bool PaymentServer::processPaymentRequest(PaymentRequestPlus& request, SendCoins
|
||||
QList<std::pair<CScript, CAmount> > sendingTos = request.getPayTo();
|
||||
QStringList addresses;
|
||||
|
||||
foreach (const PAIRTYPE(CScript, CAmount) & sendingTo, sendingTos) {
|
||||
for (const auto& sendingTo : sendingTos) {
|
||||
// Extract and check destination addresses
|
||||
CTxDestination dest;
|
||||
if (ExtractDestination(sendingTo.first, dest)) {
|
||||
@@ -597,7 +600,7 @@ void PaymentServer::fetchPaymentACK(CWallet* wallet, SendCoinsRecipient recipien
|
||||
}
|
||||
}
|
||||
|
||||
int length = payment.ByteSize();
|
||||
int length = static_cast<int>(payment.ByteSizeLong());
|
||||
netRequest.setHeader(QNetworkRequest::ContentLengthHeader, length);
|
||||
QByteArray serData(length, '\0');
|
||||
if (payment.SerializeToArray(serData.data(), length)) {
|
||||
|
||||
@@ -12,6 +12,8 @@
|
||||
#include "net.h"
|
||||
#include "sync.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#include <QDebug>
|
||||
#include <QList>
|
||||
#include <QTimer>
|
||||
@@ -83,7 +85,7 @@ public:
|
||||
|
||||
if (sortColumn >= 0)
|
||||
// sort cacheNodeStats (use stable sort to prevent rows jumping around unneceesarily)
|
||||
qStableSort(cachedNodeStats.begin(), cachedNodeStats.end(), NodeLessThan(sortColumn, sortOrder));
|
||||
std::stable_sort(cachedNodeStats.begin(), cachedNodeStats.end(), NodeLessThan(sortColumn, sortOrder));
|
||||
|
||||
// build index map
|
||||
mapNodeRows.clear();
|
||||
@@ -185,7 +187,7 @@ QVariant PeerTableModel::headerData(int section, Qt::Orientation orientation, in
|
||||
Qt::ItemFlags PeerTableModel::flags(const QModelIndex& index) const
|
||||
{
|
||||
if (!index.isValid())
|
||||
return 0;
|
||||
return Qt::ItemFlags();
|
||||
|
||||
Qt::ItemFlags retval = Qt::ItemIsSelectable | Qt::ItemIsEnabled;
|
||||
return retval;
|
||||
|
||||
@@ -706,10 +706,6 @@ void PrivacyDialog::setBalance(const CAmount& balance, const CAmount& unconfirme
|
||||
}
|
||||
}
|
||||
CAmount matureZerocoinBalance = zerocoinBalance - unconfirmedZerocoinBalance - immatureZerocoinBalance;
|
||||
CAmount nLockedBalance = 0;
|
||||
if (walletModel) {
|
||||
nLockedBalance = walletModel->getLockedBalance();
|
||||
}
|
||||
|
||||
ui->labelzAvailableAmount->setText(QString::number(zerocoinBalance/COIN) + QString(" zAGR "));
|
||||
ui->labelzAvailableAmount_2->setText(QString::number(matureZerocoinBalance/COIN) + QString(" zAGR "));
|
||||
|
||||
@@ -255,7 +255,7 @@ void ReceiveCoinsDialog::copyColumnToClipboard(int column)
|
||||
return;
|
||||
// correct for selection mode ContiguousSelection
|
||||
QModelIndex firstIndex = selection.at(0);
|
||||
GUIUtil::setClipboard(model->getRecentRequestsTableModel()->data(firstIndex.child(firstIndex.row(), column), Qt::EditRole).toString());
|
||||
GUIUtil::setClipboard(model->getRecentRequestsTableModel()->data(firstIndex.sibling(firstIndex.row(), column), Qt::EditRole).toString());
|
||||
}
|
||||
|
||||
// context menu
|
||||
@@ -300,4 +300,3 @@ void ReceiveCoinsDialog::receiveAddressUsed()
|
||||
clear();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -40,14 +40,26 @@ QRImageWidget::QRImageWidget(QWidget* parent) : QLabel(parent), contextMenu(0)
|
||||
|
||||
QImage QRImageWidget::exportImage()
|
||||
{
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
|
||||
const QPixmap pixmapValue = pixmap(Qt::ReturnByValue);
|
||||
if (pixmapValue.isNull())
|
||||
return QImage();
|
||||
return pixmapValue.toImage().scaled(EXPORT_IMAGE_SIZE, EXPORT_IMAGE_SIZE);
|
||||
#else
|
||||
if (!pixmap())
|
||||
return QImage();
|
||||
return pixmap()->toImage().scaled(EXPORT_IMAGE_SIZE, EXPORT_IMAGE_SIZE);
|
||||
#endif
|
||||
}
|
||||
|
||||
void QRImageWidget::mousePressEvent(QMouseEvent* event)
|
||||
{
|
||||
if (event->button() == Qt::LeftButton && pixmap()) {
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
|
||||
const bool hasPixmap = !pixmap(Qt::ReturnByValue).isNull();
|
||||
#else
|
||||
const bool hasPixmap = pixmap();
|
||||
#endif
|
||||
if (event->button() == Qt::LeftButton && hasPixmap) {
|
||||
event->accept();
|
||||
QMimeData* mimeData = new QMimeData;
|
||||
mimeData->setImageData(exportImage());
|
||||
@@ -62,8 +74,13 @@ void QRImageWidget::mousePressEvent(QMouseEvent* event)
|
||||
|
||||
void QRImageWidget::saveImage()
|
||||
{
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
|
||||
if (pixmap(Qt::ReturnByValue).isNull())
|
||||
return;
|
||||
#else
|
||||
if (!pixmap())
|
||||
return;
|
||||
#endif
|
||||
QString fn = GUIUtil::getSaveFileName(this, tr("Save QR Code"), QString(), tr("PNG Image (*.png)"), NULL);
|
||||
if (!fn.isEmpty()) {
|
||||
exportImage().save(fn);
|
||||
@@ -72,15 +89,25 @@ void QRImageWidget::saveImage()
|
||||
|
||||
void QRImageWidget::copyImage()
|
||||
{
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
|
||||
if (pixmap(Qt::ReturnByValue).isNull())
|
||||
return;
|
||||
#else
|
||||
if (!pixmap())
|
||||
return;
|
||||
#endif
|
||||
QApplication::clipboard()->setImage(exportImage());
|
||||
}
|
||||
|
||||
void QRImageWidget::contextMenuEvent(QContextMenuEvent* event)
|
||||
{
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)
|
||||
if (pixmap(Qt::ReturnByValue).isNull())
|
||||
return;
|
||||
#else
|
||||
if (!pixmap())
|
||||
return;
|
||||
#endif
|
||||
contextMenu->exec(event->globalPos());
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "optionsmodel.h"
|
||||
#include "streams.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
RecentRequestsTableModel::RecentRequestsTableModel(CWallet* wallet, WalletModel* parent) : walletModel(parent)
|
||||
{
|
||||
@@ -198,7 +199,7 @@ void RecentRequestsTableModel::addNewRequest(RecentRequestEntry& recipient)
|
||||
|
||||
void RecentRequestsTableModel::sort(int column, Qt::SortOrder order)
|
||||
{
|
||||
qSort(list.begin(), list.end(), RecentRequestEntryLessThan(column, order));
|
||||
std::sort(list.begin(), list.end(), RecentRequestEntryLessThan(column, order));
|
||||
emit dataChanged(index(0, 0, QModelIndex()), index(list.size() - 1, NUMBER_OF_COLUMNS - 1, QModelIndex()));
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,9 @@
|
||||
#include <QApplication>
|
||||
#include <QCloseEvent>
|
||||
#include <QDesktopWidget>
|
||||
#include <QGuiApplication>
|
||||
#include <QPainter>
|
||||
#include <QScreen>
|
||||
|
||||
SplashScreen::SplashScreen(Qt::WindowFlags f, const NetworkStyle* networkStyle) : QWidget(0, f), curAlignment(0)
|
||||
{
|
||||
@@ -52,7 +54,11 @@ SplashScreen::SplashScreen(Qt::WindowFlags f, const NetworkStyle* networkStyle)
|
||||
// check font size and drawing with
|
||||
pixPaint.setFont(QFont(font, 28 * fontFactor));
|
||||
QFontMetrics fm = pixPaint.fontMetrics();
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0)
|
||||
int titleTextWidth = fm.horizontalAdvance(titleText);
|
||||
#else
|
||||
int titleTextWidth = fm.width(titleText);
|
||||
#endif
|
||||
if (titleTextWidth > 160) {
|
||||
// strange font rendering, Arial probably not found
|
||||
fontFactor = 0.75;
|
||||
@@ -79,7 +85,11 @@ SplashScreen::SplashScreen(Qt::WindowFlags f, const NetworkStyle* networkStyle)
|
||||
boldFont.setWeight(QFont::Bold);
|
||||
pixPaint.setFont(boldFont);
|
||||
fm = pixPaint.fontMetrics();
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0)
|
||||
int titleAddTextWidth = fm.horizontalAdvance(titleAddText);
|
||||
#else
|
||||
int titleAddTextWidth = fm.width(titleAddText);
|
||||
#endif
|
||||
pixPaint.drawText(pixmap.width() - titleAddTextWidth - 10, pixmap.height() - 25, titleAddText);
|
||||
}
|
||||
|
||||
@@ -92,7 +102,13 @@ SplashScreen::SplashScreen(Qt::WindowFlags f, const NetworkStyle* networkStyle)
|
||||
QRect r(QPoint(), pixmap.size());
|
||||
resize(r.size());
|
||||
setFixedSize(r.size());
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
|
||||
QScreen* screenHandle = QGuiApplication::primaryScreen();
|
||||
QRect screen = screenHandle ? screenHandle->geometry() : QRect(QPoint(), r.size());
|
||||
move(screen.center() - r.center());
|
||||
#else
|
||||
move(QApplication::desktop()->screenGeometry().center() - r.center());
|
||||
#endif
|
||||
|
||||
subscribeToCoreSignals();
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
|
||||
#include <QColor>
|
||||
#include <QPainter>
|
||||
#include <QPainterPath>
|
||||
#include <QTimer>
|
||||
|
||||
#include <cmath>
|
||||
|
||||
@@ -254,14 +254,14 @@ QString TransactionDesc::toHTML(CWallet* wallet, CWalletTx& wtx, TransactionReco
|
||||
strHTML += "<b>" + tr("Output index") + ":</b> " + QString::number(rec->getOutputIndex()) + "<br>";
|
||||
|
||||
// Message from normal agrarian:URI (agrarian:XyZ...?message=example)
|
||||
foreach (const PAIRTYPE(string, string) & r, wtx.vOrderForm)
|
||||
for (const auto& r : wtx.vOrderForm)
|
||||
if (r.first == "Message")
|
||||
strHTML += "<br><b>" + tr("Message") + ":</b><br>" + GUIUtil::HtmlEscape(r.second, true) + "<br>";
|
||||
|
||||
//
|
||||
// PaymentRequest info:
|
||||
//
|
||||
foreach (const PAIRTYPE(string, string) & r, wtx.vOrderForm) {
|
||||
for (const auto& r : wtx.vOrderForm) {
|
||||
if (r.first == "PaymentRequest") {
|
||||
PaymentRequestPlus req;
|
||||
req.parse(QByteArray::fromRawData(r.second.data(), r.second.size()));
|
||||
|
||||
@@ -217,7 +217,7 @@ QList<TransactionRecord> TransactionRecord::decomposeTransaction(const CWallet*
|
||||
if (fAllToMe > mine) fAllToMe = mine;
|
||||
}
|
||||
|
||||
if (fAllFromMeDenom && fAllToMeDenom && nFromMe * nToMe) {
|
||||
if (fAllFromMeDenom && fAllToMeDenom && nFromMe && nToMe) {
|
||||
parts.append(TransactionRecord(hash, nTime, TransactionRecord::ObfuscationDenominate, "", -nDebit, nCredit));
|
||||
parts.last().involvesWatchAddress = false; // maybe pass to TransactionRecord as constructor argument
|
||||
} else if (fAllFromMe && fAllToMe) {
|
||||
|
||||
@@ -20,6 +20,8 @@
|
||||
#include "util.h"
|
||||
#include "wallet/wallet.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#include <QColor>
|
||||
#include <QDateTime>
|
||||
#include <QDebug>
|
||||
@@ -95,9 +97,9 @@ public:
|
||||
qDebug() << "TransactionTablePriv::updateWallet : " + QString::fromStdString(hash.ToString()) + " " + QString::number(status);
|
||||
|
||||
// Find bounds of this transaction in model
|
||||
QList<TransactionRecord>::iterator lower = qLowerBound(
|
||||
QList<TransactionRecord>::iterator lower = std::lower_bound(
|
||||
cachedWallet.begin(), cachedWallet.end(), hash, TxLessThan());
|
||||
QList<TransactionRecord>::iterator upper = qUpperBound(
|
||||
QList<TransactionRecord>::iterator upper = std::upper_bound(
|
||||
cachedWallet.begin(), cachedWallet.end(), hash, TxLessThan());
|
||||
int lowerIndex = (lower - cachedWallet.begin());
|
||||
int upperIndex = (upper - cachedWallet.begin());
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
#include <QSettings>
|
||||
#include <QSignalMapper>
|
||||
#include <QTableView>
|
||||
#include <QTime>
|
||||
#include <QUrl>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
@@ -230,7 +231,7 @@ void TransactionView::setModel(WalletModel* model)
|
||||
|
||||
if (model->getOptionsModel()) {
|
||||
// Add third party transaction URLs to context menu
|
||||
QStringList listUrls = model->getOptionsModel()->getThirdPartyTxUrls().split("|", QString::SkipEmptyParts);
|
||||
QStringList listUrls = model->getOptionsModel()->getThirdPartyTxUrls().split("|", Qt::SkipEmptyParts);
|
||||
for (int i = 0; i < listUrls.size(); ++i) {
|
||||
QString host = QUrl(listUrls[i].trimmed(), QUrl::StrictMode).host();
|
||||
if (!host.isEmpty()) {
|
||||
@@ -275,30 +276,30 @@ void TransactionView::chooseDate(int idx)
|
||||
break;
|
||||
case Today:
|
||||
transactionProxyModel->setDateRange(
|
||||
QDateTime(current),
|
||||
QDateTime(current, QTime(0, 0)),
|
||||
TransactionFilterProxy::MAX_DATE);
|
||||
break;
|
||||
case ThisWeek: {
|
||||
// Find last Monday
|
||||
QDate startOfWeek = current.addDays(-(current.dayOfWeek() - 1));
|
||||
transactionProxyModel->setDateRange(
|
||||
QDateTime(startOfWeek),
|
||||
QDateTime(startOfWeek, QTime(0, 0)),
|
||||
TransactionFilterProxy::MAX_DATE);
|
||||
|
||||
} break;
|
||||
case ThisMonth:
|
||||
transactionProxyModel->setDateRange(
|
||||
QDateTime(QDate(current.year(), current.month(), 1)),
|
||||
QDateTime(QDate(current.year(), current.month(), 1), QTime(0, 0)),
|
||||
TransactionFilterProxy::MAX_DATE);
|
||||
break;
|
||||
case LastMonth:
|
||||
transactionProxyModel->setDateRange(
|
||||
QDateTime(QDate(current.year(), current.month() - 1, 1)),
|
||||
QDateTime(QDate(current.year(), current.month(), 1)));
|
||||
QDateTime(QDate(current.year(), current.month() - 1, 1), QTime(0, 0)),
|
||||
QDateTime(QDate(current.year(), current.month(), 1), QTime(0, 0)));
|
||||
break;
|
||||
case ThisYear:
|
||||
transactionProxyModel->setDateRange(
|
||||
QDateTime(QDate(current.year(), 1, 1)),
|
||||
QDateTime(QDate(current.year(), 1, 1), QTime(0, 0)),
|
||||
TransactionFilterProxy::MAX_DATE);
|
||||
break;
|
||||
case Range:
|
||||
@@ -565,8 +566,8 @@ void TransactionView::dateRangeChanged()
|
||||
if (!transactionProxyModel)
|
||||
return;
|
||||
transactionProxyModel->setDateRange(
|
||||
QDateTime(dateFrom->date()),
|
||||
QDateTime(dateTo->date()).addDays(1));
|
||||
QDateTime(dateFrom->date(), QTime(0, 0)),
|
||||
QDateTime(dateTo->date(), QTime(0, 0)).addDays(1));
|
||||
}
|
||||
|
||||
void TransactionView::focusTransaction(const QModelIndex& idx)
|
||||
|
||||
@@ -44,7 +44,7 @@ class ShutdownWindow : public QWidget
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ShutdownWindow(QWidget* parent = 0, Qt::WindowFlags f = 0);
|
||||
ShutdownWindow(QWidget* parent = 0, Qt::WindowFlags f = Qt::WindowFlags());
|
||||
static void showShutdownWindow(BitcoinGUI* window);
|
||||
|
||||
protected:
|
||||
|
||||
@@ -769,8 +769,8 @@ void WalletModel::listZerocoinMints(std::set<CMintMeta>& setMints, bool fUnusedO
|
||||
void WalletModel::loadReceiveRequests(std::vector<std::string>& vReceiveRequests)
|
||||
{
|
||||
LOCK(wallet->cs_wallet);
|
||||
for (const PAIRTYPE(CTxDestination, CAddressBookData) & item : wallet->mapAddressBook)
|
||||
for (const PAIRTYPE(std::string, std::string) & item2 : item.second.destdata)
|
||||
for (const auto& item : wallet->mapAddressBook)
|
||||
for (const auto& item2 : item.second.destdata)
|
||||
if (item2.first.size() > 2 && item2.first.substr(0, 2) == "rr") // receive request
|
||||
vReceiveRequests.push_back(item2.second);
|
||||
}
|
||||
|
||||
@@ -377,6 +377,7 @@ protected:
|
||||
public:
|
||||
CScript() { }
|
||||
CScript(const CScript& b) : std::vector<unsigned char>(b.begin(), b.end()) { }
|
||||
CScript& operator=(const CScript& b) = default;
|
||||
CScript(const_iterator pbegin, const_iterator pend) : std::vector<unsigned char>(pbegin, pend) { }
|
||||
CScript(const unsigned char* pbegin, const unsigned char* pend) : std::vector<unsigned char>(pbegin, pend) { }
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@ bool Solver(const CScript& scriptPubKey, txnouttype& typeRet, vector<vector<unsi
|
||||
|
||||
// Scan templates
|
||||
const CScript& script1 = scriptPubKey;
|
||||
for (const PAIRTYPE(txnouttype, CScript)& tplate : mTemplates)
|
||||
for (const auto& tplate : mTemplates)
|
||||
{
|
||||
const CScript& script2 = tplate.second;
|
||||
vSolutionsRet.clear();
|
||||
|
||||
@@ -50,6 +50,7 @@ public:
|
||||
CTxMemPoolEntry(const CTransaction& _tx, const CAmount& _nFee, int64_t _nTime, double _dPriority, unsigned int _nHeight);
|
||||
CTxMemPoolEntry();
|
||||
CTxMemPoolEntry(const CTxMemPoolEntry& other);
|
||||
CTxMemPoolEntry& operator=(const CTxMemPoolEntry& other) = default;
|
||||
|
||||
const CTransaction& GetTx() const { return this->tx; }
|
||||
double GetPriority(unsigned int currentHeight) const;
|
||||
|
||||
+1
-1
@@ -557,7 +557,7 @@ bool TryCreateDirectory(const boost::filesystem::path& p)
|
||||
{
|
||||
try {
|
||||
return boost::filesystem::create_directory(p);
|
||||
} catch (boost::filesystem::filesystem_error) {
|
||||
} catch (const boost::filesystem::filesystem_error&) {
|
||||
if (!boost::filesystem::exists(p) || !boost::filesystem::is_directory(p))
|
||||
throw;
|
||||
}
|
||||
|
||||
@@ -29,8 +29,6 @@
|
||||
|
||||
using namespace std;
|
||||
|
||||
void EnsureWalletIsUnlocked(bool fAllowAnonOnly);
|
||||
|
||||
std::string static EncodeDumpTime(int64_t nTime)
|
||||
{
|
||||
return DateTimeStrFormat("%Y-%m-%dT%H:%M:%SZ", nTime);
|
||||
|
||||
@@ -68,7 +68,7 @@ void WalletTxToJSON(const CWalletTx& wtx, UniValue& entry)
|
||||
entry.push_back(Pair("walletconflicts", conflicts));
|
||||
entry.push_back(Pair("time", wtx.GetTxTime()));
|
||||
entry.push_back(Pair("timereceived", (int64_t)wtx.nTimeReceived));
|
||||
for (const PAIRTYPE(string, string) & item : wtx.mapValue)
|
||||
for (const auto& item : wtx.mapValue)
|
||||
entry.push_back(Pair(item.first, item.second));
|
||||
}
|
||||
|
||||
@@ -312,7 +312,7 @@ UniValue getaddressesbyaccount(const UniValue& params, bool fHelp)
|
||||
|
||||
// Find all addresses that have the given account
|
||||
UniValue ret(UniValue::VARR);
|
||||
for (const PAIRTYPE(CBitcoinAddress, CAddressBookData) & item : pwalletMain->mapAddressBook) {
|
||||
for (const auto& item : pwalletMain->mapAddressBook) {
|
||||
const CBitcoinAddress& address = item.first;
|
||||
const string& strName = item.second.name;
|
||||
if (strName == strAccount)
|
||||
@@ -1109,7 +1109,7 @@ UniValue ListReceived(const UniValue& params, bool fByAccounts)
|
||||
// Reply
|
||||
UniValue ret(UniValue::VARR);
|
||||
map<string, tallyitem> mapAccountTally;
|
||||
for (const PAIRTYPE(CBitcoinAddress, CAddressBookData) & item : pwalletMain->mapAddressBook) {
|
||||
for (const auto& item : pwalletMain->mapAddressBook) {
|
||||
const CBitcoinAddress& address = item.first;
|
||||
const string& strAccount = item.second.name;
|
||||
map<CBitcoinAddress, tallyitem>::iterator it = mapTally.find(address);
|
||||
@@ -1483,7 +1483,7 @@ UniValue listaccounts(const UniValue& params, bool fHelp)
|
||||
includeWatchonly = includeWatchonly | ISMINE_WATCH_ONLY;
|
||||
|
||||
map<string, CAmount> mapAccountBalances;
|
||||
for (const PAIRTYPE(CTxDestination, CAddressBookData) & entry : pwalletMain->mapAddressBook) {
|
||||
for (const auto& entry : pwalletMain->mapAddressBook) {
|
||||
if (IsMine(*pwalletMain, entry.first) & includeWatchonly) // This address belongs to me
|
||||
mapAccountBalances[entry.second.name] = 0;
|
||||
}
|
||||
@@ -1515,7 +1515,7 @@ UniValue listaccounts(const UniValue& params, bool fHelp)
|
||||
mapAccountBalances[entry.strAccount] += entry.nCreditDebit;
|
||||
|
||||
UniValue ret(UniValue::VOBJ);
|
||||
for (const PAIRTYPE(string, CAmount) & accountBalance : mapAccountBalances) {
|
||||
for (const auto& accountBalance : mapAccountBalances) {
|
||||
ret.push_back(Pair(accountBalance.first, ValueFromAmount(accountBalance.second)));
|
||||
}
|
||||
return ret;
|
||||
|
||||
@@ -2673,7 +2673,7 @@ bool CWallet::DelAddressBook(const CTxDestination& address)
|
||||
if (fFileBacked) {
|
||||
// Delete destdata tuples associated with address
|
||||
std::string strAddress = CBitcoinAddress(address).ToString();
|
||||
for (const PAIRTYPE(string, string) & item : mapAddressBook[address].destdata) {
|
||||
for (const auto& item : mapAddressBook[address].destdata) {
|
||||
CWalletDB(strWalletFile).EraseDestData(strAddress, item.first);
|
||||
}
|
||||
}
|
||||
@@ -2959,7 +2959,7 @@ set<CTxDestination> CWallet::GetAccountAddresses(string strAccount) const
|
||||
{
|
||||
LOCK(cs_wallet);
|
||||
set<CTxDestination> result;
|
||||
for (const PAIRTYPE(CTxDestination, CAddressBookData) & item : mapAddressBook) {
|
||||
for (const auto& item : mapAddressBook) {
|
||||
const CTxDestination& address = item.first;
|
||||
const string& strName = item.second.name;
|
||||
if (strName == strAccount)
|
||||
@@ -5075,4 +5075,3 @@ void CWallet::PrecomputeSpends()
|
||||
MilliSleep(5000);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -592,11 +592,11 @@ bool GenerateAccumulatorWitness(CoinWitnessData* coinWitness, AccumulatorMap& ma
|
||||
return true;
|
||||
|
||||
// TODO: I know that could merge all of this exception but maybe it's not really good.. think if we should have a different treatment for each one
|
||||
} catch (searchMintHeightException e) {
|
||||
} catch (const searchMintHeightException& e) {
|
||||
return error("%s: searchMintHeightException: %s", __func__, e.message);
|
||||
} catch (ChecksumInDbNotFoundException e) {
|
||||
} catch (const ChecksumInDbNotFoundException& e) {
|
||||
return error("%s: ChecksumInDbNotFoundException: %s", __func__, e.message);
|
||||
} catch (GetPubcoinException e) {
|
||||
} catch (const GetPubcoinException& e) {
|
||||
return error("%s: GetPubcoinException: %s", __func__, e.message);
|
||||
}
|
||||
}
|
||||
@@ -790,9 +790,9 @@ bool CalculateAccumulatorWitnessFor(
|
||||
|
||||
return true;
|
||||
|
||||
} catch (ChecksumInDbNotFoundException e) {
|
||||
} catch (const ChecksumInDbNotFoundException& e) {
|
||||
return error("%s: ChecksumInDbNotFoundException: %s", __func__, e.message);
|
||||
} catch (GetPubcoinException e) {
|
||||
} catch (const GetPubcoinException& e) {
|
||||
return error("%s: GetPubcoinException: %s", __func__, e.message);
|
||||
}
|
||||
}
|
||||
@@ -877,11 +877,11 @@ bool GenerateAccumulatorWitness(
|
||||
return true;
|
||||
|
||||
// TODO: I know that could merge all of this exception but maybe it's not really good.. think if we should have a different treatment for each one
|
||||
} catch (searchMintHeightException e) {
|
||||
} catch (const searchMintHeightException& e) {
|
||||
return error("%s: searchMintHeightException: %s", __func__, e.message);
|
||||
} catch (ChecksumInDbNotFoundException e) {
|
||||
} catch (const ChecksumInDbNotFoundException& e) {
|
||||
return error("%s: ChecksumInDbNotFoundException: %s", __func__, e.message);
|
||||
} catch (GetPubcoinException e) {
|
||||
} catch (const GetPubcoinException& e) {
|
||||
return error("%s: GetPubcoinException: %s", __func__, e.message);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user