gossipd: increase randomness in route selection.

We have a seed, which is for (future!) unit testing consistency.  This
makes it change every time, so our pay_direct_test is more useful.

I tried restarting the noed around the loop, but it tended to fail
rebinding to the same port for some reason?

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2019-02-01 13:06:18 +10:30
committed by Christian Decker
parent 38a2f6c616
commit 6a26b0c18d
5 changed files with 19 additions and 4 deletions

View File

@@ -37,6 +37,13 @@ uint64_t pseudorand(uint64_t max)
return isaac64_next_uint(&isaac64, max);
}
uint64_t pseudorand_u64(void)
{
init_if_needed();
return isaac64_next_uint64(&isaac64);
}
const struct siphash_seed *siphash_seed(void)
{
init_if_needed();