Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
121 commits
Select commit Hold shift + click to select a range
98dee12
Implement IsMine for SaplingPaymentAddress
furszy Aug 22, 2020
ea47c24
SSPKM: implemented GetShieldedAddressFrom.
furszy Aug 22, 2020
d9bdd14
SSPKM: implemented IsMine for an specific sapling outpoint.
furszy Aug 22, 2020
f9c8008
Wallet::GetAvailableBalance include or not available shielded balance…
furszy Aug 26, 2020
63c43a5
Decouple TryToRecoverNote to be used in TryToDecrypt and GetShieldedA…
furszy Aug 27, 2020
53b15de
Implement shielded outpoint GetDebit
furszy Aug 27, 2020
be1016d
GUI: decompose shielded credit transaction into TransactionRecords flow.
furszy Aug 22, 2020
5bb9daf
GUI: implemented decompose shielded sendToSelf transaction into a Tra…
furszy Aug 22, 2020
d0352d4
GUI: implemented decompose shielded debit transaction into Transactio…
furszy Aug 22, 2020
10af0f0
GUI: TransactionRecord, Shielded transaction types added
furszy Aug 22, 2020
4da948d
GUI: Shielded transactionRecord types support in txRow and txtableModel.
furszy Aug 22, 2020
95b119b
wallet: GetUnconfirmedBalance accepting a filter argument and using G…
furszy Aug 27, 2020
37501ff
wallet: Implement GetAvailableShieldedBalance and GetUnconfirmedShiel…
furszy Aug 27, 2020
7dd3d0b
Add shielded balances in WalletBalance struct + connect it to the GUI…
furszy Aug 27, 2020
889d040
RPC: adding includeShielded flag to getbalance command.
furszy Sep 15, 2020
922a26a
Migrating sapling_wallet_nullifiers.py to use the getbalance shielded…
furszy Sep 15, 2020
d3a1d45
AddressBookPurpose including shielded receive and send addresses.
furszy Sep 16, 2020
10b08b4
Include Shielded addresses in addressbook (without changing nor addin…
furszy Sep 16, 2020
5317e5c
Create new variant for regular destinations and shielded addresses, p…
furszy Sep 16, 2020
2175428
Implement EncodeDestination for CWDestination variant.
furszy Sep 17, 2020
dbf75e6
move every inner wallet map addressbook method using CTxDestination k…
furszy Sep 17, 2020
46c0edd
Standard: implement CWDestination DecodeDestination.
furszy Sep 17, 2020
c590d1d
walletdb: connect shielded addresses in loadAddressBook
furszy Sep 17, 2020
73be51a
Implement IsShieldedPurpose(strPurpose).
furszy Sep 17, 2020
4e05674
Enable shielded addresses addressbook capabilities.
furszy Sep 17, 2020
852c387
Missing CTxDestination -> CWDestination methods.
furszy Sep 17, 2020
43e80db
Enable addressbook label support in walletModel::getNewShieldedAddress
furszy Sep 17, 2020
5fff0e0
GUI: Add shielded addresses support to addressTableModel.
furszy Sep 17, 2020
b05916e
GUI: getAddressToShow() include shielded address support.
furszy Sep 17, 2020
771dff0
[GUI] Receive widget: add shielded addresses capabilities.
furszy Sep 17, 2020
c2af18d
Include methods: IsValidDestination(CWDestination) and DecodeDestinat…
furszy Sep 18, 2020
ca73004
Implementing GetKeyCreationTime for Sapling addresses.
furszy Sep 18, 2020
7a932c9
[GUI] WalletModel::getKeyCreationTime connected for shielded addresses.
furszy Sep 18, 2020
2f3f845
[GUI] WalletModel::validateAddress now contemplating shielded addresses.
furszy Sep 18, 2020
c56d625
[GUI] Receive widget: shielded address creation time connected.
furszy Sep 18, 2020
1702168
AddressTablemodel move labelForAddress and removeRows to use CWDestin…
furszy Sep 18, 2020
c3ffa2f
[GUI] contacts widget: add shielded addresses capabilities.
furszy Sep 18, 2020
600625f
addressTableModel counting shielded send addresses.
furszy Sep 20, 2020
399f7d4
Included shielded address support in WalletModel::validateAddress
furszy Sep 20, 2020
e1714df
ContactsDropdown accepting several filters at once plus enabled regul…
furszy Sep 20, 2020
397d062
Standard::DecodeDestination return whether the decoded address is shi…
furszy Sep 20, 2020
d6e0717
send widget: divide send transaction preparation from confirmation an…
furszy Sep 20, 2020
4626fc9
WalletModel::sendCoins include shielded address distinction in addres…
furszy Sep 21, 2020
7f18b36
GUI: send caching whether the address is shielded or not.
furszy Sep 21, 2020
82807da
WalletModel: PrepareShieldedTransaction method implemented.
furszy Sep 21, 2020
c4f8321
GUI: send screen, connected shielded send.
furszy Sep 21, 2020
6b84f0a
GUI: send screen: connect shielded contacts size and add shielded add…
furszy Sep 21, 2020
44667fc
GUI: send row, edit box address validating shielded addresses.
furszy Sep 22, 2020
b110a2e
walletModelTransaction: implement setTransaction.
furszy Sep 23, 2020
024954d
WalletModel: PrepareShieldedTransaction fully functional.
furszy Sep 23, 2020
50b5cf0
WalletModel:sendCoins passing key change pointer instead of reference.
furszy Sep 23, 2020
fbaa554
WalletModel::sendCoins, sapling active flag connected.
furszy Oct 31, 2020
8d06471
GUI: new double amount transaction row + connection to the shielded s…
furszy Oct 31, 2020
503f00e
Special case for send to self transparent to shielded conversion tx r…
furszy Nov 4, 2020
35a44a0
[BUG][GUI] Fixing GetAvailableShieldedBalance calculation, ismimetype…
furszy Nov 5, 2020
5769dff
GUI: Introduce total shielded balance into topbar.
furszy Nov 5, 2020
7ced8ae
GUI: balance bubble popup implemented.
furszy Nov 6, 2020
925c28a
GUI: topbar shielded balance connection, bubble popup connected.
furszy Nov 6, 2020
3581b8e
GUI: send screen, "send from shielded" process connection.
furszy Nov 8, 2020
76dd3fc
wallet: fix GetAvailableBalance, the "only transparent" option wasn't…
furszy Nov 9, 2020
4828d58
GUI: collapsed topbar, shielded piv total amount added.
furszy Nov 9, 2020
91654a5
GUI: sendconfirmation dialog, formatting shielded address to be fully…
furszy Nov 9, 2020
7eaf63b
GUI: loadingDialog custom loading message
furszy Nov 11, 2020
7d8f41e
GUI: move transaction creation flow to a worker thread.
furszy Nov 11, 2020
4cbfd0e
[FIXUP with send worker] send process moved properly to a worker thre…
furszy Nov 11, 2020
3ee23f8
Move-only: Standard namespace with general CWDestination variant and …
furszy Nov 12, 2020
89fcc2d
wallet: GetKeyCreationTime for CWDestination method implemented.
furszy Nov 14, 2020
98652a6
GUI: wallet's shielded address creation time connected.
furszy Nov 14, 2020
610c83e
GUI: receive widget, renamed public to transparent.
furszy Nov 14, 2020
8ad9dee
GUI: tx detail dialog, connecting shielded outputs.
furszy Nov 14, 2020
7351217
transaction rows, adding missing records types. unshield coins and ch…
furszy Nov 17, 2020
addb08a
SSPKM: speeding up the address decryption process caching the shielde…
furszy Nov 18, 2020
7c3e977
Model and GUI: CoinControlDialog updateView for notes connected.
furszy Nov 18, 2020
57e0d16
transaction: adding a boolean to BaseOutPoint to know whether is from…
furszy Nov 18, 2020
d1de1db
wallet: use parent class BaseOutPoint instead of COutPoint in coin co…
furszy Nov 18, 2020
b11db7f
wrapper for the coin control outpoint so we can cache the output amou…
furszy Nov 19, 2020
0b79142
GUI: cleaning a redundant loop over the selected coins in coin contro…
furszy Nov 19, 2020
a5a411e
GUI: send screen resetting coin control when the tx source type changes.
furszy Nov 19, 2020
a88918a
GUI: tx detail/confirm dialog, initial work to be able to present fro…
furszy Nov 19, 2020
25ca39a
sapling operation: coin control selection process implemented and con…
furszy Nov 19, 2020
99811d2
GUI: connected coin control for +v2 transactions.
furszy Nov 19, 2020
3e12d89
SSPKM: Created a method to retrieve the notes from a list of SaplingO…
furszy Nov 19, 2020
3b72096
GUI: sendToSelf text "shielded" moved to "shielding"
furszy Nov 20, 2020
9e8cd0c
Sapling operation: notes coin control selection implemented.
furszy Nov 20, 2020
c7b4f9d
GUI: send screen, implemented a control to shield all of the availabl…
furszy Nov 21, 2020
e1ca452
SSPKM and GUI: unifying SaplingOutPoint GetCredit & GetDebit into Get…
furszy Nov 23, 2020
1960573
RPC getbalance: include shielded watch-only balance.
furszy Nov 23, 2020
dfccdc7
GUI: Move default address creation to addressTableModel::getAddressTo…
furszy Nov 23, 2020
f7c7c0e
WalletModel: simpler getKeyCreationTime.
furszy Nov 23, 2020
694e319
GUI: send widget, do not update the entry labels if the transaction w…
furszy Nov 23, 2020
5100b25
GUI: fixing grid inputs row alignment. Issue more visible when there …
furszy Nov 24, 2020
374da0b
Send confirmation dialog: connected the shielded transaction fee plus…
furszy Nov 24, 2020
2a5b265
GUI: Dashboard tx filter by shielded transaction included + shielded …
furszy Nov 24, 2020
e3f1536
GUI: transaction confirmation dialog showing the "sending to" shielde…
furszy Nov 24, 2020
381803e
GUI: fixed coin control notes selection OutPoint hash issue
random-zebra Nov 25, 2020
586b115
sapling operation: inform user about notes with less than the min dep…
furszy Nov 25, 2020
1a1938e
SSPKM: add function to return the address of an specific shielded input.
furszy Nov 26, 2020
26ac1ec
GUI: confirmation and tx dialog showing shielded inputs properly.
furszy Nov 26, 2020
7e063ce
[DB] Add functions to database the common sapling OVK with given seed
random-zebra Nov 26, 2020
31b549a
[Wallet] Save sapling common OVK inside the key manager
random-zebra Nov 26, 2020
71550c1
[Refactor] Don't expose getCommonOVKFromSeed
random-zebra Nov 26, 2020
eddacb9
[Wallet] Update commonOVK when setting the HD seed
random-zebra Nov 26, 2020
5b4d104
[BUG] Fix selection of correct ovk from spent note
random-zebra Nov 26, 2020
cd40162
[Wallet] Add recovering from all inputs ovk in SSPKM::TryToRecoverNote
random-zebra Nov 26, 2020
a59f0b6
[Refactor] Don't try to recover with both commonOVK and spends OVK
random-zebra Nov 26, 2020
e349ef4
Refactor: cache SaplingNoteData for externally 'sent' notes too
random-zebra Nov 26, 2020
2c56171
Wallet: Add the memo to SaplingNoteData
random-zebra Nov 27, 2020
6235acb
Refactor: remove extra decrypt operations
random-zebra Nov 27, 2020
c171cb2
DB: include new cache data of SaplingNoteData in the serialization
random-zebra Nov 27, 2020
c26c65d
GUI: Add SPORK_20 check in sendCoins
random-zebra Nov 28, 2020
6b458ae
BUG: fix correct fee/amount in decomposeShieldedDebitTransaction
random-zebra Nov 28, 2020
d2faa04
BUG: fix SSPKM::GetCredit counting externally sent notes
random-zebra Nov 28, 2020
43c1e4b
GUI: connect labels calculation in coin control for shielded outputs
random-zebra Nov 28, 2020
9737bcf
Refactor: don't save empty memos in SaplingNoteData
random-zebra Nov 28, 2020
033ea0c
GUI: CoinControlDialog::updateLabels -Loop over OutPointWrapper directly
random-zebra Nov 28, 2020
d5e97d4
Cleanup: remove unused walletModel::getOutputs
random-zebra Nov 28, 2020
8c946eb
GUI: send screen, hide custom change address for shielded transactions
furszy Nov 28, 2020
fb12325
GUI: dashboard, better shielded records filters.
furszy Nov 29, 2020
48c4f86
GUI: transaction detail/confirm dialog, fixing inputs grid for shield…
furszy Nov 29, 2020
0e0d3ad
GUI: transaction record, fixing shielded credit for shield to self tr…
furszy Nov 29, 2020
64d3175
GUI: send screen, simple texts changes.
furszy Nov 29, 2020
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 @@ -455,6 +455,7 @@ set(SAPLING_SOURCES
./src/bech32.cpp
./src/sapling/sapling_util.cpp
./src/sapling/key_io_sapling.cpp
./src/destination_io.cpp
./src/sapling/sapling_core_write.cpp
./src/sapling/prf.cpp
./src/sapling/noteencryption.cpp
Expand Down
2 changes: 2 additions & 0 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ BITCOIN_CORE_H = \
wallet/hdchain.h \
wallet/rpcwallet.h \
wallet/scriptpubkeyman.h \
destination_io.h \
wallet/wallet.h \
wallet/walletdb.h \
zpivchain.h \
Expand Down Expand Up @@ -401,6 +402,7 @@ libbitcoin_wallet_a_SOURCES = \
wallet/rpczpiv.cpp \
wallet/hdchain.cpp \
wallet/scriptpubkeyman.cpp \
destination_io.cpp \
wallet/wallet.cpp \
wallet/wallet_zerocoin.cpp \
wallet/walletdb.cpp \
Expand Down
7 changes: 5 additions & 2 deletions src/Makefile.qt.include
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ QT_FORMS_UI = \
qt/pivx/forms/lockunlock.ui \
qt/pivx/forms/expandablebutton.ui \
qt/pivx/forms/receivedialog.ui \
qt/pivx/forms/balancebubble.ui \
qt/pivx/forms/topbar.ui \
qt/pivx/forms/txrow.ui \
qt/pivx/forms/dashboardwidget.ui \
Expand Down Expand Up @@ -228,6 +229,7 @@ BITCOIN_QT_H = \
qt/pivx/txviewholder.h \
qt/pivx/qtutils.h \
qt/pivx/expandablebutton.h \
qt/pivx/balancebubble.h \
qt/pivx/topbar.h \
qt/pivx/txrow.h \
qt/pivx/addressholder.h \
Expand Down Expand Up @@ -492,11 +494,11 @@ RES_ICONS = \
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/ic-information.svg \
qt/pivx/res/img/ic-information-hover.svg \
qt/pivx/res/img/ani-loading-dark.gif \
qt/pivx/res/img/ani-loading.gif



BITCOIN_QT_BASE_CPP = \
qt/bantablemodel.cpp \
qt/bitcoinaddressvalidator.cpp \
Expand Down Expand Up @@ -548,6 +550,7 @@ BITCOIN_QT_WALLET_CPP = \
qt/pivx/txviewholder.cpp \
qt/pivx/qtutils.cpp \
qt/pivx/expandablebutton.cpp \
qt/pivx/balancebubble.cpp \
qt/pivx/topbar.cpp \
qt/pivx/txrow.cpp \
qt/pivx/addressholder.cpp \
Expand Down
16 changes: 16 additions & 0 deletions src/addressbook.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,40 @@ namespace AddressBook {
const std::string DELEGATOR{"delegator"};
const std::string COLD_STAKING{"coldstaking"};
const std::string COLD_STAKING_SEND{"coldstaking_send"};
const std::string SHIELDED_RECEIVE{"shielded_receive"};
const std::string SHIELDED_SEND{"shielded_spend"};
}

bool IsColdStakingPurpose(const std::string& purpose) {
return purpose == AddressBookPurpose::COLD_STAKING
|| purpose == AddressBookPurpose::COLD_STAKING_SEND;
}

bool IsShieldedPurpose(const std::string& purpose) {
return purpose == AddressBookPurpose::SHIELDED_RECEIVE
|| purpose == AddressBookPurpose::SHIELDED_SEND;
}

bool CAddressBookData::isSendColdStakingPurpose() const {
return purpose == AddressBookPurpose::COLD_STAKING_SEND;
}

bool CAddressBookData::isSendPurpose() const {
return purpose == AddressBookPurpose::SEND;
}

bool CAddressBookData::isReceivePurpose() const {
return purpose == AddressBookPurpose::RECEIVE;
}

bool CAddressBookData::isShieldedReceivePurpose() const {
return purpose == AddressBookPurpose::SHIELDED_RECEIVE;
}

bool CAddressBookData::isShielded() const {
return IsShieldedPurpose(purpose);
}


}

5 changes: 5 additions & 0 deletions src/addressbook.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@ namespace AddressBook {
extern const std::string DELEGATOR;
extern const std::string COLD_STAKING;
extern const std::string COLD_STAKING_SEND;
extern const std::string SHIELDED_RECEIVE;
extern const std::string SHIELDED_SEND;
}

bool IsColdStakingPurpose(const std::string& purpose);
bool IsShieldedPurpose(const std::string& purpose);

/** Address book data */
class CAddressBookData {
Expand All @@ -39,6 +42,8 @@ namespace AddressBook {
bool isSendColdStakingPurpose() const;
bool isSendPurpose() const;
bool isReceivePurpose() const;
bool isShieldedReceivePurpose() const;
bool isShielded() const;
};

}
Expand Down
45 changes: 31 additions & 14 deletions src/coincontrol.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,22 @@
#include "policy/feerate.h"
#include "primitives/transaction.h"
#include "script/standard.h"
#include <unordered_set>

class OutPointWrapper {
public:
BaseOutPoint outPoint;
CAmount value;
bool isP2CS;

bool operator<(const OutPointWrapper& obj2) const {
return this->outPoint < obj2.outPoint;
}

bool operator==(const OutPointWrapper& obj2) const {
return this->outPoint == obj2.outPoint;
}
};

/** Coin Control Features. */
class CCoinControl
Expand Down Expand Up @@ -52,27 +68,27 @@ class CCoinControl
return (!setSelected.empty());
}

