mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-26 14:46:42 +00:00
clean up
This commit is contained in:
parent
95948b60d4
commit
7d313c14fa
3 changed files with 1 additions and 19 deletions
|
|
@ -19,7 +19,6 @@ package legacypool
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
|
||||||
"maps"
|
"maps"
|
||||||
"math"
|
"math"
|
||||||
"math/big"
|
"math/big"
|
||||||
|
|
@ -978,7 +977,6 @@ func (pool *LegacyPool) Add(txs []*types.Transaction, sync bool) []error {
|
||||||
pool.requestPromoteExecutables(req)
|
pool.requestPromoteExecutables(req)
|
||||||
if sync {
|
if sync {
|
||||||
<-req.done
|
<-req.done
|
||||||
fmt.Printf("added %x\n", txs[0].Hash())
|
|
||||||
}
|
}
|
||||||
return errs
|
return errs
|
||||||
}
|
}
|
||||||
|
|
@ -1205,7 +1203,6 @@ func (pool *LegacyPool) scheduleReorgLoop() {
|
||||||
|
|
||||||
select {
|
select {
|
||||||
case req := <-pool.reqResetCh:
|
case req := <-pool.reqResetCh:
|
||||||
fmt.Printf("request reset to %d\n", req.newHead.Number)
|
|
||||||
// Reset request: update head if request is already pending.
|
// Reset request: update head if request is already pending.
|
||||||
if reset == nil {
|
if reset == nil {
|
||||||
reset = req
|
reset = req
|
||||||
|
|
@ -1214,10 +1211,8 @@ func (pool *LegacyPool) scheduleReorgLoop() {
|
||||||
}
|
}
|
||||||
nextDones = append(nextDones, req.done)
|
nextDones = append(nextDones, req.done)
|
||||||
launchNextRun = true
|
launchNextRun = true
|
||||||
//pool.reorgDoneCh <- nextDone
|
|
||||||
|
|
||||||
case req := <-pool.reqPromoteCh:
|
case req := <-pool.reqPromoteCh:
|
||||||
fmt.Println("request promote")
|
|
||||||
// Promote request: update address set if request is already pending.
|
// Promote request: update address set if request is already pending.
|
||||||
if dirtyAccounts == nil {
|
if dirtyAccounts == nil {
|
||||||
dirtyAccounts = req.set
|
dirtyAccounts = req.set
|
||||||
|
|
@ -1226,7 +1221,6 @@ func (pool *LegacyPool) scheduleReorgLoop() {
|
||||||
}
|
}
|
||||||
nextDones = append(nextDones, req.done)
|
nextDones = append(nextDones, req.done)
|
||||||
launchNextRun = true
|
launchNextRun = true
|
||||||
//pool.reorgDoneCh <- nextDone
|
|
||||||
|
|
||||||
case tx := <-pool.queueTxEventCh:
|
case tx := <-pool.queueTxEventCh:
|
||||||
// Queue up the event, but don't schedule a reorg. It's up to the caller to
|
// Queue up the event, but don't schedule a reorg. It's up to the caller to
|
||||||
|
|
@ -1310,7 +1304,6 @@ func (pool *LegacyPool) runReorg(done chan struct{}, reset *txpoolResetRequest,
|
||||||
for addr, list := range pool.pending {
|
for addr, list := range pool.pending {
|
||||||
highestPending := list.LastElement()
|
highestPending := list.LastElement()
|
||||||
nonces[addr] = highestPending.Nonce() + 1
|
nonces[addr] = highestPending.Nonce() + 1
|
||||||
fmt.Printf("set pending nonce %x <- %d\n", addr, highestPending.Nonce()+1)
|
|
||||||
}
|
}
|
||||||
pool.pendingNonces.setAll(nonces)
|
pool.pendingNonces.setAll(nonces)
|
||||||
}
|
}
|
||||||
|
|
@ -1467,11 +1460,8 @@ func (pool *LegacyPool) promoteExecutables(accounts []common.Address) []*types.T
|
||||||
log.Trace("Removed unpayable queued transactions", "count", len(drops))
|
log.Trace("Removed unpayable queued transactions", "count", len(drops))
|
||||||
queuedNofundsMeter.Mark(int64(len(drops)))
|
queuedNofundsMeter.Mark(int64(len(drops)))
|
||||||
|
|
||||||
fmt.Printf("pending nonce of %x is %d\n", addr, pool.pendingNonces.get(addr))
|
|
||||||
fmt.Printf("in-state nonce of %x is %d\n", addr, pool.currentState.GetNonce(addr))
|
|
||||||
// Gather all executable transactions and promote them
|
// Gather all executable transactions and promote them
|
||||||
readies := list.Ready(pool.pendingNonces.get(addr))
|
readies := list.Ready(pool.pendingNonces.get(addr))
|
||||||
fmt.Println(len(readies))
|
|
||||||
|
|
||||||
for _, tx := range readies {
|
for _, tx := range readies {
|
||||||
hash := tx.Hash()
|
hash := tx.Hash()
|
||||||
|
|
@ -1479,11 +1469,6 @@ func (pool *LegacyPool) promoteExecutables(accounts []common.Address) []*types.T
|
||||||
promoted = append(promoted, tx)
|
promoted = append(promoted, tx)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fmt.Println(len(promoted))
|
|
||||||
if len(promoted) > 0 {
|
|
||||||
fmt.Println(promoted[0].Hash())
|
|
||||||
fmt.Println(promoted[0].Nonce())
|
|
||||||
}
|
|
||||||
log.Trace("Promoted queued transactions", "count", len(promoted))
|
log.Trace("Promoted queued transactions", "count", len(promoted))
|
||||||
queuedGauge.Dec(int64(len(readies)))
|
queuedGauge.Dec(int64(len(readies)))
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -361,7 +361,6 @@ func (p *TxPool) Add(txs []*types.Transaction, sync bool) []error {
|
||||||
splits := make([]int, len(txs))
|
splits := make([]int, len(txs))
|
||||||
|
|
||||||
for i, tx := range txs {
|
for i, tx := range txs {
|
||||||
fmt.Printf("txpool attempting to add %v\n", tx.Hash())
|
|
||||||
// Mark this transaction belonging to no-subpool
|
// Mark this transaction belonging to no-subpool
|
||||||
splits[i] = -1
|
splits[i] = -1
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -119,7 +119,6 @@ func TestEth2AssembleBlock(t *testing.T) {
|
||||||
t.Fatalf("error signing transaction, err=%v", err)
|
t.Fatalf("error signing transaction, err=%v", err)
|
||||||
}
|
}
|
||||||
ethservice.TxPool().Add([]*types.Transaction{tx}, true)
|
ethservice.TxPool().Add([]*types.Transaction{tx}, true)
|
||||||
fmt.Println("in test: added txs")
|
|
||||||
blockParams := engine.PayloadAttributes{
|
blockParams := engine.PayloadAttributes{
|
||||||
Timestamp: blocks[9].Time() + 5,
|
Timestamp: blocks[9].Time() + 5,
|
||||||
}
|
}
|
||||||
|
|
@ -139,7 +138,7 @@ func assembleWithTransactions(api *ConsensusAPI, parentHash common.Hash, params
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
if have, want := len(execData.Transactions), want; have != want {
|
if have, want := len(execData.Transactions), want; have != want {
|
||||||
err = fmt.Errorf("block %d: invalid number of transactions, have %d want %d", execData.Number, have, want)
|
err = fmt.Errorf("invalid number of transactions, have %d want %d", have, want)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
return execData, nil
|
return execData, nil
|
||||||
|
|
@ -448,7 +447,6 @@ func startEthService(t *testing.T, genesis *core.Genesis, blocks []*types.Block)
|
||||||
n.Close()
|
n.Close()
|
||||||
t.Fatal("can't import test blocks:", err)
|
t.Fatal("can't import test blocks:", err)
|
||||||
}
|
}
|
||||||
time.Sleep(100 * time.Millisecond)
|
|
||||||
|
|
||||||
ethservice.SetSynced()
|
ethservice.SetSynced()
|
||||||
return n, ethservice
|
return n, ethservice
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue