You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

55 lines
1.5 KiB

7 years ago
  1. package addrbook
  2. import "time"
  3. const (
  4. // addresses under which the address manager will claim to need more addresses.
  5. needAddressThreshold = 1000
  6. // interval used to dump the address cache to disk for future use.
  7. dumpAddressInterval = time.Minute * 2
  8. // max addresses in each old address bucket.
  9. oldBucketSize = 64
  10. // buckets we split old addresses over.
  11. oldBucketCount = 64
  12. // max addresses in each new address bucket.
  13. newBucketSize = 64
  14. // buckets that we spread new addresses over.
  15. newBucketCount = 256
  16. // old buckets over which an address group will be spread.
  17. oldBucketsPerGroup = 4
  18. // new buckets over which a source address group will be spread.
  19. newBucketsPerGroup = 32
  20. // buckets a frequently seen new address may end up in.
  21. maxNewBucketsPerAddress = 4
  22. // days before which we assume an address has vanished
  23. // if we have not seen it announced in that long.
  24. numMissingDays = 7
  25. // tries without a single success before we assume an address is bad.
  26. numRetries = 3
  27. // max failures we will accept without a success before considering an address bad.
  28. maxFailures = 10 // ?
  29. // days since the last success before we will consider evicting an address.
  30. minBadDays = 7
  31. // % of total addresses known returned by GetSelection.
  32. getSelectionPercent = 23
  33. // min addresses that must be returned by GetSelection. Useful for bootstrapping.
  34. minGetSelection = 32
  35. // max addresses returned by GetSelection
  36. // NOTE: this must match "maxPexMessageSize"
  37. maxGetSelection = 250
  38. )