Closed aszepieniec closed 11 months ago
The error seems to be due to this line let peer_address = stream.peer_addr().unwrap();
in
// Handle incoming connections from peer
Ok((stream, peer_address)) = self.incoming_peer_listener.accept() => {
let state = self.global_state.clone();
let main_to_peer_broadcast_rx_clone: broadcast::Receiver<MainToPeerThread> = self.main_to_peer_broadcast_tx.subscribe();
let peer_thread_to_main_tx_clone: mpsc::Sender<PeerThreadToMain> = self.peer_thread_to_main_tx.clone();
// let peer_address = stream.peer_addr().unwrap();
let own_handshake_data: HandshakeData = state.get_own_handshakedata().await;
let incoming_peer_thread_handle = tokio::spawn(async move {
match answer_peer_wrapper(
stream,
state,
peer_address,
main_to_peer_broadcast_rx_clone,
peer_thread_to_main_tx_clone,
own_handshake_data,
).await {
Ok(()) => (),
Err(err) => error!("Got error: {:?}", err),
}
});
main_loop_state.thread_handles.push(incoming_peer_thread_handle);
main_loop_state.thread_handles.retain(|th| !th.is_finished());
}
If the connection is established and immediately broken, I guess that stream.peer_addr()
returns None
. We can just get peer_address
from the accept()
method's return value instead.
And, upon restarting, the node crashes again with the log ending in this:
2023-11-01T11:29:07.221667976Z DEBUG ThreadId(01) neptune_core::models::state::wallet::wallet_state: Block has 0 removal records
2023-11-01T11:29:07.221707216Z DEBUG ThreadId(01) neptune_core::models::state::wallet::wallet_state: Transaction has 0 inputs
2023-11-01T11:29:07.221759008Z DEBUG ThreadId(01) neptune_core::models::state::wallet::wallet_state: Number of mutated membership proofs: 0
2023-11-01T11:29:07.429363168Z DEBUG ThreadId(01) neptune_core::models::state::wallet::wallet_state: Number of unspent UTXOs: 2656
2023-11-01T11:29:07.586939683Z DEBUG ThreadId(01) neptune_core::main_loop: Flushed all databases
2023-11-01T11:29:07.587078226Z DEBUG ThreadId(01) neptune_core::main_loop: Timer: block-synchronization job
2023-11-01T11:29:07.587094596Z INFO ThreadId(01) neptune_core::main_loop: Running sync
2023-11-01T11:29:07.587110247Z WARN ThreadId(01) neptune_core::main_loop: Could not read current block. Aborting block synchronization
I had to kill the process with kill -9
.
a0cd20e0bc09d66315c93bc90e4ee2c2c9f55929 Should fix the original issue. Could you make a new issue for the other problem?
My node crashed on 2023-10-27. This was the tail of the log: