Skip to content

Commit

Permalink
Merge pull request #8 from ElectraProtocol/dev
Browse files Browse the repository at this point in the history
Release v1.0.2.0
  • Loading branch information
Jenova7 authored Mar 1, 2021
2 parents a0cca7a + f9f9fb3 commit 257f601
Show file tree
Hide file tree
Showing 34 changed files with 161 additions and 60 deletions.
2 changes: 1 addition & 1 deletion .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ env:

# https://cirrus-ci.org/guide/tips-and-tricks/#sharing-configuration-between-tasks
global_task_template: &GLOBAL_TASK_TEMPLATE
skip: $CIRRUS_REPO_FULL_NAME == "bitcoin-core/gui" && $CIRRUS_PR == "" # No need to run on the read-only mirror, unless it is a PR. https://cirrus-ci.org/guide/writing-tasks/#conditional-task-execution
skip: $CIRRUS_REPO_FULL_NAME == "xep-core/gui" && $CIRRUS_PR == "" # No need to run on the read-only mirror, unless it is a PR. https://cirrus-ci.org/guide/writing-tasks/#conditional-task-execution
ccache_cache:
folder: "/tmp/ccache_dir"
depends_built_cache:
Expand Down
8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Travis caches can be manually removed if necessary. This is one of the very
# few manual operations that is possible with Travis, and it can be done by a
# Bitcoin Core GitHub member via the Travis web interface [0].
# XEP Core GitHub member via the Travis web interface [0].
#
# Travis CI uploads the cache after the script phase of the build [1].
# However, the build is terminated without saving the cache if it takes over
# 50 minutes [2]. Thus, if we spent too much time in early build stages, fail
# with an error and save the cache.
#
# [0] https://travis-ci.org/bitcoin/bitcoin/caches
# [0] https://travis-ci.org/xep/xep/caches
# [1] https://docs.travis-ci.com/user/caching/#build-phases
# [2] https://docs.travis-ci.com/user/customizing-the-build#build-timeouts

