mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
use errors.Join
This commit is contained in:
parent
31a3ae4ccd
commit
f160500994
1 changed files with 5 additions and 6 deletions
|
|
@ -17,6 +17,7 @@
|
|||
package simulated
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"time"
|
||||
|
||||
"github.com/ethereum/go-ethereum"
|
||||
|
|
@ -142,18 +143,16 @@ func (n *Backend) Close() error {
|
|||
n.client.Close()
|
||||
n.client = simClient{}
|
||||
}
|
||||
var rerr error // return only last error if there are multiple
|
||||
var err error
|
||||
if n.beacon != nil {
|
||||
rerr = n.beacon.Stop()
|
||||
err = n.beacon.Stop()
|
||||
n.beacon = nil
|
||||
}
|
||||
if n.node != nil {
|
||||
if err := n.node.Close(); err != nil {
|
||||
rerr = err
|
||||
}
|
||||
err = errors.Join(err, n.node.Close())
|
||||
n.node = nil
|
||||
}
|
||||
return rerr
|
||||
return err
|
||||
}
|
||||
|
||||
// Commit seals a block and moves the chain forward to a new empty block.
|
||||
|
|
|
|||
Loading…
Reference in a new issue