Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNilState = errors.New("hostdb can't use nil State") ErrMissingGenesisBlock = errors.New("state doesn't have a genesis block") )
Functions ¶
This section is empty.
Types ¶
type HostDB ¶
type HostDB struct {
// contains filtered or unexported fields
}
The HostDB is a database of potential hosts. It assigns a weight to each host based on their hosting parameters, and then can select hosts at random for uploading files.
func (*HostDB) FlagHost ¶
func (hdb *HostDB) FlagHost(addr modules.NetAddress) error
FlagHost is called when a host is caught misbehaving. In general, the behavior is that the host will be called less often. For the time being, that means removing the host from the database outright.
func (*HostDB) RandomHost ¶
RandomHost pulls a random host from the hostdb weighted according to the internal metrics of the hostdb.
Click to show internal directories.
Click to hide internal directories.