Expand Down Expand Up @@ -42,10 +42,10 @@ before_script:
script:
- export CONTINUE=1
- if [ $SECONDS -gt 1200 ]; then export CONTINUE=0; fi # Likely the depends build took very long
- if [ $TRAVIS_REPO_SLUG = "bitcoin/bitcoin" ]; then export CONTINUE=1; fi # continue on repos with extended build time (90 minutes)
- if [ $TRAVIS_REPO_SLUG = "xep/xep" ]; then export CONTINUE=1; fi # continue on repos with extended build time (90 minutes)
- if [ $CONTINUE = "1" ]; then set -o errexit; source ./ci/test/06_script_a.sh; else set +o errexit; echo "$CACHE_ERR_MSG"; false; fi
- if [[ $SECONDS -gt 50*60-$EXPECTED_TESTS_DURATION_IN_SECONDS ]]; then export CONTINUE=0; fi
- if [ $TRAVIS_REPO_SLUG = "bitcoin/bitcoin" ]; then export CONTINUE=1; fi # continue on repos with extended build time (90 minutes)
- if [ $TRAVIS_REPO_SLUG = "xep/xep" ]; then export CONTINUE=1; fi # continue on repos with extended build time (90 minutes)
- if [ $CONTINUE = "1" ]; then set -o errexit; source ./ci/test/06_script_b.sh; else set +o errexit; echo "$CACHE_ERR_MSG"; false; fi
after_script:
- echo $TRAVIS_COMMIT_RANGE
Expand Down
22 changes: 11 additions & 11 deletions build_msvc/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ packages/*
*.vcxproj.user

# .vcxproj files that are auto-generated by the msvc-autogen.py script.
libbitcoin_cli/libbitcoin_cli.vcxproj
libbitcoin_common/libbitcoin_common.vcxproj
libbitcoin_crypto/libbitcoin_crypto.vcxproj
libbitcoin_server/libbitcoin_server.vcxproj
libbitcoin_util/libbitcoin_util.vcxproj
libbitcoin_wallet_tool/libbitcoin_wallet_tool.vcxproj
libbitcoin_wallet/libbitcoin_wallet.vcxproj
libbitcoin_zmq/libbitcoin_zmq.vcxproj
bench_bitcoin/bench_bitcoin.vcxproj
libxep_cli/libxep_cli.vcxproj
libxep_common/libxep_common.vcxproj
libxep_crypto/libxep_crypto.vcxproj
libxep_server/libxep_server.vcxproj
libxep_util/libxep_util.vcxproj
libxep_wallet_tool/libxep_wallet_tool.vcxproj
libxep_wallet/libxep_wallet.vcxproj
libxep_zmq/libxep_zmq.vcxproj
bench_xep/bench_xep.vcxproj
libtest_util/libtest_util.vcxproj

*/Win32
libbitcoin_qt/QtGeneratedFiles/*
test_bitcoin-qt/QtGeneratedFiles/*
libxep_qt/QtGeneratedFiles/*
test_xep-qt/QtGeneratedFiles/*
vcpkg_installed
4 changes: 2 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
AC_PREREQ([2.69])
define(_CLIENT_VERSION_MAJOR, 1)
define(_CLIENT_VERSION_MINOR, 0)
define(_CLIENT_VERSION_REVISION, 1)
define(_CLIENT_VERSION_BUILD, 1)
define(_CLIENT_VERSION_REVISION, 2)
define(_CLIENT_VERSION_BUILD, 0)
define(_CLIENT_VERSION_RC, 0)
define(_CLIENT_VERSION_IS_RELEASE, true)
define(_COPYRIGHT_YEAR, 2021)
Expand Down
17 changes: 13 additions & 4 deletions src/chainparams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ class CMainParams : public CChainParams {
consensus.nSubsidyHalvingInterval = 210000;
consensus.nBudgetPaymentsStartBlock = std::numeric_limits<int>::max();
consensus.nPoSStartBlock = 0;
consensus.nLastPoWBlock = std::numeric_limits<int>::max();
consensus.nLastPoWBlock = 150000;
consensus.nMandatoryUpgradeBlock = 150000;
consensus.nTreasuryPaymentsStartBlock = std::numeric_limits<int>::max();
consensus.BIP16Exception = uint256{};
consensus.BIP34Height = 0;
Expand Down Expand Up @@ -125,9 +126,10 @@ class CMainParams : public CChainParams {
consensus.vDeployments[Consensus::DEPLOYMENT_TAPROOT].nTimeout = Consensus::BIP9Deployment::NO_TIMEOUT;

consensus.mTreasuryPayees.emplace(CScript() << OP_0 << ParseHex("978a5064cd1fdf8c2510fe3fcbd65eaa5e98b32d"), 100); // 10% (full reward) for ep1qj799qexdrl0ccfgslcluh4j74f0f3vedatcv0k
consensus.nTreasuryRewardPercentage = 10; // 10% of block reward goes to treasury

consensus.nMinimumChainWork = uint256S("0x0000000000000000000000000000000000000000000000000000000000000000");
consensus.defaultAssumeValid = uint256S("0x0000000000000000000000000000000000000000000000000000000000000000"); // 654683
consensus.nMinimumChainWork = uint256S("0x00000000000000000000000000000000000000000000000035a7e986160b3cac");
consensus.defaultAssumeValid = uint256S("0x505286a87781aabbb6cfc7a9b735ffacd8ce73bc06ed17dae546cafe4ca3e7a3"); // 50000

/**
* The message start string is designed to be unlikely to occur in normal data.
Expand Down Expand Up @@ -187,7 +189,8 @@ class CMainParams : public CChainParams {

checkpointData = {
{
{0, uint256S("000000954c02f260a6db02c712557adcb5a7a8a0a9acfd3d3c2b3a427376c56f")},
{ 0, uint256S("000000954c02f260a6db02c712557adcb5a7a8a0a9acfd3d3c2b3a427376c56f")},
{ 50000, uint256S("505286a87781aabbb6cfc7a9b735ffacd8ce73bc06ed17dae546cafe4ca3e7a3")},
}
};

Expand All @@ -213,6 +216,7 @@ class CTestNetParams : public CChainParams {
consensus.nBudgetPaymentsStartBlock = std::numeric_limits<int>::max();
consensus.nPoSStartBlock = 0;
consensus.nLastPoWBlock = std::numeric_limits<int>::max();
consensus.nMandatoryUpgradeBlock = 0;
consensus.nTreasuryPaymentsStartBlock = 200;
consensus.BIP16Exception = uint256{};
consensus.BIP34Height = 0;
Expand Down Expand Up @@ -246,6 +250,7 @@ class CTestNetParams : public CChainParams {
consensus.vDeployments[Consensus::DEPLOYMENT_TAPROOT].nTimeout = Consensus::BIP9Deployment::NO_TIMEOUT;

consensus.mTreasuryPayees.emplace(CScript() << OP_0 << ParseHex("978a5064cd1fdf8c2510fe3fcbd65eaa5e98b32d"), 100); // 10% (full reward) for ep1qj799qexdrl0ccfgslcluh4j74f0f3vedatcv0k
consensus.nTreasuryRewardPercentage = 10; // 10% of block reward goes to treasury

consensus.nMinimumChainWork = uint256S("0x0000000000000000000000000000000000000000000000000000000000000000");
consensus.defaultAssumeValid = uint256S("0x0000000000000000000000000000000000000000000000000000000000000000"); // 1864000
Expand Down Expand Up @@ -375,6 +380,7 @@ class SigNetParams : public CChainParams {
consensus.nBudgetPaymentsStartBlock = std::numeric_limits<int>::max();
consensus.nPoSStartBlock = 0;
consensus.nLastPoWBlock = std::numeric_limits<int>::max();
consensus.nMandatoryUpgradeBlock = 0;
consensus.nTreasuryPaymentsStartBlock = 200;
consensus.BIP16Exception = uint256{};
consensus.BIP34Height = 1;
Expand Down Expand Up @@ -408,6 +414,7 @@ class SigNetParams : public CChainParams {
consensus.vDeployments[Consensus::DEPLOYMENT_TAPROOT].nTimeout = Consensus::BIP9Deployment::NO_TIMEOUT;

consensus.mTreasuryPayees.emplace(CScript() << OP_0 << ParseHex("978a5064cd1fdf8c2510fe3fcbd65eaa5e98b32d"), 100); // 10% (full reward) for ep1qj799qexdrl0ccfgslcluh4j74f0f3vedatcv0k
consensus.nTreasuryRewardPercentage = 10; // 10% of block reward goes to treasury

// message start is defined as the first 4 bytes of the sha256d of the block script
CHashWriter h(SER_DISK, 0);
Expand Down Expand Up @@ -461,6 +468,7 @@ class CRegTestParams : public CChainParams {
consensus.nBudgetPaymentsStartBlock = std::numeric_limits<int>::max();
consensus.nPoSStartBlock = 0;
consensus.nLastPoWBlock = std::numeric_limits<int>::max();
consensus.nMandatoryUpgradeBlock = 0;
consensus.nTreasuryPaymentsStartBlock = 30;
consensus.BIP16Exception = uint256{};
consensus.BIP34Height = 500; // BIP34 activated on regtest (Used in functional tests)
Expand Down Expand Up @@ -492,6 +500,7 @@ class CRegTestParams : public CChainParams {
consensus.vDeployments[Consensus::DEPLOYMENT_TAPROOT].nTimeout = Consensus::BIP9Deployment::NO_TIMEOUT;

consensus.mTreasuryPayees.emplace(CScript() << OP_0 << ParseHex("978a5064cd1fdf8c2510fe3fcbd65eaa5e98b32d"), 100); // 10% (full reward) for ep1qj799qexdrl0ccfgslcluh4j74f0f3vedatcv0k
consensus.nTreasuryRewardPercentage = 10; // 10% of block reward goes to treasury

consensus.nMinimumChainWork = uint256{};
consensus.defaultAssumeValid = uint256{};
Expand Down
2 changes: 1 addition & 1 deletion src/coins.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ bool CCoinsViewCache::GetCoin(const COutPoint &outpoint, Coin &coin) const {

void CCoinsViewCache::AddCoin(const COutPoint &outpoint, Coin&& coin, bool possible_overwrite) {
assert(!coin.IsSpent());
if (coin.out.scriptPubKey.IsUnspendable()) return;
if (coin.out.scriptPubKey.IsUnspendable() || coin.out.nValue == 0 || coin.out.scriptPubKey.empty()) return;
CCoinsMap::iterator it;
bool inserted;
std::tie(it, inserted) = cacheCoins.emplace(std::piecewise_construct, std::forward_as_tuple(outpoint), std::tuple<>());
Expand Down
4 changes: 3 additions & 1 deletion src/consensus/params.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,11 @@ struct Params {
int nBudgetPaymentsStartBlock;
int nPoSStartBlock;
int nLastPoWBlock;
int nMandatoryUpgradeBlock;
int nTreasuryPaymentsStartBlock;
int nTreasuryPaymentsCycleBlocks;
std::map<CScript, int> mTreasuryPayees;
std::map<CScript, unsigned int> mTreasuryPayees;
unsigned int nTreasuryRewardPercentage;
/* Block hash that is excepted from BIP16 enforcement */
uint256 BIP16Exception;
/** Block height and hash at which BIP34 becomes active */
Expand Down
4 changes: 3 additions & 1 deletion src/kernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,10 @@ uint256 ComputeStakeModifierV2(const CBlockIndex* pindexPrev, const uint256& ker
{
if (!pindexPrev)
return uint256(); // genesis block's modifier is 0
if (pindexPrev->nHeight == 1029999)
if (pindexPrev->nHeight == 0 || /*pindexPrev->nHeight == 1029999 ||*/ Params().NetworkIDString() == CBaseChainParams::REGTEST) {
// Give a stake modifier to the first block - fixed stake modifier only for regtest
return uint256S("0x61106044818e45706b1694a6a28dfe23d58a2c7d4adcff81fb1aeb6d74ea6f9e");
}

CHashWriter ss(SER_GETHASH, 0);
ss << kernel;
Expand Down
6 changes: 3 additions & 3 deletions src/miner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@ static inline void FillTreasuryPayee(CMutableTransaction& txNew, const int nHeig
const CAmount nTreasuryPayment = GetTreasuryPayment(nHeight, consensusParams);

if (nTreasuryPayment > 0) {
const std::map<CScript, int>& treasuryPayees = consensusParams.mTreasuryPayees;
const std::map<CScript, unsigned int>& treasuryPayees = consensusParams.mTreasuryPayees;

for (const std::pair<CScript, int>& payee : treasuryPayees)
for (const std::pair<CScript, unsigned int>& payee : treasuryPayees)
txNew.vout.emplace_back(nTreasuryPayment * payee.second / 100, payee.first);
}
}
Expand Down Expand Up @@ -597,7 +597,7 @@ bool CreateCoinStake(CMutableTransaction& coinstakeTx, CBlock* pblock, std::shar
LogPrintf("%s : parsed kernel type=%s\n", __func__, GetTxnOutputType(whichType));

if (whichType == TxoutType::PUBKEY || whichType == TxoutType::PUBKEYHASH || whichType == TxoutType::WITNESS_V0_KEYHASH || whichType == TxoutType::SCRIPTHASH || whichType == TxoutType::WITNESS_V0_SCRIPTHASH) { // we support p2pkh, p2wpkh, p2sh-p2wpkh, and p2sh/p2wsh-multisig inputs
const bool fNewStakingCodeActive = Params().NetworkIDString() != CBaseChainParams::MAIN;
const bool fNewStakingCodeActive = nHeight >= consensusParams.nMandatoryUpgradeBlock;
if (whichType == TxoutType::SCRIPTHASH || whichType == TxoutType::WITNESS_V0_SCRIPTHASH) { // a p2sh/p2wsh input could be many things, but we only support p2sh-p2wpkh and multisig for now
CScript subscript;
std::unique_ptr<SigningProvider> provider = pwallet->GetSolvingProvider(scriptPubKeyKernel);
Expand Down
2 changes: 1 addition & 1 deletion src/net_processing.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ extern RecursiveMutex g_cs_orphans;
static const unsigned int DEFAULT_MAX_ORPHAN_TRANSACTIONS = 100;
/** Default number of orphan+recently-replaced txn to keep around for block reconstruction */
static const unsigned int DEFAULT_BLOCK_RECONSTRUCTION_EXTRA_TXN = 100;
static const bool DEFAULT_PEERBLOOMFILTERS = false;
static const bool DEFAULT_PEERBLOOMFILTERS = true; // See https://github.com/bitcoin/bitcoin/pull/16152 for reasons why we may want to disable this in the future
static const bool DEFAULT_PEERBLOCKFILTERS = false;
/** Threshold for marking a node to be discouraged, e.g. disconnected and added to the discouragement filter. */
static const int DISCOURAGEMENT_THRESHOLD{100};
Expand Down
8 changes: 7 additions & 1 deletion src/pow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,13 @@ unsigned int AverageTargetASERT(const CBlockIndex* pindexLast, const CBlockHeade
const CBlockIndex* pindexReferenceBlock = GetASERTReferenceBlockAndHeightForAlgo(pindexPrev, nProofOfWorkLimit, nASERTStartHeight, algo, nBlocksPassed);
const CBlockIndex* pindexReferenceBlockPrev = algo == -1 ? GetLastBlockIndex(pindexReferenceBlock->pprev, fProofOfStake) : GetLastBlockIndexForAlgo(pindexReferenceBlock->pprev, algo);
// Use reference block's parent block's timestamp unless it is the genesis (not using the prev timestamp here would put us permanently one block behind schedule)
const int64_t nTimeDiff = pindexPrev->GetBlockTime() - (pindexReferenceBlockPrev ? pindexReferenceBlockPrev->GetBlockTime() : (pindexReferenceBlock->GetBlockTime() - nTargetSpacing));
int64_t refBlockTimestamp = pindexReferenceBlockPrev ? pindexReferenceBlockPrev->GetBlockTime() : (pindexReferenceBlock->GetBlockTime() - nTargetSpacing);
// The reference timestamp must be divisible by (nStakeTimestampMask+1) or else the PoS block emission will never be exactly on schedule
if (fProofOfStake) {
while ((refBlockTimestamp & params.nStakeTimestampMask) != 0)
refBlockTimestamp++;
}
const int64_t nTimeDiff = pindexPrev->GetBlockTime() - refBlockTimestamp;
//LogPrintf("pindexReferenceBlock->GetBlockHash() = %s\n", pindexReferenceBlock->GetBlockHash().ToString().c_str());
//LogPrintf("nBlocksPassed = %u\n", nBlocksPassed);
//LogPrintf("pindexPrev->nHeight + 1 - pindexReferenceBlock->nHeight = %u\n", pindexPrev->nHeight + 1 - pindexReferenceBlock->nHeight);
Expand Down
2 changes: 1 addition & 1 deletion src/qt/optionsmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in
case HideTrayIcon:
fHideTrayIcon = value.toBool();
settings.setValue("fHideTrayIcon", fHideTrayIcon);
Q_EMIT hideTrayIconChanged(fHideTrayIcon);
Q_EMIT hideTrayIconChanged(fHideTrayIcon);
break;
case MinimizeToTray:
fMinimizeToTray = value.toBool();
Expand Down
6 changes: 6 additions & 0 deletions src/qt/overviewpage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -296,3 +296,9 @@ void OverviewPage::showOutOfSyncWarning(bool fShow)
ui->labelWalletStatus->setVisible(fShow);
ui->labelTransactionsStatus->setVisible(fShow);
}

void OverviewPage::setOrphansHidden(bool hidden)
{
if (filter)
filter->setHideOrphans(hidden);
}
1 change: 1 addition & 0 deletions src/qt/overviewpage.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class OverviewPage : public QWidget
public Q_SLOTS:
void setBalance(const interfaces::WalletBalances& balances);
void setPrivacy(bool privacy);
void setOrphansHidden(bool hidden);

Q_SIGNALS:
void transactionClicked(const QModelIndex &index);
Expand Down
2 changes: 1 addition & 1 deletion src/qt/platformstyle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ static const struct {
{"macosx", false, false, true},
{"windows", true, false, false},
/* Other: linux, unix, ... */
{"other", true, true, false}
{"other", true, false, false}
};
static const unsigned platform_styles_count = sizeof(platform_styles)/sizeof(*platform_styles);

Expand Down
5 changes: 2 additions & 3 deletions src/qt/receivecoinsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,10 @@ void ReceiveCoinsDialog::on_receiveButton_clicked()
if (ui->useBech32->isChecked()) {
address_type = OutputType::BECH32;
} else {
/*address_type = model->wallet().getDefaultAddressType();
address_type = model->wallet().getDefaultAddressType();
if (address_type == OutputType::BECH32) {
address_type = OutputType::P2SH_SEGWIT;
}*/
address_type = OutputType::LEGACY; // Revert back to p2sh-segwit when staking is supported
}
}
address = model->getAddressTableModel()->addRow(AddressTableModel::Receive, label, "", address_type);

Expand Down
Binary file modified src/qt/res/icons/connect0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/qt/res/icons/connect1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/qt/res/icons/connect2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/qt/res/icons/connect3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/qt/res/icons/connect4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 16 additions & 1 deletion src/qt/transactionfilterproxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ TransactionFilterProxy::TransactionFilterProxy(QObject *parent) :
watchOnlyFilter(WatchOnlyFilter_All),
minAmount(0),
limitRows(-1),
showInactive(true)
showInactive(true),
fHideOrphans(false)
{
}

Expand All @@ -36,6 +37,8 @@ bool TransactionFilterProxy::filterAcceptsRow(int sourceRow, const QModelIndex &
return false;

int type = index.data(TransactionTableModel::TypeRole).toInt();
if (fHideOrphans && isOrphan(status, type))
return false;
if (!(TYPE(type) & typeFilter))
return false;

Expand Down Expand Up @@ -108,6 +111,12 @@ void TransactionFilterProxy::setShowInactive(bool _showInactive)
invalidateFilter();
}

void TransactionFilterProxy::setHideOrphans(bool fHide)
{
this->fHideOrphans = fHide;
invalidateFilter();
}

int TransactionFilterProxy::rowCount(const QModelIndex &parent) const
{
if(limitRows != -1)
Expand All @@ -119,3 +128,9 @@ int TransactionFilterProxy::rowCount(const QModelIndex &parent) const
return QSortFilterProxyModel::rowCount(parent);
}
}

bool TransactionFilterProxy::isOrphan(const int status, const int type)
{
return (type == TransactionRecord::Generated || type == TransactionRecord::StakeMint)
&& (status == TransactionStatus::Conflicted || status == TransactionStatus::NotAccepted);
}
5 changes: 5 additions & 0 deletions src/qt/transactionfilterproxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@ class TransactionFilterProxy : public QSortFilterProxyModel
/** Set whether to show conflicted transactions. */
void setShowInactive(bool showInactive);

/** Set whether to hide orphan stakes. */
void setHideOrphans(bool fHide);

int rowCount(const QModelIndex &parent = QModelIndex()) const override;
static bool isOrphan(const int status, const int type);

protected:
bool filterAcceptsRow(int source_row, const QModelIndex & source_parent) const override;
Expand All @@ -63,6 +67,7 @@ class TransactionFilterProxy : public QSortFilterProxyModel
CAmount minAmount;
int limitRows;
bool showInactive;
bool fHideOrphans;
};

#endif // BITCOIN_QT_TRANSACTIONFILTERPROXY_H
7 changes: 7 additions & 0 deletions src/qt/transactionview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,13 @@ void TransactionView::chooseType(int idx)
typeWidget->itemData(idx).toInt());
}

void TransactionView::setOrphansHidden(bool hidden)
{
if (!transactionProxyModel)
return;
transactionProxyModel->setHideOrphans(hidden);
}

void TransactionView::chooseWatchonly(int idx)
{
if(!transactionProxyModel)
Expand Down
1 change: 1 addition & 0 deletions src/qt/transactionview.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ private Q_SLOTS:
public Q_SLOTS:
void chooseDate(int idx);
void chooseType(int idx);
void setOrphansHidden(bool hidden);
void chooseWatchonly(int idx);
void changedAmount();
void changedSearch();
Expand Down
Loading

0 comments on commit 257f601

Please sign in to comment.