Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
011fe3eb
Unverified
Commit
011fe3eb
authored
Oct 13, 2021
by
jwasinger
Committed by
GitHub
Oct 13, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core: remove unused error from TxPool.Pending (#23720)
parent
79b727bc
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
9 additions
and
23 deletions
+9
-23
tx_pool.go
core/tx_pool.go
+2
-2
tx_pool_test.go
core/tx_pool_test.go
+0
-4
api_backend.go
eth/api_backend.go
+1
-4
api.go
eth/catalyst/api.go
+1
-4
handler.go
eth/handler.go
+1
-1
handler_test.go
eth/handler_test.go
+2
-2
sync.go
eth/sync.go
+1
-1
worker.go
miner/worker.go
+1
-5
No files found.
core/tx_pool.go
View file @
011fe3eb
...
@@ -533,7 +533,7 @@ func (pool *TxPool) ContentFrom(addr common.Address) (types.Transactions, types.
...
@@ -533,7 +533,7 @@ func (pool *TxPool) ContentFrom(addr common.Address) (types.Transactions, types.
// The enforceTips parameter can be used to do an extra filtering on the pending
// The enforceTips parameter can be used to do an extra filtering on the pending
// transactions and only return those whose **effective** tip is large enough in
// transactions and only return those whose **effective** tip is large enough in
// the next pending execution environment.
// the next pending execution environment.
func
(
pool
*
TxPool
)
Pending
(
enforceTips
bool
)
(
map
[
common
.
Address
]
types
.
Transactions
,
error
)
{
func
(
pool
*
TxPool
)
Pending
(
enforceTips
bool
)
map
[
common
.
Address
]
types
.
Transactions
{
pool
.
mu
.
Lock
()
pool
.
mu
.
Lock
()
defer
pool
.
mu
.
Unlock
()
defer
pool
.
mu
.
Unlock
()
...
@@ -554,7 +554,7 @@ func (pool *TxPool) Pending(enforceTips bool) (map[common.Address]types.Transact
...
@@ -554,7 +554,7 @@ func (pool *TxPool) Pending(enforceTips bool) (map[common.Address]types.Transact
pending
[
addr
]
=
txs
pending
[
addr
]
=
txs
}
}
}
}
return
pending
,
nil
return
pending
}
}
// Locals retrieves the accounts currently considered local by the pool.
// Locals retrieves the accounts currently considered local by the pool.
...
...
core/tx_pool_test.go
View file @
011fe3eb
...
@@ -255,10 +255,6 @@ func TestStateChangeDuringTransactionPoolReset(t *testing.T) {
...
@@ -255,10 +255,6 @@ func TestStateChangeDuringTransactionPoolReset(t *testing.T) {
trigger
=
true
trigger
=
true
<-
pool
.
requestReset
(
nil
,
nil
)
<-
pool
.
requestReset
(
nil
,
nil
)
_
,
err
:=
pool
.
Pending
(
false
)
if
err
!=
nil
{
t
.
Fatalf
(
"Could not fetch pending transactions: %v"
,
err
)
}
nonce
=
pool
.
Nonce
(
address
)
nonce
=
pool
.
Nonce
(
address
)
if
nonce
!=
2
{
if
nonce
!=
2
{
t
.
Fatalf
(
"Invalid nonce, want 2, got %d"
,
nonce
)
t
.
Fatalf
(
"Invalid nonce, want 2, got %d"
,
nonce
)
...
...
eth/api_backend.go
View file @
011fe3eb
...
@@ -240,10 +240,7 @@ func (b *EthAPIBackend) SendTx(ctx context.Context, signedTx *types.Transaction)
...
@@ -240,10 +240,7 @@ func (b *EthAPIBackend) SendTx(ctx context.Context, signedTx *types.Transaction)
}
}
func
(
b
*
EthAPIBackend
)
GetPoolTransactions
()
(
types
.
Transactions
,
error
)
{
func
(
b
*
EthAPIBackend
)
GetPoolTransactions
()
(
types
.
Transactions
,
error
)
{
pending
,
err
:=
b
.
eth
.
txPool
.
Pending
(
false
)
pending
:=
b
.
eth
.
txPool
.
Pending
(
false
)
if
err
!=
nil
{
return
nil
,
err
}
var
txs
types
.
Transactions
var
txs
types
.
Transactions
for
_
,
batch
:=
range
pending
{
for
_
,
batch
:=
range
pending
{
txs
=
append
(
txs
,
batch
...
)
txs
=
append
(
txs
,
batch
...
)
...
...
eth/catalyst/api.go
View file @
011fe3eb
...
@@ -126,10 +126,7 @@ func (api *consensusAPI) AssembleBlock(params assembleBlockParams) (*executableD
...
@@ -126,10 +126,7 @@ func (api *consensusAPI) AssembleBlock(params assembleBlockParams) (*executableD
time
.
Sleep
(
wait
)
time
.
Sleep
(
wait
)
}
}
pending
,
err
:=
pool
.
Pending
(
true
)
pending
:=
pool
.
Pending
(
true
)
if
err
!=
nil
{
return
nil
,
err
}
coinbase
,
err
:=
api
.
eth
.
Etherbase
()
coinbase
,
err
:=
api
.
eth
.
Etherbase
()
if
err
!=
nil
{
if
err
!=
nil
{
...
...
eth/handler.go
View file @
011fe3eb
...
@@ -66,7 +66,7 @@ type txPool interface {
...
@@ -66,7 +66,7 @@ type txPool interface {
// Pending should return pending transactions.
// Pending should return pending transactions.
// The slice should be modifiable by the caller.
// The slice should be modifiable by the caller.
Pending
(
enforceTips
bool
)
(
map
[
common
.
Address
]
types
.
Transactions
,
error
)
Pending
(
enforceTips
bool
)
map
[
common
.
Address
]
types
.
Transactions
// SubscribeNewTxsEvent should return an event subscription of
// SubscribeNewTxsEvent should return an event subscription of
// NewTxsEvent and send events to the given channel.
// NewTxsEvent and send events to the given channel.
...
...
eth/handler_test.go
View file @
011fe3eb
...
@@ -91,7 +91,7 @@ func (p *testTxPool) AddRemotes(txs []*types.Transaction) []error {
...
@@ -91,7 +91,7 @@ func (p *testTxPool) AddRemotes(txs []*types.Transaction) []error {
}
}
// Pending returns all the transactions known to the pool
// Pending returns all the transactions known to the pool
func
(
p
*
testTxPool
)
Pending
(
enforceTips
bool
)
(
map
[
common
.
Address
]
types
.
Transactions
,
error
)
{
func
(
p
*
testTxPool
)
Pending
(
enforceTips
bool
)
map
[
common
.
Address
]
types
.
Transactions
{
p
.
lock
.
RLock
()
p
.
lock
.
RLock
()
defer
p
.
lock
.
RUnlock
()
defer
p
.
lock
.
RUnlock
()
...
@@ -103,7 +103,7 @@ func (p *testTxPool) Pending(enforceTips bool) (map[common.Address]types.Transac
...
@@ -103,7 +103,7 @@ func (p *testTxPool) Pending(enforceTips bool) (map[common.Address]types.Transac
for
_
,
batch
:=
range
batches
{
for
_
,
batch
:=
range
batches
{
sort
.
Sort
(
types
.
TxByNonce
(
batch
))
sort
.
Sort
(
types
.
TxByNonce
(
batch
))
}
}
return
batches
,
nil
return
batches
}
}
// SubscribeNewTxsEvent should return an event subscription of NewTxsEvent and
// SubscribeNewTxsEvent should return an event subscription of NewTxsEvent and
...
...
eth/sync.go
View file @
011fe3eb
...
@@ -43,7 +43,7 @@ func (h *handler) syncTransactions(p *eth.Peer) {
...
@@ -43,7 +43,7 @@ func (h *handler) syncTransactions(p *eth.Peer) {
//
//
// TODO(karalabe): Figure out if we could get away with random order somehow
// TODO(karalabe): Figure out if we could get away with random order somehow
var
txs
types
.
Transactions
var
txs
types
.
Transactions
pending
,
_
:=
h
.
txpool
.
Pending
(
false
)
pending
:=
h
.
txpool
.
Pending
(
false
)
for
_
,
batch
:=
range
pending
{
for
_
,
batch
:=
range
pending
{
txs
=
append
(
txs
,
batch
...
)
txs
=
append
(
txs
,
batch
...
)
}
}
...
...
miner/worker.go
View file @
011fe3eb
...
@@ -987,11 +987,7 @@ func (w *worker) commitNewWork(interrupt *int32, noempty bool, timestamp int64)
...
@@ -987,11 +987,7 @@ func (w *worker) commitNewWork(interrupt *int32, noempty bool, timestamp int64)
}
}
// Fill the block with all available pending transactions.
// Fill the block with all available pending transactions.
pending
,
err
:=
w
.
eth
.
TxPool
()
.
Pending
(
true
)
pending
:=
w
.
eth
.
TxPool
()
.
Pending
(
true
)
if
err
!=
nil
{
log
.
Error
(
"Failed to fetch pending transactions"
,
"err"
,
err
)
return
}
// Short circuit if there is no available pending transactions.
// Short circuit if there is no available pending transactions.
// But if we disable empty precommit already, ignore it. Since
// But if we disable empty precommit already, ignore it. Since
// empty block is necessary to keep the liveness of the network.
// empty block is necessary to keep the liveness of the network.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment