From dc7c4e56273eaa43b7c5c003997538fe89ab9cc2 Mon Sep 17 00:00:00 2001 From: Denis Ryabov Date: Tue, 8 Jul 2014 18:28:47 +0400 Subject: [PATCH] fix store/load confirmed field --- libtorrent/src/kademlia/node.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libtorrent/src/kademlia/node.cpp b/libtorrent/src/kademlia/node.cpp index ac3d3ed8..7d29d0eb 100644 --- a/libtorrent/src/kademlia/node.cpp +++ b/libtorrent/src/kademlia/node.cpp @@ -710,7 +710,7 @@ bool node_impl::save_storage(entry &save) const { entry_item["sig_user"] = item.sig_user; if( item.local_add_time ) entry_item["local_add_time"] = item.local_add_time; - entry_item["confirmed"] = item.confirmed ? 0 : 1; + entry_item["confirmed"] = item.confirmed ? 1 : 0; save_list.list().push_back(entry_item); } } @@ -749,7 +749,7 @@ void node_impl::load_storage(entry const* e) { item.local_add_time = local_add_time->integer(); entry const *confirmed( j->find_key("confirmed") ); if(confirmed) { - item.confirmed = (bool) confirmed->integer(); + item.confirmed = (confirmed->integer() != 0); } // just for printf for now