Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GUI][Model][Wallet] Cold staking UI. #1033

Merged
merged 102 commits into from
Nov 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
102 commits
Select commit Hold shift + click to select a range
51db234
[Wallet][RPC] getNewAddress and getNewStaking address methods created…
furszy Sep 13, 2019
e1e5481
[Trivial] Compiler warnings over the overrided methods fix.
furszy Oct 1, 2019
9defbad
[GUI][Model] Cold staking connected to transactionTableModle and dash…
furszy Oct 1, 2019
1ad01a4
[Refactor] Wallet key creation, stop throwing a runtime_error if the …
furszy Oct 1, 2019
af7047d
[GUI][Model] Cold staking balance connected to the total balance.
furszy Oct 1, 2019
52f29ee
[Spork] Segfault when spork value exceeds the bounds of ctime convers…
furszy Oct 1, 2019
58c3781
[GUI][Model] Dashboard, P2CS contract transaction connected.
furszy Oct 2, 2019
12bb7bf
[GUI] Dashboard, P2CS contract transaction inactive icon.
furszy Oct 2, 2019
b331677
[GUI] TransactionRecord representing P2CS address correctly.
furszy Oct 2, 2019
2b95a11
[GUI] Generate cold staking address connected.
furszy Oct 3, 2019
e508ad0
[GUI] ProcessSendCoinsReturn method moved to GuiTransactionsUtils to …
furszy Oct 4, 2019
6588860
[Model] WalletModel P2CS transactions connected.
furszy Oct 5, 2019
fa25b18
[GUI] Send widget, delete dialog if it's not used anymore.
furszy Oct 5, 2019
b43e813
[GUI] Cold Staking, P2CS delegation flow created.
furszy Oct 5, 2019
e6fcfbc
[GUI] Cold Staking, Owner address connected.
furszy Oct 5, 2019
5645358
[GUI] Cold staking filtering.
furszy Oct 5, 2019
223acec
[GUI][Model][Options] * Cold staking screen visible/invisible flow.
furszy Oct 7, 2019
5daacf8
[GUI] Dark theme icon for P2CS tx added.
furszy Oct 7, 2019
29e4914
[Wallet][Refactor] * AddressBookData class moved to it's own addressb…
furszy Oct 7, 2019
30d296b
[Wallet][RPC][Cold Staking] `delegatorremove`, Instead of remove the …
furszy Oct 7, 2019
30fa728
[Trivial] [Squash] license + auto-generated name removed.
furszy Oct 7, 2019
34bdffa
[WalletModel] Cold staking whitelisting and blacklisting methods crea…
furszy Oct 8, 2019
3d12a03
[Model] * TransactionsTableModel caching stake delegations on startup.
furszy Oct 8, 2019
c6eed4c
[Model] Cold Staking model created.
furszy Oct 8, 2019
5e48f68
[GUI] Cold staking screen:
furszy Oct 8, 2019
78102f1
[GUI] receiveWidget, moving cold staking address creation to the cold…
furszy Oct 8, 2019
0b318ff
[GUI] RequestDialog requesting address label for cold staking address…
furszy Oct 8, 2019
bc2caeb
[WalletModel] getKeyId not accepting staking addresses fixed.
furszy Oct 8, 2019
8e10dfe
[GUI] cold staking model update list fix.
furszy Oct 8, 2019
988c250
[GUI] Cold Staking screen, white/black listing tooltip flag not using…
furszy Oct 8, 2019
090daee
[GUI] Cold Staking screen, delegate button margin corrected.
furszy Oct 8, 2019
5101902
[Model] * TransactionTableModel, update cachedDelegations when new p…
furszy Oct 8, 2019
8852f4f
[GUI] Cold staking, update delegators list if a new p2cs tx arrives c…
furszy Oct 8, 2019
c7753d4
[GUI] Cold staking, owner contacts on click style.
furszy Oct 9, 2019
7d1185c
[Model] * AddressTableModel supporting delegator and delegable addres…
furszy Oct 9, 2019
8c7eb44
[GUI] Cold staking, auto-completable contacts and delegators connected.
furszy Oct 9, 2019
ae1efae
[Wallet] Base58, do not try to parse an empty string on SetString ini…
furszy Oct 10, 2019
bb55578
[Model] Do not look for address label if the input address is empty
furszy Oct 10, 2019
4ca682c
[GUI] * RequestDialog permitting 0 amount value staking URI creation.
furszy Oct 10, 2019
a79ce0f
[GUI] Request dialog uri amount value set fix.
furszy Oct 11, 2019
bb075c6
[GUI] SendMultiRow.
furszy Oct 12, 2019
6460964
[GUI][Model][Refactor] AddressBook namespace created + validateStakin…
furszy Oct 12, 2019
9283315
[GUI][Model] * ColdStaking screen, sendMultiRow only accept staking a…
furszy Oct 12, 2019
79edac6
[Model] WalletModel isMine address, input QString instead of CBitcoin…
furszy Oct 12, 2019
ba8c1c0
[AddressBook] addressbook.cpp file created.
furszy Oct 12, 2019
e8a9f21
[GUI][Model] * P2CS records, P2CSDelegationSent type created for spen…
furszy Oct 12, 2019
87a5329
[GUI] ColdStaking screen, hide menu on mode change
furszy Oct 12, 2019
440179b
[GUI] Transaction record bad parsed as MN reward fixed.
furszy Oct 13, 2019
063569e
[Build] ColdStaking, guiTransactionsUtils and addressbook files added…
furszy Oct 14, 2019
02565ab
[GUI] Cold staking nav icon style in dark theme added.
furszy Oct 14, 2019
048c810
[GUI] Cold staking clear all button functionality added and connected.
furszy Oct 14, 2019
4cc773d
[GUI] Cold staking inactive icon on txs row in dark theme added.
furszy Oct 14, 2019
e8c62d8
[GUI] Cold staking, coin-owner cannot whitelist/blacklist staking add…
furszy Oct 14, 2019
dc777a5
[Model] Cold staking received delegation amount using getColdStakingC…
furszy Oct 14, 2019
2f953d2
[Chain] IsOutputAvailable method created in coinsViewCache.
furszy Oct 14, 2019
7b2ac77
[Model] TransactionTablemodel checkForDelegations adding only availab…
furszy Oct 14, 2019
a11cb87
[Model] TransactionRecord, using GetColdStakingDebit and GetStakeDele…
furszy Oct 14, 2019
297ffdb
[GUI] Cold/Hot stakes tx row icon in every different form for every t…
furszy Oct 15, 2019
5b4c17d
[Model] Cold staking, debit amount inverted to be inline with the res…
furszy Oct 15, 2019
8763b7b
[GUI] Navigation bar, receive icon invalid top padding removed.
furszy Oct 15, 2019
75baa86
[Coins] IsOutputAvailable badly checking if the output is available f…
furszy Oct 15, 2019
1a7794e
[GUI][Model] * ColdStaking screen: Show/Hide empty view.
furszy Oct 15, 2019
8a5bb4b
[GUI][Model] Cold Staking whitelist/blacklist only accepting regular …
furszy Oct 15, 2019
6298ca8
[Model] Cold Staking model, no need to check an unused parent.
furszy Oct 15, 2019
fd2ca98
[Model] Cached cold staking delegations, counting every p2cs record a…
furszy Oct 15, 2019
67279c9
[Wallet] Transaction HasP2CSInputs implemented.
furszy Oct 15, 2019
8e3f1ba
[Model] TransactionRecords P2CSUnlockOwner and P2CSUnlockStaker creat…
furszy Oct 15, 2019
976ad63
[Model] P2CS unlock, not using the input.prevPubKey anymore (it's nev…
furszy Oct 15, 2019
4c5be59
[Model][Refactor] TransactionRecord, ExtractAddress for p2cs script m…
furszy Oct 16, 2019
c2ef93b
[Wallet] GetAvailableP2CSCoins method created, returning the stakeabl…
furszy Oct 16, 2019
d587aa9
[Model][GUI][Refactor] CachedDelegation list moved from transactionTa…
furszy Oct 16, 2019
9908597
[Wallet][GUI] Add warning when voiding cold-stake delegation
random-zebra Oct 16, 2019
4307a96
[GUI] sendConfirm dialog, labelWarning invisible if it's not set.
furszy Oct 16, 2019
2c8ea79
[Model] Cold staking model clearing list one every refresh.
furszy Oct 17, 2019
dcd383f
[Wallet][Refactor] HasP2CSInputs moved from CTransaction to CWalletTx.
furszy Oct 17, 2019
8fdbe6c
[Model] TransactionRecord P2CS, set only staking address
furszy Oct 17, 2019
6b55bfd
[Model][SQUASH] Only update staking addresses.
furszy Oct 17, 2019
6549bcd
[Model][SQUASH] ColdStaking model refresh list fully refactored.
furszy Oct 17, 2019
e1cc267
[GUI] Cold staking, owner address change label functionality added.
furszy Oct 17, 2019
fd3bfd1
[GUI] Cold staking, copy staking address button in the tooltip menu c…
furszy Oct 17, 2019
ef232f8
[GUI] Cold staking, copy owner address instead of the staking address…
furszy Oct 18, 2019
8334354
[WALLET] Cold staking address book purpose added.
furszy Oct 18, 2019
e2b0f48
[GUI] My cold staking addresses list created and connected to the col…
furszy Oct 18, 2019
e0183c3
[Model] Use ExtractDestinations to get recipients of P2CS scripts
random-zebra Oct 18, 2019
38e3052
[GUI] Cold staking, stakeable total amount label added and connected.
furszy Oct 18, 2019
dbd3f07
[GUI] Cold staking screen, shutdown segfault over spacer freed pointe…
furszy Oct 22, 2019
ad8217c
[GUI] Cold staking screen, delegations load moved from main thread to…
furszy Oct 22, 2019
565d347
[Build] CMake missing addressholder file added.
furszy Oct 25, 2019
ceca5d7
[Wallet] Fix getNewAddress methods
random-zebra Oct 27, 2019
8bef7d3
[Wallet] fix getNewAddress returning error with locked wallet
random-zebra Oct 28, 2019
bc7382a
[Model][UI] isColdStakingNetworkelyEnabled method created and connect…
furszy Nov 1, 2019
c1cb8f8
[UI][Model] ColdStaking screen, my staking addresses list, menu with …
furszy Nov 1, 2019
d7a6ae4
[GUI][Model] TransactionRecord, invalid cold staking delegations cred…
furszy Nov 6, 2019
6016f0d
[Helpers] CBitcoinAddress, newInstance and newCSInstance method creat…
furszy Nov 6, 2019
8caed35
[GUI] TransactionDetailDialog, showing the cold staking addresses out…
furszy Nov 6, 2019
ec0f537
[Wallet] GetAvailableP2CSCoins improved.
furszy Nov 7, 2019
3359aa7
[Wallet] GetAvailableP2CSCoins, a p2cs utxo is spendable only if IsMi…
furszy Nov 7, 2019
7efda4b
[GUI] MasterNodesWidget, list view mouse tracking enabled.
furszy Nov 7, 2019
75968f9
[GUI][Model] Rebase fix
furszy Nov 8, 2019
6928080
[GUI][Model] * TransactionRecord implementing isAnyColdStakingType to…
furszy Nov 7, 2019
804be96
[Model] isP2CSSpend and isDelegatedToOrFromMe unused method removed.
furszy Nov 8, 2019
93f6bfe
[GUI] Cold staking my address menu position corrected.
furszy Nov 8, 2019
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
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@ set(WALLET_SOURCES
./src/obfuscation.cpp
./src/obfuscation-relay.cpp
./src/wallet/db.cpp
./src/addressbook.cpp
./src/crypter.cpp
./src/swifttx.cpp
./src/masternode.cpp
Expand Down
3 changes: 3 additions & 0 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ BITCOIN_CORE_H = \
primitives/transaction.h \
core_io.h \
crypter.h \
pairresult.h \
addressbook.h \
denomination_functions.h \
obfuscation.h \
obfuscation-relay.h \
Expand Down Expand Up @@ -262,6 +264,7 @@ libbitcoin_wallet_a_SOURCES = \
obfuscation.cpp \
obfuscation-relay.cpp \
wallet/db.cpp \
addressbook.cpp \
crypter.cpp \
swifttx.cpp \
masternode.cpp \
Expand Down
32 changes: 32 additions & 0 deletions src/Makefile.qt.include
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ QT_FORMS_UI = \
qt/pivx/forms/mnrow.ui \
qt/pivx/forms/masternodeswidget.ui \
qt/pivx/forms/myaddressrow.ui \
qt/pivx/forms/csrow.ui \
qt/pivx/forms/sendchangeaddressdialog.ui \
qt/pivx/forms/sendconfirmdialog.ui \
qt/pivx/forms/sendcustomfeedialog.ui \
Expand All @@ -88,6 +89,7 @@ QT_FORMS_UI = \
qt/pivx/forms/defaultdialog.ui \
qt/pivx/forms/denomgenerationdialog.ui \
qt/pivx/forms/privacywidget.ui \
qt/pivx/forms/coldstakingwidget.ui \
qt/pivx/settings/forms/settingsbackupwallet.ui \
qt/pivx/settings/forms/settingsbittoolwidget.ui \
qt/pivx/settings/forms/settingsconsolewidget.ui \
Expand Down Expand Up @@ -160,11 +162,13 @@ QT_MOC_CPP = \
qt/pivx/moc_contactdropdownrow.cpp \
qt/pivx/moc_mninfodialog.cpp \
qt/pivx/moc_optionbutton.cpp \
qt/pivx/moc_coldstakingmodel.cpp \
qt/pivx/moc_mnmodel.cpp \
qt/pivx/moc_masternodewizarddialog.cpp \
qt/pivx/moc_mnrow.cpp \
qt/pivx/moc_masternodeswidget.cpp \
qt/pivx/moc_myaddressrow.cpp \
qt/pivx/moc_csrow.cpp \
qt/pivx/moc_contactsdropdown.cpp \
qt/pivx/moc_sendchangeaddressdialog.cpp \
qt/pivx/moc_sendconfirmdialog.cpp \
Expand All @@ -181,6 +185,7 @@ QT_MOC_CPP = \
qt/pivx/moc_defaultdialog.cpp \
qt/pivx/moc_denomgenerationdialog.cpp \
qt/pivx/moc_privacywidget.cpp \
qt/pivx/moc_coldstakingwidget.cpp \
qt/pivx/settings/moc_settingsbackupwallet.cpp \
qt/pivx/settings/moc_settingsbittoolwidget.cpp \
qt/pivx/settings/moc_settingsconsolewidget.cpp \
Expand Down Expand Up @@ -266,6 +271,7 @@ BITCOIN_QT_H = \
qt/winshutdownmonitor.h \
qt/zpivcontroldialog.h \
qt/pivx/pwidget.h \
qt/pivx/guitransactionsutils.h \
qt/pivx/snackbar.h \
qt/pivx/navmenuwidget.h \
qt/pivx/lockunlock.h \
Expand All @@ -278,18 +284,21 @@ BITCOIN_QT_H = \
qt/pivx/walletpassworddialog.h \
qt/pivx/topbar.h \
qt/pivx/txrow.h \
qt/pivx/addressholder.h \
qt/pivx/addressfilterproxymodel.h \
qt/pivx/dashboardwidget.h \
qt/pivx/coincontrolpivwidget.h \
qt/pivx/addresslabelrow.h \
qt/pivx/contactdropdownrow.h \
qt/pivx/mninfodialog.h \
qt/pivx/optionbutton.h \
qt/pivx/coldstakingmodel.h \
qt/pivx/mnmodel.h \
qt/pivx/masternodewizarddialog.h \
qt/pivx/mnrow.h \
qt/pivx/masternodeswidget.h \
qt/pivx/myaddressrow.h \
qt/pivx/csrow.h \
qt/pivx/contactsdropdown.h \
qt/pivx/sendchangeaddressdialog.h \
qt/pivx/sendconfirmdialog.h \
Expand All @@ -306,6 +315,7 @@ BITCOIN_QT_H = \
qt/pivx/defaultdialog.h \
qt/pivx/denomgenerationdialog.h \
qt/pivx/privacywidget.h \
qt/pivx/coldstakingwidget.h \
qt/pivx/settings/settingsbackupwallet.h \
qt/pivx/settings/settingsbittoolwidget.h \
qt/pivx/settings/settingsconsolewidget.h \
Expand Down Expand Up @@ -402,6 +412,8 @@ RES_ICONS = \
qt/pivx/res/img/ic-update.svg \
qt/pivx/res/img/bg-multi-number.svg \
qt/pivx/res/img/ic-check-mint-off.svg \
qt/pivx/res/img/ic-nav-cold-staking.svg \
qt/pivx/res/img/ic-nav-cold-staking-active.svg \
qt/pivx/res/img/ic-nav-dashboard-active.svg \
qt/pivx/res/img/ic-wallet-status-locked.svg \
qt/pivx/res/img/bg-splash.svg \
Expand Down Expand Up @@ -542,6 +554,11 @@ RES_ICONS = \
qt/pivx/res/img/ic-transaction-warning.svg \
qt/pivx/res/img/ic-transaction-mint.svg \
qt/pivx/res/img/ic-transaction-mint-inactive.svg \
qt/pivx/res/img/ic-check-cold-staking.svg \
qt/pivx/res/img/ic-check-cold-staking-off.svg \
qt/pivx/res/img/ic-check-cold-staking-enabled.svg \
qt/pivx/res/img/dark/ic-transaction-cs-contract.svg \
qt/pivx/res/img/dark/ic-transaction-cs-contract-inactive.svg \
qt/pivx/res/img/img-qr.svg \
qt/pivx/res/img/ic-check-connect-off.svg \
qt/pivx/res/img/ic-label.svg \
Expand Down Expand Up @@ -578,6 +595,16 @@ RES_ICONS = \
qt/pivx/res/img/ic-arrow-drop-up-purple.svg \
qt/pivx/res/img/ic-check-liliac-indeterminate.svg \
qt/pivx/res/img/ic-check-box-liliac-indeterminate.svg \
qt/pivx/res/img/ic-transaction-stake-delegated.svg \
qt/pivx/res/img/ic-transaction-stake-delegated-inactive.svg \
qt/pivx/res/img/ic-transaction-stake-hot.svg \
qt/pivx/res/img/ic-transaction-stake-hot-inactive.svg \
qt/pivx/res/img/dark/ic-transaction-stake-hot.svg \
qt/pivx/res/img/dark/ic-transaction-stake-hot-inactive.svg \
qt/pivx/res/img/dark/ic-transaction-stake-delegated.svg \
qt/pivx/res/img/dark/ic-transaction-stake-delegated-inactive.svg \
qt/pivx/res/img/ic-transaction-cs-contract.svg \
qt/pivx/res/img/ic-transaction-cs-contract-inactive.svg \
qt/pivx/res/img/ic-check-box-indeterminate.svg \
qt/pivx/res/img/ani-loading-dark.gif \
qt/pivx/res/img/ani-loading.gif
Expand Down Expand Up @@ -633,6 +660,7 @@ BITCOIN_QT_WALLET_CPP = \
qt/pivx/loadingdialog.cpp \
qt/zpivcontroldialog.cpp \
qt/pivx/pwidget.cpp \
qt/pivx/guitransactionsutils.cpp \
qt/pivx/snackbar.cpp \
qt/pivx/navmenuwidget.cpp \
qt/pivx/lockunlock.cpp \
Expand All @@ -644,6 +672,7 @@ BITCOIN_QT_WALLET_CPP = \
qt/pivx/walletpassworddialog.cpp \
qt/pivx/topbar.cpp \
qt/pivx/txrow.cpp \
qt/pivx/addressholder.cpp \
qt/pivx/addressfilterproxymodel.cpp \
qt/pivx/dashboardwidget.cpp \
qt/pivx/coincontrolpivwidget.cpp \
Expand All @@ -652,11 +681,13 @@ BITCOIN_QT_WALLET_CPP = \
qt/pivx/contactsdropdown.cpp \
qt/pivx/optionbutton.cpp \
qt/pivx/mninfodialog.cpp \
qt/pivx/coldstakingmodel.cpp \
qt/pivx/mnmodel.cpp \
qt/pivx/masternodewizarddialog.cpp \
qt/pivx/mnrow.cpp \
qt/pivx/masternodeswidget.cpp \
qt/pivx/myaddressrow.cpp \
qt/pivx/csrow.cpp \
qt/pivx/sendchangeaddressdialog.cpp \
qt/pivx/sendconfirmdialog.cpp \
qt/pivx/sendcustomfeedialog.cpp \
Expand All @@ -672,6 +703,7 @@ BITCOIN_QT_WALLET_CPP = \
qt/pivx/defaultdialog.cpp \
qt/pivx/denomgenerationdialog.cpp \
qt/pivx/privacywidget.cpp \
qt/pivx/coldstakingwidget.cpp \
qt/pivx/settings/settingsbackupwallet.cpp \
qt/pivx/settings/settingsbittoolwidget.cpp \
qt/pivx/settings/settingsconsolewidget.cpp \
Expand Down
19 changes: 19 additions & 0 deletions src/addressbook.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Copyright (c) 2019 The PIVX developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include "addressbook.h"
#include <string>

namespace AddressBook {

namespace AddressBookPurpose {
const std::string UNKNOWN{"unknown"};
const std::string RECEIVE{"receive"};
const std::string SEND{"send"};
const std::string DELEGABLE{"delegable"};
const std::string DELEGATOR{"delegator"};
const std::string COLD_STAKING{"coldstaking"};
}
}

39 changes: 39 additions & 0 deletions src/addressbook.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// Copyright (c) 2019 The PIVX developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#ifndef PIVX_ADDRESSBOOK_H
#define PIVX_ADDRESSBOOK_H

#include <map>
#include <string>

namespace AddressBook {

namespace AddressBookPurpose {
extern const std::string UNKNOWN;
extern const std::string RECEIVE;
extern const std::string SEND;
extern const std::string DELEGABLE;
extern const std::string DELEGATOR;
extern const std::string COLD_STAKING;
}

/** Address book data */
class CAddressBookData {
public:

std::string name;
std::string purpose;

CAddressBookData() {
purpose = AddressBook::AddressBookPurpose::UNKNOWN;
}

typedef std::map<std::string, std::string> StringMap;
StringMap destdata;
};

}

#endif //PIVX_ADDRESSBOOK_H
2 changes: 2 additions & 0 deletions src/base58.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,8 @@ bool CBase58Data::SetString(const char* psz, unsigned int nVersionBytes)

bool CBase58Data::SetString(const std::string& str)
{
if (str.empty())
return false;
return SetString(str.c_str());
}

Expand Down
10 changes: 10 additions & 0 deletions src/base58.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,16 @@ class CBitcoinAddress : public CBase58Data
bool GetKeyID(CKeyID& keyID) const;
bool IsScript() const;
bool IsStakingAddress() const;


// Helpers
static const CBitcoinAddress newCSInstance(const CTxDestination& dest) {
return CBitcoinAddress(dest, CChainParams::STAKING_ADDRESS);
}

static const CBitcoinAddress newInstance(const CTxDestination& dest) {
return CBitcoinAddress(dest, CChainParams::PUBKEY_ADDRESS);
}
};

/**
Expand Down
7 changes: 6 additions & 1 deletion src/coins.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,12 +248,17 @@ bool CCoinsViewCache::HaveInputs(const CTransaction& tx) const
return true;
}

bool CCoinsViewCache::IsOutputAvailable(const uint256& txId, int index) {
const CCoins* coins = AccessCoins(txId);
return coins && coins->IsAvailable(index);
}

double CCoinsViewCache::GetPriority(const CTransaction& tx, int nHeight) const
{
if (tx.IsCoinBase() || tx.IsCoinStake())
return 0.0;
double dResult = 0.0;
for (const CTxIn& txin: tx.vin) {
for (const CTxIn& txin : tx.vin) {
const CCoins* coins = AccessCoins(txin.prevout.hash);
assert(coins);
if (!coins->IsAvailable(txin.prevout.n)) continue;
Expand Down
3 changes: 3 additions & 0 deletions src/coins.h
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,9 @@ class CCoinsViewCache : public CCoinsViewBacked
//! Check whether all prevouts of the transaction are present in the UTXO set represented by this view
bool HaveInputs(const CTransaction& tx) const;

//! Check if the specific output is available in this view
bool IsOutputAvailable(const uint256& txId, int index);

//! Return priority of tx at height nHeight
double GetPriority(const CTransaction& tx, int nHeight) const;

Expand Down
20 changes: 20 additions & 0 deletions src/pairresult.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Copyright (c) 2019 The PIVX developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#ifndef PIVX_PAIRRESULT_H
#define PIVX_PAIRRESULT_H


class PairResult {

public:
PairResult(bool res):result(res){}
PairResult(bool res, std::string* statusStr):result(res), status(statusStr){}

bool result;
std::string* status = nullptr;
};


#endif //PIVX_PAIRRESULT_H
5 changes: 5 additions & 0 deletions src/qt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ SET(QT_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/pivx/pivxgui.cpp
${CMAKE_CURRENT_SOURCE_DIR}/pivx/loadingdialog.cpp
${CMAKE_CURRENT_SOURCE_DIR}/pivx/pwidget.cpp
${CMAKE_CURRENT_SOURCE_DIR}/pivx/guitransactionsutils.cpp
${CMAKE_CURRENT_SOURCE_DIR}/pivx/snackbar.cpp
${CMAKE_CURRENT_SOURCE_DIR}/pivx/navmenuwidget.cpp
${CMAKE_CURRENT_SOURCE_DIR}/pivx/lockunlock.cpp
Expand All @@ -129,6 +130,7 @@ SET(QT_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/pivx/contactsdropdown.cpp
${CMAKE_CURRENT_SOURCE_DIR}/pivx/optionbutton.cpp
${CMAKE_CURRENT_SOURCE_DIR}/pivx/mninfodialog.cpp
furszy marked this conversation as resolved.
Show resolved Hide resolved
${CMAKE_CURRENT_SOURCE_DIR}/pivx/coldstakingmodel.cpp
${CMAKE_CURRENT_SOURCE_DIR}/pivx/mnmodel.cpp
${CMAKE_CURRENT_SOURCE_DIR}/pivx/masternodewizarddialog.cpp
${CMAKE_CURRENT_SOURCE_DIR}/pivx/mnrow.cpp
Expand All @@ -144,11 +146,14 @@ SET(QT_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/pivx/requestdialog.cpp
${CMAKE_CURRENT_SOURCE_DIR}/pivx/receivewidget.cpp
${CMAKE_CURRENT_SOURCE_DIR}/pivx/myaddressrow.cpp
${CMAKE_CURRENT_SOURCE_DIR}/pivx/csrow.cpp
${CMAKE_CURRENT_SOURCE_DIR}/pivx/addressholder.cpp
${CMAKE_CURRENT_SOURCE_DIR}/pivx/tooltipmenu.cpp
${CMAKE_CURRENT_SOURCE_DIR}/pivx/addresseswidget.cpp
${CMAKE_CURRENT_SOURCE_DIR}/pivx/defaultdialog.cpp
${CMAKE_CURRENT_SOURCE_DIR}/pivx/denomgenerationdialog.cpp
${CMAKE_CURRENT_SOURCE_DIR}/pivx/privacywidget.cpp
${CMAKE_CURRENT_SOURCE_DIR}/pivx/coldstakingwidget.cpp
${CMAKE_CURRENT_SOURCE_DIR}/pivx/settings/settingsbackupwallet.cpp
${CMAKE_CURRENT_SOURCE_DIR}/pivx/settings/settingsbittoolwidget.cpp
${CMAKE_CURRENT_SOURCE_DIR}/pivx/settings/settingsconsolewidget.cpp
Expand Down
Loading