wallet

package
v0.2.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetWalletHeight

func GetWalletHeight() uint64

GetWalletHeight return wallet on current height

Types

type StatusInfo

type StatusInfo struct {
	Height uint64
	Hash   bc.Hash
}

StatusInfo is base valid block info to handle orphan block rollback

type Wallet

type Wallet struct {
	DB db.DB

	Ind *query.Indexer
	StatusInfo
	// contains filtered or unexported fields
}

Wallet is related to storing account unspent outputs

var GlobalWallet Wallet

GlobalWallet for sourceReserve heightFn

func InitWallet

func InitWallet(walletDB db.DB, accounts *account.Manager, assets *asset.Registry) *Wallet

InitWallet return a new wallet instance

func (*Wallet) GetWalletInfo

func (w *Wallet) GetWalletInfo() (StatusInfo, error)

GetWalletInfo return stored wallet info and nil,if error, return initial wallet info and err

func (*Wallet) WalletUpdate

func (w *Wallet) WalletUpdate(c *protocol.Chain)

WalletUpdate process every valid block and reverse every invalid block which need to rollback

Jump to

Keyboard shortcuts

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