From 08528c28b7ef2d3ce59ea9a79579a01ac5d5cded Mon Sep 17 00:00:00 2001 From: Dave Collins Date: Tue, 23 Nov 2021 18:24:55 -0600 Subject: [PATCH] netsync: Remove unused tx submission processing. This removes the code related to submitting transactions through the network sync manager since it is no longer used. --- internal/netsync/manager.go | 48 ------------------------------------- 1 file changed, 48 deletions(-) diff --git a/internal/netsync/manager.go b/internal/netsync/manager.go index a67f2b04..65b29eab 100644 --- a/internal/netsync/manager.go +++ b/internal/netsync/manager.go @@ -179,25 +179,6 @@ type processBlockMsg struct { reply chan processBlockResponse } -// processTransactionResponse is a response sent to the reply channel of a -// processTransactionMsg. -type processTransactionResponse struct { - acceptedTxs []*dcrutil.Tx - err error -} - -// processTransactionMsg is a message type to be sent across the message -// channel for requesting a transaction to be processed through the block -// manager. -type processTransactionMsg struct { - tx *dcrutil.Tx - allowOrphans bool - rateLimit bool - allowHighFees bool - tag mempool.Tag - reply chan processTransactionResponse -} - // syncMgrPeer extends a peer to maintain additional state maintained by the // sync manager. type syncMgrPeer struct { @@ -1444,14 +1425,6 @@ out: err: nil, } - case processTransactionMsg: - acceptedTxs, err := m.cfg.TxMemPool.ProcessTransaction(msg.tx, - msg.allowOrphans, msg.rateLimit, msg.allowHighFees, msg.tag) - msg.reply <- processTransactionResponse{ - acceptedTxs: acceptedTxs, - err: err, - } - default: log.Warnf("Invalid message type in event handler: %T", msg) } @@ -1720,27 +1693,6 @@ func (m *SyncManager) ProcessBlock(block *dcrutil.Block) error { } } -// ProcessTransaction makes use of ProcessTransaction on an internal instance of -// a block chain. It is funneled through the sync manager since blockchain is -// not safe for concurrent access. -func (m *SyncManager) ProcessTransaction(tx *dcrutil.Tx, allowOrphans bool, - rateLimit bool, allowHighFees bool, tag mempool.Tag) ([]*dcrutil.Tx, error) { - - reply := make(chan processTransactionResponse, 1) - select { - case m.msgChan <- processTransactionMsg{tx, allowOrphans, rateLimit, - allowHighFees, tag, reply}: - case <-m.quit: - } - - select { - case response := <-reply: - return response.acceptedTxs, response.err - case <-m.quit: - return nil, fmt.Errorf("sync manager stopped") - } -} - // IsCurrent returns whether or not the sync manager believes it is synced with // the connected peers. //