diff options
| author | MarcoFalke <[email protected]> | 2019-04-01 15:26:58 -0400 |
|---|---|---|
| committer | MarcoFalke <[email protected]> | 2019-04-01 15:27:02 -0400 |
| commit | 5a2a9b5b0603c1206e4419ffd0fd0d4939813fc2 (patch) | |
| tree | ce746ca42baa1130424d47ab2c9cb677277c7903 /src/interfaces | |
| parent | Merge #15644: Make orphan processing interruptible (diff) | |
| parent | qa: Check unconfirmed balance after loadwallet (diff) | |
| download | discoin-5a2a9b5b0603c1206e4419ffd0fd0d4939813fc2.tar.xz discoin-5a2a9b5b0603c1206e4419ffd0fd0d4939813fc2.zip | |
Merge #15652: wallet: Update transactions with current mempool after load
4bf1b1cefa qa: Check unconfirmed balance after loadwallet (João Barbosa)
2ebf650b2e wallet: Update transactions with current mempool after load (João Barbosa)
57908a739c interfaces: Add Chain::requestMempoolTransactions (João Barbosa)
0440481c6b wallet: Move CWallet::ReacceptWalletTransactions locks to callers (João Barbosa)
Pull request description:
Fixes #15591.
ACKs for commit 4bf1b1:
MarcoFalke:
re-utACK 4bf1b1cefa
jnewbery:
utACK 4bf1b1cefa9723bf2cfa8b1a938757abc99bb17b
Tree-SHA512: 604b1057c7f9fc3772084bf6914e52dd1a68a1cfd365f907e8ec78f6f5f726bc56a3cad9f2b665642714fbf3d51e37c1184ac396460bddeafd918e8f9f7af392
Diffstat (limited to 'src/interfaces')
| -rw-r--r-- | src/interfaces/chain.cpp | 7 | ||||
| -rw-r--r-- | src/interfaces/chain.h | 10 |
2 files changed, 17 insertions, 0 deletions
diff --git a/src/interfaces/chain.cpp b/src/interfaces/chain.cpp index 0c765f209..e409ced60 100644 --- a/src/interfaces/chain.cpp +++ b/src/interfaces/chain.cpp @@ -367,6 +367,13 @@ public: { return MakeUnique<RpcHandlerImpl>(command); } + void requestMempoolTransactions(Notifications& notifications) override + { + LOCK2(::cs_main, ::mempool.cs); + for (const CTxMemPoolEntry& entry : ::mempool.mapTx) { + notifications.TransactionAddedToMempool(entry.GetSharedTx()); + } + } }; } // namespace diff --git a/src/interfaces/chain.h b/src/interfaces/chain.h index a9b05f27f..d11a59241 100644 --- a/src/interfaces/chain.h +++ b/src/interfaces/chain.h @@ -269,6 +269,16 @@ public: //! Register handler for RPC. Command is not copied, so reference //! needs to remain valid until Handler is disconnected. virtual std::unique_ptr<Handler> handleRpc(const CRPCCommand& command) = 0; + + //! Synchronously send TransactionAddedToMempool notifications about all + //! current mempool transactions to the specified handler and return after + //! the last one is sent. These notifications aren't coordinated with async + //! notifications sent by handleNotifications, so out of date async + //! notifications from handleNotifications can arrive during and after + //! synchronous notifications from requestMempoolTransactions. Clients need + //! to be prepared to handle this by ignoring notifications about unknown + //! removed transactions and already added new transactions. + virtual void requestMempoolTransactions(Notifications& notifications) = 0; }; //! Interface to let node manage chain clients (wallets, or maybe tools for |