From f1bfe6fd85b0841944b2124fc7bb9e0de341af08 Mon Sep 17 00:00:00 2001 From: "alex.sharov" Date: Thu, 5 Aug 2021 10:01:31 +0700 Subject: [PATCH] add onNewTxs method --- txpool/pool.go | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/txpool/pool.go b/txpool/pool.go index e049c1eb9..cb6640fa7 100644 --- a/txpool/pool.go +++ b/txpool/pool.go @@ -40,10 +40,6 @@ type Pool interface { NotifyNewPeer(peerID PeerID) } -type Broadcaster interface { - OnNew(hashes Hashes) -} - // SubPoolMarker ordered bitset responsible to sort transactions by sub-pools. Bits meaning: // 1. Minimum fee requirement. Set to 1 if feeCap of the transaction is no less than in-protocol parameter of minimal base fee. Set to 0 if feeCap is less than minimum base fee, which means this transaction will never be included into this particular chain. // 2. Absence of nonce gaps. Set to 1 for transactions whose nonce is N, state nonce for the sender is M, and there are transactions for all nonces between M and N from the same sender. Set to 0 is the transaction's nonce is divided from the state nonce by one or more nonce gaps. @@ -97,16 +93,11 @@ type senderInfo struct { txNonce2Tx *nonce2Tx // sorted map of nonce => *MetaTx } +//nolint func newSenderInfo(nonce uint64, balance uint256.Int) *senderInfo { return &senderInfo{nonce: nonce, balance: balance, txNonce2Tx: &nonce2Tx{btree.New(32)}} } -type StateDiffItem struct { - addr [20]byte - balance uint256.Int - nonce uint64 -} - type nonce2TxItem struct{ *MetaTx } func (i *nonce2TxItem) Less(than btree.Item) bool { @@ -132,7 +123,6 @@ type TxPool struct { // fields for transaction propagation recentlyConnectedPeers *recentlyConnectedPeers newTxs chan Hashes - broadcaster Broadcaster //lastTxPropagationTimestamp time.Time }