2 Commits

Author SHA1 Message Date
Patrick Lodder
87bd548807
Update copyright headers in files
Detected changes since fork from Bitcoin Core 0.14 and either
updated the Dogecoin Core developer copyright, or added a line
for it.

Script can be found at:

https://gist.github.com/patricklodder/210a449896ece9ca4a8f872328198e3f
2022-07-16 20:18:50 +02:00
Patrick Lodder
8c5dc302ba
net: constrain the memory usage of manually added nodes
Each node keeps a registry of manually added nodes (through the
addnode parameter, rpc call or UI) but there are currently no
limits imposed on that usage, which is a bit sloppy and can lead
to situations where memory is being used for storing addresses
that are never connected to, because the maximum number of
connections used for addnode entries is hardcoded as 8. This
could prevent smaller systems that host nodes (like those
running on an ARM SoC) to optimally use the available memory.

This enhancement limits the addnode functionality as follows:

1. Whenever over 799 nodes are added to the registry, require
   the user to remove an entry before a new one can be added
2. Disallow very large addresses (more than 256 characters).
   This limit provides for at least 4 levels of subdomains as
   specified under RFC1035.

See https://datatracker.ietf.org/doc/html/rfc1035#section-2.3.1
2022-06-20 01:54:31 +02:00