swap

package
v1.8.22 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2019 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Swap

type Swap struct {
	// contains filtered or unexported fields
}

SwAP Swarm Accounting Protocol a peer to peer micropayment system A node maintains an individual balance with every peer Only messages which have a price will be accounted for

func New

func New(stateStore state.Store) (swap *Swap)

New - swap constructor

func (*Swap) Add

func (s *Swap) Add(amount int64, peer *protocols.Peer) (err error)

Swap implements the protocols.Balance interface Add is the (sole) accounting function

func (*Swap) Close

func (swap *Swap) Close()

Clean up Swap

func (*Swap) GetPeerBalance

func (swap *Swap) GetPeerBalance(peer enode.ID) (int64, error)

GetPeerBalance returns the balance for a given peer

Jump to

Keyboard shortcuts

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