bool IsSelected(const COutPoint& output) const
bool IsSelected(const BaseOutPoint& output) const
{
return (setSelected.count(output) > 0);
return (setSelected.count(OutPointWrapper{output, 0, false}) > 0);
}

void Select(const COutPoint& output)
void Select(const BaseOutPoint& output, CAmount value = 0, bool isP2CS = false)
{
setSelected.insert(output);
setSelected.insert(OutPointWrapper{output, value, isP2CS});
}

void UnSelect(const COutPoint& output)
void UnSelect(const BaseOutPoint& output)
{
setSelected.erase(output);
setSelected.erase(OutPointWrapper{output, 0, false});
}

void UnSelectAll()
{
setSelected.clear();
}

void ListSelected(std::vector<COutPoint>& vOutpoints) const
void ListSelected(std::vector<OutPointWrapper>& vOutpoints) const
{
vOutpoints.assign(setSelected.begin(), setSelected.end());
}
Expand All @@ -82,14 +98,15 @@ class CCoinControl
return setSelected.size();
}

void SetSelection(std::set<COutPoint> setSelected)
{
this->setSelected.clear();
this->setSelected = setSelected;
}

private:
std::set<COutPoint> setSelected;

struct SimpleOutpointHash {
size_t operator() (const OutPointWrapper& obj) const {
return (UintToArith256(obj.outPoint.hash) + obj.outPoint.n).GetCheapHash();
}
};

