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.
This commit is contained in:
Dave Collins 2021-11-23 18:24:55 -06:00
parent df67eca18e
commit 08528c28b7
No known key found for this signature in database
GPG Key ID: B8904D9D9C93D1F2

View File

@ -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.
//