From df67eca18edfc40b0dd4608c8baabf97696e35b3 Mon Sep 17 00:00:00 2001 From: Dave Collins Date: Tue, 23 Nov 2021 18:11:13 -0600 Subject: [PATCH] rpcserver: Submit transactions directly. This modifies the adaptor that the RPC server uses for transaction submission to process the transaction directly instead of piping through the netsync package. There is no longer any reason to incur the extra overhead since the mempool is concurrent safe the initial reasons for piping it through netsync no longer apply. This can be seen by noting that the net sync manager doesn't do anything except call the mempool method. --- rpcadaptors.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rpcadaptors.go b/rpcadaptors.go index 6db4183a..b95aed5a 100644 --- a/rpcadaptors.go +++ b/rpcadaptors.go @@ -351,7 +351,8 @@ func (b *rpcSyncMgr) SyncHeight() int64 { // into the memory pool. func (b *rpcSyncMgr) ProcessTransaction(tx *dcrutil.Tx, allowOrphans bool, rateLimit bool, allowHighFees bool, tag mempool.Tag) ([]*dcrutil.Tx, error) { - return b.syncMgr.ProcessTransaction(tx, allowOrphans, + + return b.server.txMemPool.ProcessTransaction(tx, allowOrphans, rateLimit, allowHighFees, tag) }