transaction

package
v0.0.0-...-37cad83 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Transaction

type Transaction struct {
	ID      []byte
	Inputs  []TxInput
	Outputs []TxOutput
}

func CoinbaseTx

func CoinbaseTx(to, data string) (*Transaction, error)

func NewTransaction

func NewTransaction(from, to string, amount, accumulated int, validOutputs map[string][]int) (*Transaction, error)

func (*Transaction) IsCoinbase

func (tx *Transaction) IsCoinbase() bool

type TxInput

type TxInput struct {
	ID  []byte
	Out int
	Sig string
}

func (*TxInput) CanUnlock

func (in *TxInput) CanUnlock(data string) bool

type TxOutput

type TxOutput struct {
	Value  int
	PubKey string
}

func (*TxOutput) CanBeUnlocked

func (out *TxOutput) CanBeUnlocked(data string) bool

Jump to

Keyboard shortcuts

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