Skip to content

Add HostDB Tests

David Vorick requested to merge renter into master

As usually happens, writing tests for the hostdb helped me to reason about a lot of things that it was doing, so there are a bunch of changes.

I also moved some things around in the network package to increase the organization. I renamed network.go to tcpserver.go, and I moved the address functions to their own address.go file. None of the functions or types were changed, just which files they are in.

Entry weight no longer weights according to price. This is of course a pretty big problem. I couldn't think of a good way to write the equation. I think I'd want the weight to increase linearly as the collateral increases, and I'd want the weight to decrease with the square of the price.

The problem is that we're stuck with integer weights, so you'll only have positive weights in that scheme if the collateral is equal to the square of the price, which is unreasonable. We should probably also enforce a max and min on the collateral. Max of 2x price, min of 1/2 price. The price would then be the dominating factor.

Merge request reports