diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/p2p/net_node.inl | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/p2p/net_node.inl b/src/p2p/net_node.inl index 067f6378d..6bbad0258 100644 --- a/src/p2p/net_node.inl +++ b/src/p2p/net_node.inl @@ -134,8 +134,17 @@ namespace nodetool p2p_data.open( state_file_path , std::ios_base::binary | std::ios_base::in); if(!p2p_data.fail()) { - boost::archive::binary_iarchive a(p2p_data); - a >> *this; + try + { + boost::archive::binary_iarchive a(p2p_data); + a >> *this; + } + catch (const std::exception &e) + { + LOG_ERROR("Failed to load p2p config file, falling back to default config"); + m_peerlist = peerlist_manager(); // it was probably half clobbered by the failed load + make_default_config(); + } }else { make_default_config(); |