std::unordered_set<OutPointWrapper, SimpleOutpointHash> setSelected;
};

#endif // BITCOIN_COINCONTROL_H
68 changes: 68 additions & 0 deletions src/destination_io.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
// Copyright (c) 2020 The PIVX developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or https://www.opensource.org/licenses/mit-license.php.

#include "destination_io.h"
#include "base58.h"
#include "sapling/key_io_sapling.h"

namespace Standard {

std::string EncodeDestination(const CWDestination &address, const CChainParams::Base58Type addrType) {
const CTxDestination *dest = boost::get<CTxDestination>(&address);
if (!dest) {
return KeyIO::EncodePaymentAddress(*boost::get<libzcash::SaplingPaymentAddress>(&address));
}
return EncodeDestination(*dest, addrType);
};

CWDestination DecodeDestination(const std::string& strAddress)
{
bool isStaking = false;
return DecodeDestination(strAddress, isStaking);
}

CWDestination DecodeDestination(const std::string& strAddress, bool& isStaking)
{
bool isShielded = false;
return DecodeDestination(strAddress, isStaking, isShielded);
}

// agregar isShielded
CWDestination DecodeDestination(const std::string& strAddress, bool& isStaking, bool& isShielded)
{
CWDestination dest;
CTxDestination regDest = ::DecodeDestination(strAddress, isStaking);
if (!IsValidDestination(regDest)) {
const auto sapDest = KeyIO::DecodeSaplingPaymentAddress(strAddress);
if (sapDest) {
isShielded = true;
return *sapDest;
}
}
return regDest;

}

bool IsValidDestination(const CWDestination& address)
{
// Only regular base58 addresses and shielded addresses accepted here for now
const libzcash::SaplingPaymentAddress *dest1 = boost::get<libzcash::SaplingPaymentAddress>(&address);
if (dest1) return true;

const CTxDestination *dest = boost::get<CTxDestination>(&address);
return dest && ::IsValidDestination(*dest);
}

const libzcash::SaplingPaymentAddress* GetShieldedDestination(const CWDestination& dest)
{
return boost::get<libzcash::SaplingPaymentAddress>(&dest);
}

const CTxDestination* GetTransparentDestination(const CWDestination& dest)
{
return boost::get<CTxDestination>(&dest);
}

} // End Standard namespace

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

