aboutsummaryrefslogtreecommitdiffstats
path: root/eth
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2017-07-05 21:53:40 +0800
committerPéter Szilágyi <peterke@gmail.com>2017-07-05 21:53:40 +0800
commit4c1d0b164b61f0ab17c899061c04b7b48a9d20a8 (patch)
tree5b5aa441f03979b6eaad240af6186f4f4c12cd04 /eth
parent48ee7f9de7da0455b80ee09f498dbce54127103a (diff)
downloadgo-tangerine-4c1d0b164b61f0ab17c899061c04b7b48a9d20a8.tar
go-tangerine-4c1d0b164b61f0ab17c899061c04b7b48a9d20a8.tar.gz
go-tangerine-4c1d0b164b61f0ab17c899061c04b7b48a9d20a8.tar.bz2
go-tangerine-4c1d0b164b61f0ab17c899061c04b7b48a9d20a8.tar.lz
go-tangerine-4c1d0b164b61f0ab17c899061c04b7b48a9d20a8.tar.xz
go-tangerine-4c1d0b164b61f0ab17c899061c04b7b48a9d20a8.tar.zst
go-tangerine-4c1d0b164b61f0ab17c899061c04b7b48a9d20a8.zip
eth: drop leftover from previous nonce protection scheme
Diffstat (limited to 'eth')
-rw-r--r--eth/api_backend.go22
-rw-r--r--eth/backend.go1
2 files changed, 0 insertions, 23 deletions
diff --git a/eth/api_backend.go b/eth/api_backend.go
index a60b36e65..7ef7c030d 100644
--- a/eth/api_backend.go
+++ b/eth/api_backend.go
@@ -116,28 +116,18 @@ func (b *EthApiBackend) GetEVM(ctx context.Context, msg core.Message, state *sta
}
func (b *EthApiBackend) SendTx(ctx context.Context, signedTx *types.Transaction) error {
- b.eth.txMu.Lock()
- defer b.eth.txMu.Unlock()
-
return b.eth.txPool.AddLocal(signedTx)
}
func (b *EthApiBackend) RemoveTx(txHash common.Hash) {
- b.eth.txMu.Lock()
- defer b.eth.txMu.Unlock()
-
b.eth.txPool.Remove(txHash)
}
func (b *EthApiBackend) GetPoolTransactions() (types.Transactions, error) {
- b.eth.txMu.Lock()
- defer b.eth.txMu.Unlock()
-
pending, err := b.eth.txPool.Pending()
if err != nil {
return nil, err
}
-
var txs types.Transactions
for _, batch := range pending {
txs = append(txs, batch...)
@@ -146,30 +136,18 @@ func (b *EthApiBackend) GetPoolTransactions() (types.Transactions, error) {
}
func (b *EthApiBackend) GetPoolTransaction(hash common.Hash) *types.Transaction {
- b.eth.txMu.Lock()
- defer b.eth.txMu.Unlock()
-
return b.eth.txPool.Get(hash)
}
func (b *EthApiBackend) GetPoolNonce(ctx context.Context, addr common.Address) (uint64, error) {
- b.eth.txMu.Lock()
- defer b.eth.txMu.Unlock()
-
return b.eth.txPool.State().GetNonce(addr), nil
}
func (b *EthApiBackend) Stats() (pending int, queued int) {
- b.eth.txMu.Lock()
- defer b.eth.txMu.Unlock()
-
return b.eth.txPool.Stats()
}
func (b *EthApiBackend) TxPoolContent() (map[common.Address]types.Transactions, map[common.Address]types.Transactions) {
- b.eth.txMu.Lock()
- defer b.eth.txMu.Unlock()
-
return b.eth.TxPool().Content()
}
diff --git a/eth/backend.go b/eth/backend.go
index 75e0e737b..78478e86e 100644
--- a/eth/backend.go
+++ b/eth/backend.go
@@ -63,7 +63,6 @@ type Ethereum struct {
stopDbUpgrade func() // stop chain db sequential key upgrade
// Handlers
txPool *core.TxPool
- txMu sync.Mutex
blockchain *core.BlockChain
protocolManager *ProtocolManager
lesServer LesServer