Skip to content

Commit 79d131d

Browse files
committed
[Model] isCoinStakeMine method validating against the tx input instead of the output.
1 parent 866415e commit 79d131d

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/qt/walletmodel.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ bool WalletModel::isCoinStakeMine(QString id){
466466
uint256 hashTx;
467467
hashTx.SetHex(id.toStdString());
468468
const CWalletTx* tx = getTx(hashTx);
469-
return tx->IsCoinStake() && wallet->IsMine(tx->vout[1]) == ISMINE_ALL;
469+
return tx->IsCoinStake() && wallet->IsMine(tx->vin[0]);
470470
}
471471

472472
bool WalletModel::mintCoins(CAmount value, CCoinControl* coinControl ,std::string &strError){
@@ -493,9 +493,6 @@ bool WalletModel::createZpivSpend(
493493
value += pair.second;
494494
}
495495

496-
// Default: assume something goes wrong. Depending on the problem this gets more specific below
497-
int nStatus = ZPIV_SPEND_ERROR;
498-
499496
if (wallet->IsLocked()) {
500497
receipt.SetStatus("Error: Wallet locked, unable to create transaction!", ZPIV_WALLET_LOCKED);
501498
return false;

0 commit comments

Comments
 (0)