Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
Signed-off-by: Azat Nizametdinov <azat@thirdhash.com>
  • Loading branch information
Nizametdinov committed Feb 4, 2019
1 parent 51b2e16 commit 22b1e2a
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/esperanza/walletextension.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ void WalletExtension::ForEachStakeableCoin(Callable f) const {
continue;
}
const CTxOut &coin = coins[outix];
if (!m_enclosing_wallet.IsStakeableByMe(coin) || coin.nValue <= 0) {
if (!IsStakeableByMe(m_enclosing_wallet, coin.scriptPubKey) || coin.nValue <= 0) {
continue;
}

Expand Down
1 change: 1 addition & 0 deletions src/script/ismine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ bool IsStakeableByMe(const CKeyStore &keystore, const CScript &script_pub_key)
txnouttype which_type;
Solver(script_pub_key, which_type, solutions);

// UNIT-E TODO: Restrict to witness programs only once #212 is merged (fixes #48)
switch (which_type)
{
case TX_PUBKEYHASH:
Expand Down
7 changes: 1 addition & 6 deletions src/wallet/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1452,11 +1452,6 @@ isminetype CWallet::IsMine(const CTxOut& txout) const
return ::IsMine(*this, txout.scriptPubKey);
}

bool CWallet::IsStakeableByMe(const CTxOut& txout) const
{
return ::IsStakeableByMe(*this, txout.scriptPubKey);
}

CAmount CWallet::GetCredit(const CTxOut& txout, const isminefilter& filter) const
{
if (!MoneyRange(txout.nValue)) {
Expand Down Expand Up @@ -1498,7 +1493,7 @@ CAmount CWallet::GetChange(const CTxOut& txout) const
bool CWallet::IsMine(const CTransaction& tx) const
{
for (const CTxOut& txout : tx.vout) {
if (IsMine(txout) || IsStakeableByMe(txout)) {
if (IsMine(txout) || ::IsStakeableByMe(*this, txout.scriptPubKey)) {
return true;
}
}
Expand Down
1 change: 0 additions & 1 deletion src/wallet/wallet.h
Original file line number Diff line number Diff line change
Expand Up @@ -1042,7 +1042,6 @@ class CWallet final : public CCryptoKeyStore, public CValidationInterface
*/
CAmount GetDebit(const CTxIn& txin, const isminefilter& filter) const;
isminetype IsMine(const CTxOut& txout) const;
bool IsStakeableByMe(const CTxOut& txout) const;
CAmount GetCredit(const CTxOut& txout, const isminefilter& filter) const;
bool IsChange(const CTxOut& txout) const;
CAmount GetChange(const CTxOut& txout) const;
Expand Down

0 comments on commit 22b1e2a

Please sign in to comment.