mirror of
https://github.com/PeernetOfficial/core.git
synced 2026-07-22 20:57:50 +01:00
Major refactoring of the code base into Backend structure. Increase version number to Alpha 6 to prepare for the upcoming release.
This commit is contained in:
4
Ping.go
4
Ping.go
@@ -24,7 +24,7 @@ const connectionInvalidate = 22
|
||||
const connectionRemove = 2 * 60
|
||||
|
||||
// autoPingAll sends out regular ping messages to all connections of all peers. This allows to detect invalid connections and eventually drop them.
|
||||
func autoPingAll() {
|
||||
func (backend *Backend) autoPingAll() {
|
||||
for {
|
||||
time.Sleep(time.Second)
|
||||
thresholdInvalidate1 := time.Now().Add(-connectionInvalidate * time.Second)
|
||||
@@ -33,7 +33,7 @@ func autoPingAll() {
|
||||
thresholdPingOut2 := time.Now().Add(-pingTime * time.Second * 4)
|
||||
thresholdBlockchainRefresh := time.Now().Add(-thresholdBlockchainRefresh)
|
||||
|
||||
for _, peer := range PeerlistGet() {
|
||||
for _, peer := range backend.PeerlistGet() {
|
||||
// first handle active connections
|
||||
for _, connection := range peer.GetConnections(true) {
|
||||
thresholdPing := thresholdPingOut1
|
||||
|
||||
Reference in New Issue
Block a user