Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,12 @@ GRIDCOIN_CORE_H = \
block.h \
boinc.h \
checkpoints.h \
coincontrol.h \
compat.h \
compat/byteswap.h \
compat/endian.h \
contract/polls.h \
contract/rain.h \
crypter.h \
db.h \
fs.h \
fwd.h \
global_objects.hpp \
Expand Down Expand Up @@ -150,8 +148,12 @@ GRIDCOIN_CORE_H = \
util/time.h \
util.h \
version.h \
walletdb.h \
wallet.h
wallet/coincontrol.h \
wallet/db.h \
wallet/walletdb.h \
wallet/wallet.h \
wallet/ismine.h


GRIDCOIN_CORE_CPP = addrdb.cpp \
addrman.cpp \
Expand All @@ -166,7 +168,6 @@ GRIDCOIN_CORE_CPP = addrdb.cpp \
contract/polls.cpp \
contract/rain.cpp \
crypter.cpp \
db.cpp \
fs.cpp \
gridcoin.cpp \
init.cpp \
Expand Down Expand Up @@ -194,14 +195,12 @@ GRIDCOIN_CORE_CPP = addrdb.cpp \
contract/rpccontract.cpp \
rpcblockchain.cpp \
rpcclient.cpp \
rpcdump.cpp \
rpcmisc.cpp \
rpcmining.cpp \
rpcnet.cpp \
rpcprotocol.cpp \
rpcrawtransaction.cpp \
rpcserver.cpp \
rpcwallet.cpp \
rpcdataacq.cpp \
scraper_net.cpp \
scraper/http.cpp \
Expand All @@ -223,8 +222,11 @@ GRIDCOIN_CORE_CPP = addrdb.cpp \
util/time.cpp \
util.cpp \
version.cpp \
wallet.cpp \
walletdb.cpp
wallet/db.cpp \
wallet/rpcdump.cpp \
wallet/rpcwallet.cpp \
wallet/wallet.cpp \
wallet/walletdb.cpp


obj/build.h: FORCE
Expand Down
4 changes: 2 additions & 2 deletions src/backup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// Backup related functions are placed here to keep vital sections of
// code contained while maintaining clean code.

#include "walletdb.h"
#include "wallet.h"
#include "wallet/walletdb.h"
#include "wallet/wallet.h"
#include "util.h"

#include <boost/filesystem.hpp>
Expand Down
2 changes: 1 addition & 1 deletion src/gridcoinresearchd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include "util.h"
#include "net.h"
#include "txdb.h"
#include "walletdb.h"
#include "wallet/walletdb.h"
#include "init.h"
#include "rpcserver.h"
#include "rpcclient.h"
Expand Down
2 changes: 1 addition & 1 deletion src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include "util.h"
#include "net.h"
#include "txdb.h"
#include "walletdb.h"
#include "wallet/walletdb.h"
#include "banman.h"
#include "rpcserver.h"
#include "init.h"
Expand Down
2 changes: 1 addition & 1 deletion src/init.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#ifndef BITCOIN_INIT_H
#define BITCOIN_INIT_H

#include "wallet.h"
#include "wallet/wallet.h"
#include <boost/thread.hpp>

