1. implemented network prefix load from config file

This commit is contained in:
vadym 2022-10-31 00:00:15 +02:00
parent c7bca5d212
commit ff860e71c3
4 changed files with 10 additions and 5 deletions

View file

@ -17,7 +17,7 @@ type Subnet [8]byte
// The 8th bit of the last byte is used to signal nodes (0) or /64 prefixes (1).
// Nodes that configure this differently will be unable to communicate with each other using IP packets, though routing and the DHT machinery *should* still work.
func (c *Core) GetPrefix() [1]byte {
return [...]byte{0xfc}
return c.config.networkdomain.Prefix
}
// IsValid returns true if an address falls within the range used by nodes in the network.