aboutsummaryrefslogtreecommitdiff
path: root/src/qt/walletmodel.cpp
diff options
context:
space:
mode:
authorBrandon Dahler <brandon.dahler@gmail.com>2013-04-13 00:13:08 -0500
committerBrandon Dahler <brandon.dahler@gmail.com>2013-11-10 09:36:28 -0600
commit51ed9ec971614aebdbfbd9527aba365dd0afd437 (patch)
treed2f910390e55aef857023812fbdaefdd66cd99ff /src/qt/walletmodel.cpp
parent7c4c207be8420d394a5abc4368d1bb69ad4f8067 (diff)
Cleanup code using forward declarations.
Use misc methods of avoiding unnecesary header includes. Replace int typedefs with int##_t from stdint.h. Replace PRI64[xdu] with PRI[xdu]64 from inttypes.h. Normalize QT_VERSION ifs where possible. Resolve some indirect dependencies as direct ones. Remove extern declarations from .cpp files.
Diffstat (limited to 'src/qt/walletmodel.cpp')
-rw-r--r--src/qt/walletmodel.cpp25
1 files changed, 16 insertions, 9 deletions
diff --git a/src/qt/walletmodel.cpp b/src/qt/walletmodel.cpp
index 1c24ffb20b..b1d770e1a7 100644
--- a/src/qt/walletmodel.cpp
+++ b/src/qt/walletmodel.cpp
@@ -3,18 +3,25 @@
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "walletmodel.h"
-#include "guiconstants.h"
-#include "optionsmodel.h"
+
#include "addresstablemodel.h"
+#include "guiconstants.h"
#include "transactiontablemodel.h"
+#include "base58.h"
+#include "db.h"
+#include "keystore.h"
+#include "main.h"
+#include "sync.h"
#include "ui_interface.h"
+#include "wallet.h"
#include "walletdb.h" // for BackupWallet
-#include "base58.h"
+#include <stdint.h>
+
+#include <QDebug>
#include <QSet>
#include <QTimer>
-#include <QDebug>
WalletModel::WalletModel(CWallet *wallet, OptionsModel *optionsModel, QObject *parent) :
QObject(parent), wallet(wallet), optionsModel(optionsModel), addressTableModel(0),
@@ -133,7 +140,7 @@ WalletModel::SendCoinsReturn WalletModel::prepareTransaction(WalletModelTransact
{
qint64 total = 0;
QList<SendCoinsRecipient> recipients = transaction.getRecipients();
- std::vector<std::pair<CScript, int64> > vecSend;
+ std::vector<std::pair<CScript, int64_t> > vecSend;
if(recipients.empty())
{
@@ -148,7 +155,7 @@ WalletModel::SendCoinsReturn WalletModel::prepareTransaction(WalletModelTransact
{
if (rcp.paymentRequest.IsInitialized())
{ // PaymentRequest...
- int64 subtotal = 0;
+ int64_t subtotal = 0;
const payments::PaymentDetails& details = rcp.paymentRequest.getDetails();
for (int i = 0; i < details.outputs_size(); i++)
{
@@ -157,7 +164,7 @@ WalletModel::SendCoinsReturn WalletModel::prepareTransaction(WalletModelTransact
subtotal += out.amount();
const unsigned char* scriptStr = (const unsigned char*)out.script().data();
CScript scriptPubKey(scriptStr, scriptStr+out.script().size());
- vecSend.push_back(std::pair<CScript, int64>(scriptPubKey, out.amount()));
+ vecSend.push_back(std::pair<CScript, int64_t>(scriptPubKey, out.amount()));
}
if (subtotal <= 0)
{
@@ -180,7 +187,7 @@ WalletModel::SendCoinsReturn WalletModel::prepareTransaction(WalletModelTransact
CScript scriptPubKey;
scriptPubKey.SetDestination(CBitcoinAddress(rcp.address.toStdString()).Get());
- vecSend.push_back(std::pair<CScript, int64>(scriptPubKey, rcp.amount));
+ vecSend.push_back(std::pair<CScript, int64_t>(scriptPubKey, rcp.amount));
total += rcp.amount;
}
@@ -205,7 +212,7 @@ WalletModel::SendCoinsReturn WalletModel::prepareTransaction(WalletModelTransact
LOCK2(cs_main, wallet->cs_wallet);
transaction.newPossibleKeyChange(wallet);
- int64 nFeeRequired = 0;
+ int64_t nFeeRequired = 0;
std::string strFailReason;
CWalletTx *newTx = transaction.getTransaction();