Skip to content

Commit

Permalink
Enclave: fix panic on uninitialised mempool (#1940)
Browse files Browse the repository at this point in the history
  • Loading branch information
BedrockSquirrel authored May 30, 2024
1 parent 1daffac commit 99a8aee
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion go/enclave/txpool/txpool.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func NewTxPool(blockchain *ethchainadapter.EthChainAdapter, gasTip *big.Int, log
// Start starts the pool
// can only be started after t.blockchain has at least one block inside
func (t *TxPool) Start() error {
if t.pool != nil {
if t.running {
return fmt.Errorf("tx pool already started")
}

Expand All @@ -75,6 +75,9 @@ func (t *TxPool) PendingTransactions() map[gethcommon.Address][]*gethtxpool.Lazy

// Add adds a new transactions to the pool
func (t *TxPool) Add(transaction *common.L2Tx) error {
if !t.running {
return fmt.Errorf("tx pool not running")
}
var strErrors []string
for _, err := range t.pool.Add([]*types.Transaction{transaction}, false, false) {
if err != nil {
Expand Down

0 comments on commit 99a8aee

Please sign in to comment.