aboutsummaryrefslogtreecommitdiff
path: root/src/wallet.cpp
diff options
context:
space:
mode:
authorGavin Andresen <gavinandresen@gmail.com>2014-02-14 14:40:32 -0500
committerGavin Andresen <gavinandresen@gmail.com>2014-02-14 14:40:32 -0500
commit05d3ded072d782036c31c1d773c0441b87de843e (patch)
tree1dcdec2f37f61415aa5d1b71da101e0cfbd035fd /src/wallet.cpp
parente051e65c219cc72a2bba768f3d5e043ad055b48e (diff)
parent9a3d936fc2e98b1e8234bf27e09cf7bc22811bee (diff)
Merge pull request #3669 from gavinandresen/dead_txns
Handle "conflicted" transactions properly
Diffstat (limited to 'src/wallet.cpp')
-rw-r--r--src/wallet.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/wallet.cpp b/src/wallet.cpp
index 1ba70c1160..b579480f7d 100644
--- a/src/wallet.cpp
+++ b/src/wallet.cpp
@@ -1021,11 +1021,15 @@ void CWallet::AvailableCoins(vector<COutput>& vCoins, bool fOnlyConfirmed, const
if (pcoin->IsCoinBase() && pcoin->GetBlocksToMaturity() > 0)
continue;
+ int nDepth = pcoin->GetDepthInMainChain();
+ if (nDepth < 0)
+ continue;
+
for (unsigned int i = 0; i < pcoin->vout.size(); i++) {
if (!(pcoin->IsSpent(i)) && IsMine(pcoin->vout[i]) &&
!IsLockedCoin((*it).first, i) && pcoin->vout[i].nValue > 0 &&
(!coinControl || !coinControl->HasSelected() || coinControl->IsSelected((*it).first, i)))
- vCoins.push_back(COutput(pcoin, i, pcoin->GetDepthInMainChain()));
+ vCoins.push_back(COutput(pcoin, i, nDepth));
}
}
}