Documentation ¶
Overview ¶
Package payment - control of payment verification
Index ¶
- Constants
- func Finalise() error
- func Initialise(configuration *Configuration) error
- type Configuration
- type P2PCache
- type PeerMap
- func (m *PeerMap) Add(addr string, p *peer.Peer)
- func (m *PeerMap) Delete(addr string)
- func (m *PeerMap) Exist(addr string) bool
- func (m *PeerMap) First() (p *peer.Peer)
- func (m *PeerMap) Get(addr string) (p *peer.Peer)
- func (m *PeerMap) Len() int
- func (m *PeerMap) Range(callback func(key string, value *peer.Peer))
Constants ¶
View Source
const ( // MinimumNonceLength - least number of bytes in NONCE MinimumNonceLength = 8 // MaximumNonceLength - most number of bytes in NONCE MaximumNonceLength = 64 )
View Source
const HeaderSyncTimeout = time.Minute
View Source
const MaximumOutboundPeers = 32
View Source
const PaymentExpiry = 12 * time.Hour
Variables ¶
This section is empty.
Functions ¶
func Initialise ¶ added in v0.2.0
func Initialise(configuration *Configuration) error
Initialise - setup the payment system
Types ¶
type Configuration ¶ added in v0.2.0
type Configuration struct { AutoVerify bool `gluamapper:"auto_verify" json:"auto_verify"` Mode string `gluamapper:"mode" json:"mode"` P2PCache P2PCache `gluamapper:"p2p_cache" json:"p2p_cache"` BootstrapNodes bootstrapNodesConfiguration `gluamapper:"bootstrap_nodes" json:"bootstrap_nodes"` Bitcoin *currencyConfiguration `gluamapper:"bitcoin" json:"bitcoin"` Litecoin *currencyConfiguration `gluamapper:"litecoin" json:"litecoin"` }
Configuration - structure for configuration file
type PeerMap ¶ added in v0.12.0
PeerMap is a map that maintains the pair between addresses and bitcoin peers in a thread-safe way.
func NewPeerMap ¶ added in v0.12.0
func NewPeerMap() *PeerMap
func (*PeerMap) First ¶ added in v0.12.0
First will return the first peer get from the map iteration. Due to the nature of map in golang, the item is random without fixed order.
Click to show internal directories.
Click to hide internal directories.