#ifndef DESTINATION_IO_H
#define DESTINATION_IO_H

#include "script/standard.h"

// Regular + shielded addresses variant.
typedef boost::variant<CTxDestination, libzcash::SaplingPaymentAddress> CWDestination;

namespace Standard {

std::string EncodeDestination(const CWDestination &address, const CChainParams::Base58Type addrType = CChainParams::PUBKEY_ADDRESS);

CWDestination DecodeDestination(const std::string& strAddress);
CWDestination DecodeDestination(const std::string& strAddress, bool& isStaking);
CWDestination DecodeDestination(const std::string& strAddress, bool& isStaking, bool& isShielded);

bool IsValidDestination(const CWDestination& dest);

// boost::get wrapper
const libzcash::SaplingPaymentAddress* GetShieldedDestination(const CWDestination& dest);
const CTxDestination * GetTransparentDestination(const CWDestination& dest);

} // End Standard namespace

#endif //DESTINATION_IO_H
2 changes: 2 additions & 0 deletions src/interface/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ namespace interfaces {
}
result.delegate_balance = m_wallet.GetDelegatedBalance();
result.coldstaked_balance = m_wallet.GetColdStakingBalance();
result.shielded_balance = m_wallet.GetAvailableShieldedBalance();
result.unconfirmed_shielded_balance = m_wallet.GetUnconfirmedShieldedBalance();
return result;
}

