farmer

package
v0.0.0-...-575db3a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 9, 2017 License: AGPL-3.0 Imports: 21 Imported by: 0

Documentation

Overview

Announce announces to the network that this node has joined
It does so by telling the first seed node it finds active

Cron.go - deal with all things that should happen occassionally

Filename manipulation routines initially written on 5/6/17

Try and prevent spamming by limiting the number of request to once every 10 seconds
(unless someeone else connects)
This function is only set for External connectionings in run.go

Index

Constants

View Source
const MaxIPsOrMacs int = 50
View Source
const PeersBucket = "PeersBucket"

Variables

View Source
var FarmerMutex sync.Mutex
View Source
var LastConnectTime time.Time
View Source
var LastRemoteAddr string
View Source
var PeerIP map[string]int // Indexed by HostID
View Source
var PeerMac map[string]int // Indexed by Mac Address
View Source
var PeerMap struct {
	PL util.PeerList
	// contains filtered or unexported fields
}

Functions

func CheckPeers

func CheckPeers()

func CheckWallet

func CheckWallet(serverIP string) string

func CronDaily

func CronDaily()

func CronHourly

func CronHourly()

func DB

func DB(c chan string)

func FindNodeIP

func FindNodeIP(nodeIP string) string

func FlushPeerMap

func FlushPeerMap() error

func PeerAdd

func PeerAdd(pi *PeerInfo) string

func PeerDelete

func PeerDelete(key string) error

func PeerListAll

func PeerListAll() string

func PeerListExt

func PeerListExt() string

func Run

func Run(c chan bool)

func SendFile

func SendFile(address string, filename string)

func Status

func Status() string

func Wallet

func Wallet(c chan string, check bool)

Types

type PeerInfo

type PeerInfo struct {
	SenderIP   string // including port
	WalletAddr string
	HopCount   int
	IsASeed    bool
	Detail     util.Peer
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL