Documentation ¶
Index ¶
- Constants
- func CheckMerkleBlock(m msg.MerkleBlock) ([]*common.Uint256, error)
- func NewMerkleBlock(txs []*types.Transaction, filter *Filter) (*msg.MerkleBlock, []uint32)
- type Filter
- func (f *Filter) Add(data []byte) error
- func (f *Filter) Clear()
- func (f *Filter) Filter() TxFilter
- func (f *Filter) IsLoaded() bool
- func (f *Filter) Load(filter *msg.TxFilterLoad) error
- func (f *Filter) MatchConfirmed(tx *types.Transaction) bool
- func (f *Filter) MatchUnconfirmed(tx *types.Transaction) bool
- type TxFilter
Constants ¶
View Source
const ( // FTBloom indicates the TxFilter's Filter is a bloom filter. FTBloom uint8 = iota // FTDPOS indicates the TxFilter's Filter is a DPOS filter. FTDPOS )
Variables ¶
This section is empty.
Functions ¶
func CheckMerkleBlock ¶
func CheckMerkleBlock(m msg.MerkleBlock) ([]*common.Uint256, error)
take in a merkle block, parse through it, and return txids indicated If there's any problem return an error. Checks self-consistency only. doing it with a stack instead of recursion. Because... OK I don't know why I'm just not in to recursion OK?
func NewMerkleBlock ¶
func NewMerkleBlock(txs []*types.Transaction, filter *Filter) (*msg.MerkleBlock, []uint32)
NewMerkleBlock returns a new *MerkleBlock
Types ¶
type Filter ¶
type Filter struct {
// contains filtered or unexported fields
}
func (*Filter) MatchConfirmed ¶
func (f *Filter) MatchConfirmed(tx *types.Transaction) bool
func (*Filter) MatchUnconfirmed ¶
func (f *Filter) MatchUnconfirmed(tx *types.Transaction) bool
type TxFilter ¶
type TxFilter interface { // Load loads the transaction filter. Load(filter []byte) error // Add adds new data into filter. Add(data []byte) error // MatchConfirmed returns if a confirmed (packed into a block) transaction // matches the filter. MatchConfirmed(tx *types.Transaction) bool // MatchUnconfirmed returns if a unconfirmed (not packed into a block yet) // transaction matches the filter. MatchUnconfirmed(tx *types.Transaction) bool }
TxFilter indicates the methods a transaction filter should implement.
Click to show internal directories.
Click to hide internal directories.