aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2015-12-08 20:10:01 +0200
committerRiccardo Spagni <ric@spagni.net>2015-12-08 20:10:04 +0200
commite7872656bc6a43f50885459b4f69f86b99b7dcbc (patch)
tree9717c265a6ba435418c8cd872a2c24d41b78ec82 /src
parentMerge pull request #521 (diff)
parentp2p: failure to load p2pstate.bin is not fatal anymore (diff)
downloadmonero-e7872656bc6a43f50885459b4f69f86b99b7dcbc.tar.xz
Merge pull request #522
34e3889 p2p: failure to load p2pstate.bin is not fatal anymore (moneromooo-monero)
Diffstat (limited to 'src')
-rw-r--r--src/p2p/net_node.inl13
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();