Documentation ¶
Index ¶
- func Fingerprint(hash []byte, i uint32) []byte
- type BitStack
- type Block
- type Config
- type Database
- type Filter
- type HashStack
- type HeaderGetter
- type Inventory
- func (inv *Inventory) Close()
- func (inv *Inventory) Connected() chan struct{}
- func (inv *Inventory) GetRecentMerkleBlocks(count int) error
- func (inv *Inventory) Run()
- func (inv *Inventory) Send(m network.Message) string
- func (inv *Inventory) SendGetData(vector messages.InventoryVector, addrHint string) error
- func (inv *Inventory) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (inv *Inventory) Subscribe(d dispatcher)
- func (inv *Inventory) UnspentTxOutputs() []*messages.TxOutput
- func (inv *Inventory) Unsubscribe(d dispatcher)
- func (inv *Inventory) UpdateTxOutputs(version *TxVersion) error
- func (inv *Inventory) VerifyTransaction(tx *messages.Transaction) (bool, error)
- type MerkleNode
- type Network
- type Transaction
- type TxLoader
- type TxOutput
- type TxVersion
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Fingerprint ¶
Types ¶
type Filter ¶
type Filter struct {
// contains filtered or unexported fields
}
TODO make threadsafe
func (*Filter) Filter ¶
func (f *Filter) Filter() *messages.FilterLoad
func (*Filter) RemoteData ¶
func (*Filter) RemoteUpdateNeeded ¶
type HeaderGetter ¶
type HeaderGetter struct {
// contains filtered or unexported fields
}
func GetHeaders ¶
func GetHeaders(inv *Inventory, db Database) *HeaderGetter
func (*HeaderGetter) Close ¶
func (getter *HeaderGetter) Close()
Close shuts down the header getter. It is guaranteed to not read or write to any channels after Close returns.
func (*HeaderGetter) Input ¶
func (getter *HeaderGetter) Input() chan<- network.Message
func (*HeaderGetter) Run ¶
func (getter *HeaderGetter) Run()
type Inventory ¶
type Inventory struct {
// contains filtered or unexported fields
}
func (*Inventory) Connected ¶
func (inv *Inventory) Connected() chan struct{}
Connected returns a channel that closes once an initial connection has been established.
func (*Inventory) GetRecentMerkleBlocks ¶
TODO Add headergetter function getting N most recent headers.
func (*Inventory) SendGetData ¶
func (inv *Inventory) SendGetData(vector messages.InventoryVector, addrHint string) error
func (*Inventory) ServeHTTP ¶
func (inv *Inventory) ServeHTTP(w http.ResponseWriter, r *http.Request)
func (*Inventory) UnspentTxOutputs ¶
UnspentTransactions returns a list of the current unspent transactions in the set Inventory is watching.
func (*Inventory) Unsubscribe ¶
func (inv *Inventory) Unsubscribe(d dispatcher)
func (*Inventory) UpdateTxOutputs ¶
UpdateTxOutputs updates the list of unspent transaction outputs Inventory is watching. It also alerts attached wallets about new transaction to aid their discovery process.
func (*Inventory) VerifyTransaction ¶
func (inv *Inventory) VerifyTransaction(tx *messages.Transaction) (bool, error)
type MerkleNode ¶
type MerkleNode struct {
Left, Right *MerkleNode
Hash []byte
// contains filtered or unexported fields
}
func NewMerkleTree ¶
func NewMerkleTree(count uint32, hashArray [][]byte, flags []byte) (*MerkleNode, error)
EmptyMerkleTree construct an empty merkle tree with count transactions in it. It returns the root of the tree.
func (*MerkleNode) MatchedTransactions ¶
func (n *MerkleNode) MatchedTransactions() [][]byte
type Transaction ¶
type Transaction struct {
// contains filtered or unexported fields
}
type TxOutput ¶
type TxOutput struct {
// contains filtered or unexported fields
}
func (*TxOutput) Fingerprint ¶
Fingerprint returns a unique identifier of the output.
type TxVersion ¶
type TxVersion struct { Hash []byte `json:"hash,omitempty"` Block *Block `json:"block,omitempty"` // Another duplicate of this version has been confirmed. InvalidatedBy []byte `json:"invalidated_by,omitempty"` // Only used for storing and loading tx. Data []byte `json:"data,omitempty"` // contains filtered or unexported fields }
func (*TxVersion) DeserializeTransaction ¶
func (*TxVersion) SerializeTransaction ¶
func (t *TxVersion) SerializeTransaction()