eth: remove redundant code

This commit is contained in:
sammy 2018-06-13 21:19:44 +08:00
parent 1fc54d92ec
commit 28d96460be

View file

@ -207,9 +207,6 @@ func (p *peer) SendTransactions(txs types.Transactions) error {
func (p *peer) AsyncSendTransactions(txs []*types.Transaction) { func (p *peer) AsyncSendTransactions(txs []*types.Transaction) {
select { select {
case p.queuedTxs <- txs: case p.queuedTxs <- txs:
for _, tx := range txs {
p.knownTxs.Add(tx.Hash())
}
default: default:
p.Log().Debug("Dropping transaction propagation", "count", len(txs)) p.Log().Debug("Dropping transaction propagation", "count", len(txs))
} }
@ -235,7 +232,6 @@ func (p *peer) SendNewBlockHashes(hashes []common.Hash, numbers []uint64) error
func (p *peer) AsyncSendNewBlockHash(block *types.Block) { func (p *peer) AsyncSendNewBlockHash(block *types.Block) {
select { select {
case p.queuedAnns <- block: case p.queuedAnns <- block:
p.knownBlocks.Add(block.Hash())
default: default:
p.Log().Debug("Dropping block announcement", "number", block.NumberU64(), "hash", block.Hash()) p.Log().Debug("Dropping block announcement", "number", block.NumberU64(), "hash", block.Hash())
} }
@ -252,7 +248,6 @@ func (p *peer) SendNewBlock(block *types.Block, td *big.Int) error {
func (p *peer) AsyncSendNewBlock(block *types.Block, td *big.Int) { func (p *peer) AsyncSendNewBlock(block *types.Block, td *big.Int) {
select { select {
case p.queuedProps <- &propEvent{block: block, td: td}: case p.queuedProps <- &propEvent{block: block, td: td}:
p.knownBlocks.Add(block.Hash())
default: default:
p.Log().Debug("Dropping block propagation", "number", block.NumberU64(), "hash", block.Hash()) p.Log().Debug("Dropping block propagation", "number", block.NumberU64(), "hash", block.Hash())
} }