• Joshua Gutow's avatar
    op-node: Fix panic when p2p server fails to start (#4493) · be730fd0
    Joshua Gutow authored
    I only set `OpNode.server` to the created server if it starts up
    successfully. This alleviates an error where if creation succeeds,
    but startup does not, we attempt to stop the server which panics.
    
    This also adds logging to indicate that initialization failed. This
    logging primarily benefits users who call `node.New` directly rather
    than end users because there is already logging in the main function.
    
    I tested this manually with op-e2e & was able to reproduce the error &
    confirm that it is fixed.
    be730fd0
node.go 10.8 KB