aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/chain.cpp
diff options
context:
space:
mode:
authorJoão Barbosa <[email protected]>2019-03-27 17:00:06 +0000
committerMarcoFalke <[email protected]>2019-04-01 16:34:37 -0400
commited0498af2827ccf033c9a7c4f46b82424e411083 (patch)
tree27d07231195940aeb8c94760face92f29e5c8c84 /src/interfaces/chain.cpp
parentwallet: Move CWallet::ReacceptWalletTransactions locks to callers (diff)
downloaddiscoin-ed0498af2827ccf033c9a7c4f46b82424e411083.tar.xz
discoin-ed0498af2827ccf033c9a7c4f46b82424e411083.zip
interfaces: Add Chain::requestMempoolTransactions
Github-Pull: #15652 Rebased-From: 57908a739ca377d60ef224ce0f565d4412a414f4
Diffstat (limited to 'src/interfaces/chain.cpp')
-rw-r--r--src/interfaces/chain.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/interfaces/chain.cpp b/src/interfaces/chain.cpp
index da810bc5e..d3d9e86e8 100644
--- a/src/interfaces/chain.cpp
+++ b/src/interfaces/chain.cpp
@@ -8,6 +8,7 @@
#include <chainparams.h>
#include <primitives/block.h>
#include <sync.h>
+#include <txmempool.h>
#include <uint256.h>
#include <util/system.h>
#include <validation.h>
@@ -177,6 +178,13 @@ public:
LOCK(cs_main);
return GuessVerificationProgress(Params().TxData(), LookupBlockIndex(block_hash));
}
+ void requestMempoolTransactions(std::function<void(const CTransactionRef&)> fn) override
+ {
+ LOCK2(::cs_main, ::mempool.cs);
+ for (const CTxMemPoolEntry& entry : ::mempool.mapTx) {
+ fn(entry.GetSharedTx());
+ }
+ }
};
} // namespace