aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2015-12-09 10:47:56 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2015-12-09 10:48:27 +0100
commit00b4b8d1c47a2189d085140cfb45be492de16db5 (patch)
tree7c4f7fe4962ddcb6afca8757ed83ef1b5198cb5e /src/wallet/wallet.cpp
parent0800092fc252dd85ea726c50c29086e62e179b5e (diff)
parenta3c3ddbd7ba68b9a9871b8574e05cc146a69f811 (diff)
downloadbitcoin-00b4b8d1c47a2189d085140cfb45be492de16db5.tar.xz
Merge pull request #7154
a3c3ddb [Qt] add InMempool() info to transaction details (Jonas Schnelli)
Diffstat (limited to 'src/wallet/wallet.cpp')
-rw-r--r--src/wallet/wallet.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp
index a262769c4d..f3911f314a 100644
--- a/src/wallet/wallet.cpp
+++ b/src/wallet/wallet.cpp
@@ -1359,6 +1359,15 @@ CAmount CWalletTx::GetChange() const
return nChangeCached;
}
+bool CWalletTx::InMempool() const
+{
+ LOCK(mempool.cs);
+ if (mempool.exists(GetHash())) {
+ return true;
+ }
+ return false;
+}
+
bool CWalletTx::IsTrusted() const
{
// Quick answer in most cases
@@ -1373,12 +1382,8 @@ bool CWalletTx::IsTrusted() const
return false;
// Don't trust unconfirmed transactions from us unless they are in the mempool.
- {
- LOCK(mempool.cs);
- if (!mempool.exists(GetHash())) {
- return false;
- }
- }
+ if (!InMempool())
+ return false;
// Trusted if all inputs are from us and are in the mempool:
BOOST_FOREACH(const CTxIn& txin, vin)