File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -472,8 +472,11 @@ bool CWallet::IsSpent(const uint256& hash, unsigned int n) const
472472 const uint256& wtxid = it->second ;
473473 std::map<uint256, CWalletTx>::const_iterator mit = mapWallet.find (wtxid);
474474 if (mit != mapWallet.end ()) {
475- int depth = mit->second .GetDepthInMainChain ();
476- if (depth > 0 || (depth == 0 && !mit->second .isAbandoned ()))
475+ bool fConflicted ;
476+ const int nDepth = mit->second .GetDepthAndMempool (fConflicted );
477+ // not in mempool txes can spend coins only if not coinstakes
478+ const bool fConflictedCoinstake = fConflicted && mit->second .IsCoinStake ();
479+ if (nDepth > 0 || (nDepth == 0 && !mit->second .isAbandoned () && !fConflictedCoinstake ) )
477480 return true ; // Spent
478481 }
479482 }
You can’t perform that action at this time.
0 commit comments