Expand Down
5 changes: 4 additions & 1 deletion src/interface/wallet.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,17 @@ struct WalletBalances
CAmount immature_watch_only_balance{0};
CAmount delegate_balance{0};
CAmount coldstaked_balance{0};
CAmount shielded_balance{0};
CAmount unconfirmed_shielded_balance{0};

bool balanceChanged(const WalletBalances& prev) const
{
return balance != prev.balance || unconfirmed_balance != prev.unconfirmed_balance ||
immature_balance != prev.immature_balance || watch_only_balance != prev.watch_only_balance ||
unconfirmed_watch_only_balance != prev.unconfirmed_watch_only_balance ||
immature_watch_only_balance != prev.immature_watch_only_balance ||
delegate_balance != prev.delegate_balance || coldstaked_balance != prev.coldstaked_balance;
delegate_balance != prev.delegate_balance || coldstaked_balance != prev.coldstaked_balance ||
shielded_balance != prev.shielded_balance || unconfirmed_shielded_balance != prev.unconfirmed_shielded_balance;
}
};

Expand Down
8 changes: 5 additions & 3 deletions src/primitives/transaction.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,11 @@ class BaseOutPoint
public:
uint256 hash;
uint32_t n;
bool isTransparent{true};

BaseOutPoint() { SetNull(); }
BaseOutPoint(uint256 hashIn, uint32_t nIn) { hash = hashIn; n = nIn; }
BaseOutPoint(const uint256& hashIn, const uint32_t nIn, bool isTransparentIn = true) :
hash(hashIn), n(nIn), isTransparent(isTransparentIn) { }