extern CWallet* pwalletMain;
Expand Down
8 changes: 4 additions & 4 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -828,8 +828,8 @@ std::string DefaultWalletAddress()
{
const CBitcoinAddress& address = item.first;
const std::string& strName = item.second;
bool fMine = IsMine(*pwalletMain, address.Get());
if (fMine && strName == "Default")
isminetype fMine = IsMine(*pwalletMain, address.Get());
if ((fMine != ISMINE_NO) && strName == "Default")
{
sDefaultWalletAddress=CBitcoinAddress(address).ToString();
return sDefaultWalletAddress;
Expand All @@ -841,8 +841,8 @@ std::string DefaultWalletAddress()
{
const CBitcoinAddress& address = item.first;
//const std::string& strName = item.second;
bool fMine = IsMine(*pwalletMain, address.Get());
if (fMine)
isminetype fMine = IsMine(*pwalletMain, address.Get());
if (fMine != ISMINE_NO)
{
sDefaultWalletAddress=CBitcoinAddress(address).ToString();
return sDefaultWalletAddress;
Expand Down
1 change: 1 addition & 0 deletions src/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "sync.h"
#include "script.h"
#include "scrypt.h"
#include "wallet/ismine.h"

#include <map>
#include <unordered_map>
Expand Down
2 changes: 1 addition & 1 deletion src/miner.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#define NOVACOIN_MINER_H

#include "main.h"
#include "wallet.h"
#include "wallet/wallet.h"

// struct CMinerStatus is in wallet.h to prevent a circular header reference issue

Expand Down
2 changes: 1 addition & 1 deletion src/net.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "config/gridcoin-config.h"
#endif

#include "db.h"
#include "wallet/db.h"
#include "banman.h"
#include "net.h"
#include "init.h"
Expand Down
2 changes: 1 addition & 1 deletion src/neuralnet/contract/contract.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include "neuralnet/researcher.h"
#include "neuralnet/superblock.h"
#include "util.h"
#include "wallet.h"
#include "wallet/wallet.h"

using namespace NN;

Expand Down
4 changes: 2 additions & 2 deletions src/neuralnet/contract/message.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#include "neuralnet/contract/message.h"
#include "neuralnet/contract/contract.h"
#include "script.h"
#include "wallet.h"
#include "wallet/wallet.h"

#include "coincontrol.h"
#include "wallet/coincontrol.h"

using namespace NN;

Expand Down
6 changes: 3 additions & 3 deletions src/qt/addresstablemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include "guiutil.h"
#include "walletmodel.h"

#include "wallet.h"
#include "wallet/wallet.h"
#include "base58.h"
#include "util.h"

Expand Down Expand Up @@ -64,8 +64,8 @@ class AddressTablePriv
{
const CBitcoinAddress& address = item.first;
const std::string& strName = item.second;
bool fMine = IsMine(*wallet, address.Get());
cachedAddressTable.append(AddressTableEntry(fMine ? AddressTableEntry::Receiving : AddressTableEntry::Sending,
isminetype fMine = IsMine(*wallet, address.Get());
cachedAddressTable.append(AddressTableEntry((fMine != ISMINE_NO) ? AddressTableEntry::Receiving : AddressTableEntry::Sending,
QString::fromStdString(strName),
QString::fromStdString(address.ToString())));
}
Expand Down
2 changes: 2 additions & 0 deletions src/qt/addresstablemodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#include <QAbstractTableModel>
#include <QStringList>

#include "wallet/ismine.h"

class AddressTablePriv;
class CWallet;
class WalletModel;
Expand Down
2 changes: 1 addition & 1 deletion src/qt/bitcoingui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
#include "notificator.h"
#include "guiutil.h"
#include "rpcconsole.h"
#include "wallet.h"
#include "wallet/wallet.h"
#include "init.h"
#include "block.h"
#include "miner.h"
Expand Down
2 changes: 1 addition & 1 deletion src/qt/coincontroldialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "walletmodel.h"
#include "addresstablemodel.h"
#include "optionsmodel.h"
#include "coincontrol.h"
#include "wallet/coincontrol.h"

#include <QApplication>
#include <QCheckBox>
Expand Down
2 changes: 1 addition & 1 deletion src/qt/optionsmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include <QSettings>

#include "init.h"
#include "walletdb.h"
#include "wallet/walletdb.h"
#include "guiutil.h"

OptionsModel::OptionsModel(QObject *parent) :
Expand Down
2 changes: 1 addition & 1 deletion src/qt/sendcoinsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include "guiutil.h"
#include "askpassphrasedialog.h"

#include "coincontrol.h"
#include "wallet/coincontrol.h"
#include "coincontroldialog.h"

#include <QMessageBox>
Expand Down
2 changes: 1 addition & 1 deletion src/qt/signverifymessagedialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include "optionsmodel.h"
#include "streams.h"
#include "walletmodel.h"
#include "wallet.h"
#include "wallet/wallet.h"

#include <string>
#include <vector>
Expand Down
22 changes: 11 additions & 11 deletions src/qt/transactiondesc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include "guiutil.h"
#include "bitcoinunits.h"
#include "main.h"
#include "wallet.h"
#include "wallet/wallet.h"
#include "txdb.h"
#include "ui_interface.h"
#include "base58.h"
Expand Down Expand Up @@ -154,11 +154,11 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx, unsigned int vo
// Credit
for (auto const& txout : wtx.vout)
{
if (wallet->IsMine(txout))
if (wallet->IsMine(txout) != ISMINE_NO)
{
CTxDestination address;

if (ExtractDestination(txout.scriptPubKey, address) && IsMine(*wallet, address))
if (ExtractDestination(txout.scriptPubKey, address) && (IsMine(*wallet, address) != ISMINE_NO))
{
if (wallet->mapAddressBook.count(address))
{
Expand Down Expand Up @@ -229,19 +229,19 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx, unsigned int vo
bool fAllFromMe = true;

for (auto const& txin : wtx.vin)
fAllFromMe = fAllFromMe && wallet->IsMine(txin);
fAllFromMe = fAllFromMe && (wallet->IsMine(txin) != ISMINE_NO);

bool fAllToMe = true;

for (auto const& txout : wtx.vout)
fAllToMe = fAllToMe && wallet->IsMine(txout);
fAllToMe = fAllToMe && (wallet->IsMine(txout) != ISMINE_NO);

if (fAllFromMe)
{
// Debit
for (auto const& txout : wtx.vout)
{
if (wallet->IsMine(txout))
if (wallet->IsMine(txout) != ISMINE_NO)
continue;

if (!wtx.mapValue.count("to") || wtx.mapValue["to"].empty())
Expand Down Expand Up @@ -285,12 +285,12 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx, unsigned int vo
// Mixed debit transaction
for (auto const& txin : wtx.vin)

if (wallet->IsMine(txin))
if (wallet->IsMine(txin) != ISMINE_NO)
strHTML += "<b>" + tr("Debit") + ":</b> " + BitcoinUnits::formatWithUnit(BitcoinUnits::BTC, -wallet->GetDebit(txin)) + "<br>";

for (auto const& txout : wtx.vout)

if (wallet->IsMine(txout))
if (wallet->IsMine(txout) != ISMINE_NO)
strHTML += "<b>" + tr("Credit") + ":</b> " + BitcoinUnits::formatWithUnit(BitcoinUnits::BTC, wallet->GetCredit(txout)) + "<br>";
}
}
Expand Down Expand Up @@ -354,12 +354,12 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx, unsigned int vo

for (auto const& txin : wtx.vin)

if(wallet->IsMine(txin))
if (wallet->IsMine(txin) != ISMINE_NO)
strHTML += "<b>" + tr("Debit") + ":</b> " + BitcoinUnits::formatWithUnit(BitcoinUnits::BTC, -wallet->GetDebit(txin)) + "<br>";

for (auto const& txout : wtx.vout)

if(wallet->IsMine(txout))
if (wallet->IsMine(txout) != ISMINE_NO)
strHTML += "<b>" + tr("Credit") + ":</b> " + BitcoinUnits::formatWithUnit(BitcoinUnits::BTC, wallet->GetCredit(txout)) + "<br>";

strHTML += "<br><b>" + tr("Transaction Data") + "</b><br><br>";
Expand Down Expand Up @@ -391,7 +391,7 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx, unsigned int vo
strHTML += QString::fromStdString(CBitcoinAddress(address).ToString());

strHTML += " " + tr("Amount") + "=" + BitcoinUnits::formatWithUnit(BitcoinUnits::BTC, vout.nValue);
strHTML += " IsMine=" + (wallet->IsMine(vout) ? tr("true") : tr("false")) + "</li>";
strHTML += " IsMine=" + ((wallet->IsMine(vout) != ISMINE_NO) ? tr("true") : tr("false")) + "</li>";
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/qt/transactiondesc.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#include <QObject>
#include <string>

#include "wallet/ismine.h"

class CWallet;
class CWalletTx;

Expand Down
Loading