Browse Source

simpler expression for random diffusion

miguelfreitas
Denis Ryabov 11 years ago
parent
commit
785d05f10c
  1. 4
      libtorrent/src/kademlia/node.cpp

4
libtorrent/src/kademlia/node.cpp

@ -616,8 +616,8 @@ bool node_impl::refresh_storage() {
--refresh_per_tick_limit; --refresh_per_tick_limit;
// add 10% diffusion to next refresh time // add +/-10% diffusion to next refresh time
item.next_refresh_time = now + minutes(item.confirmed ? 60 : 1) * (1. + 0.1 * (2. * getRandom() - 1.)); item.next_refresh_time = now + minutes(item.confirmed ? 60 : 1) * ( 0.9 + 0.2 * getRandom() );
} }
} }

Loading…
Cancel
Save