diff options
| author | Wladimir J. van der Laan <[email protected]> | 2015-12-09 10:47:56 +0100 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2015-12-09 10:48:27 +0100 |
| commit | 00b4b8d1c47a2189d085140cfb45be492de16db5 (patch) | |
| tree | 7c4f7fe4962ddcb6afca8757ed83ef1b5198cb5e /src/wallet/wallet.cpp | |
| parent | Merge pull request #4906 (diff) | |
| parent | [Qt] add InMempool() info to transaction details (diff) | |
| download | discoin-00b4b8d1c47a2189d085140cfb45be492de16db5.tar.xz discoin-00b4b8d1c47a2189d085140cfb45be492de16db5.zip | |
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.cpp | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index a262769c4..f3911f314 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) |