aboutsummaryrefslogtreecommitdiff
path: root/src/wallet.h
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.h
parente051e65c219cc72a2bba768f3d5e043ad055b48e (diff)
parent9a3d936fc2e98b1e8234bf27e09cf7bc22811bee (diff)
Merge pull request #3669 from gavinandresen/dead_txns
Handle "conflicted" transactions properly
Diffstat (limited to 'src/wallet.h')
-rw-r--r--src/wallet.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/wallet.h b/src/wallet.h
index a8f1a81b3c..dc709632b4 100644
--- a/src/wallet.h
+++ b/src/wallet.h
@@ -701,8 +701,11 @@ public:
// Quick answer in most cases
if (!IsFinalTx(*this))
return false;
- if (GetDepthInMainChain() >= 1)
+ int nDepth = GetDepthInMainChain();
+ if (nDepth >= 1)
return true;
+ if (nDepth < 0)
+ return false;
if (!bSpendZeroConfChange || !IsFromMe()) // using wtx's cached debit
return false;
@@ -718,8 +721,11 @@ public:
if (!IsFinalTx(*ptx))
return false;
- if (ptx->GetDepthInMainChain() >= 1)
+ int nPDepth = ptx->GetDepthInMainChain();
+ if (nPDepth >= 1)
continue;
+ if (nPDepth < 0)
+ return false;
if (!pwallet->IsFromMe(*ptx))
return false;