ADD_SERIALIZE_METHODS;

Expand Down Expand Up @@ -75,7 +77,7 @@ class COutPoint : public BaseOutPoint
{
public:
COutPoint() : BaseOutPoint() {};
COutPoint(uint256 hashIn, uint32_t nIn) : BaseOutPoint(hashIn, nIn) {};
COutPoint(const uint256& hashIn, const uint32_t nIn) : BaseOutPoint(hashIn, nIn, true) {};
std::string ToString() const;
};

Expand All @@ -85,7 +87,7 @@ class SaplingOutPoint : public BaseOutPoint
{
public:
SaplingOutPoint() : BaseOutPoint() {};
SaplingOutPoint(uint256 hashIn, uint32_t nIn) : BaseOutPoint(hashIn, nIn) {};
SaplingOutPoint(const uint256& hashIn, const uint32_t nIn) : BaseOutPoint(hashIn, nIn, false) {};
std::string ToString() const;
};

Expand Down
1 change: 1 addition & 0 deletions src/qt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ SET(QT_SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/pivx/furabstractlistitemdelegate.cpp
${CMAKE_CURRENT_SOURCE_DIR}/pivx/txviewholder.cpp
${CMAKE_CURRENT_SOURCE_DIR}/pivx/qtutils.cpp
${CMAKE_CURRENT_SOURCE_DIR}/pivx/balancebubble.cpp
${CMAKE_CURRENT_SOURCE_DIR}/pivx/expandablebutton.cpp
${CMAKE_CURRENT_SOURCE_DIR}/pivx/topbar.cpp
${CMAKE_CURRENT_SOURCE_DIR}/pivx/txrow.cpp
Expand Down
Loading