p9c / pod-archive

ParallelCoin's Omnibus Depositorie
https://parallelcoin.info
The Unlicense
9 stars 5 forks source link

revise peer management to distinguish by IP and port not just IP #133

Closed l0k18 closed 3 years ago

l0k18 commented 3 years ago

As I was looking into the handling of peer lists, I discovered that it was stored purely inside a goroutine with no means to access it from elsewhere. Presumably this avoids concurrency on the state, however, to evaluate the state of connections, to require connection to lan or internet peers to allow mining, there needs to be a way to access this, where I discovered that peers are considered to be distinct only by IP address.

Changing this to include port is an extensive change in pkg/rpc/chainrpc/server.go

Making this note to deal with this issue later, as it affects nodes with multiple servers inbound via UPnP or manual configuration or multiple instances on one machine, isn't important but opening access to the peer list is required to fix the mining inhibition based on the --lan and --solo flags

l0k18 commented 3 years ago

this is fixed by using uuid's