Documentation ¶
Index ¶
- Constants
- Variables
- type NonceSortedTxs
- func (nst *NonceSortedTxs) CleanIfEmpty() (isEmpty bool)
- func (nst *NonceSortedTxs) Drop(hashToDrop common.Uint256) (*transaction.Transaction, bool, error)
- func (nst *NonceSortedTxs) Dump()
- func (nst *NonceSortedTxs) Empty() bool
- func (nst *NonceSortedTxs) ExistTx(hash common.Uint256) bool
- func (nst *NonceSortedTxs) Full() bool
- func (nst *NonceSortedTxs) GetAllTransactions() []*transaction.Transaction
- func (nst *NonceSortedTxs) GetByNonce(nonce uint64) (*transaction.Transaction, error)
- func (nst *NonceSortedTxs) GetLatestNonce() (uint64, error)
- func (nst *NonceSortedTxs) GetLatestTxn() (*transaction.Transaction, error)
- func (nst *NonceSortedTxs) Len() int
- func (nst *NonceSortedTxs) PopN(n uint16) ([]*transaction.Transaction, error)
- func (nst *NonceSortedTxs) Push(tx *transaction.Transaction) error
- func (nst *NonceSortedTxs) Replace(tx *transaction.Transaction) error
- func (nst *NonceSortedTxs) Seek() (*transaction.Transaction, error)
- type TxPooler
- type TxnPool
- func (tp *TxnPool) AppendTxnPool(txn *transaction.Transaction) error
- func (tp *TxnPool) CleanBlockValidationState(txns []*transaction.Transaction) error
- func (tp *TxnPool) CleanSubmittedTransactions(txns []*transaction.Transaction) error
- func (tp *TxnPool) DropTxns()
- func (tp *TxnPool) GetAddressList() map[common.Uint160]int
- func (tp *TxnPool) GetAllTransactionLists() map[common.Uint160][]*transaction.Transaction
- func (tp *TxnPool) GetAllTransactions() []*transaction.Transaction
- func (tp *TxnPool) GetAllTransactionsBySender(programHash common.Uint160) []*transaction.Transaction
- func (tp *TxnPool) GetNonceByTxnPool(addr common.Uint160) (uint64, error)
- func (tp *TxnPool) GetSubscribers(topic string) []string
- func (tp *TxnPool) GetSubscribersWithMeta(topic string) map[string]string
- func (tp *TxnPool) GetSyncTime() int64
- func (tp *TxnPool) GetTransaction(hash common.Uint256) *transaction.Transaction
- func (tp *TxnPool) GetTwtAddrNonce() map[common.Uint160]uint64
- func (tp *TxnPool) GetTwtFingerprintAndCount() ([]byte, int)
- func (tp *TxnPool) GetTwtTxnAfter(earliest int64, reqAddrNonce map[common.Uint160]uint64) ([]*pb.Transaction, error)
- func (tp *TxnPool) GetTxnByCount(num int) (map[common.Uint256]*transaction.Transaction, error)
- func (tp *TxnPool) GetTxnByHash(hash common.Uint256) *transaction.Transaction
- func (tp *TxnPool) GetTxnByShortHash(shortHash []byte) *transaction.Transaction
- func (tp *TxnPool) RemoveExpiredTwt() (expiredTwt []*txnWithTime)
- func (tp *TxnPool) SetSyncTime()
Constants ¶
View Source
const MaxSyncTxnInterval = 16000 // in milliseconds
sync txn
Variables ¶
View Source
var ( ErrNonceSortedTxsEmpty = errors.New("empty NonceSortedTxs") ErrNonceOutofRange = errors.New("nonce is not in range") )
Functions ¶
This section is empty.
Types ¶
type NonceSortedTxs ¶
type NonceSortedTxs struct {
// contains filtered or unexported fields
}
NonceSortedTxs store the txns that can be added into blockchain. The txns are sorted by nonce in Increasing order.
func NewNonceSortedTxs ¶
func NewNonceSortedTxs(acc common.Uint160, cap int) *NonceSortedTxs
NewNonceSortedTxs return a new NonceSortedTxs instance
func (*NonceSortedTxs) CleanIfEmpty ¶
func (nst *NonceSortedTxs) CleanIfEmpty() (isEmpty bool)
func (*NonceSortedTxs) Drop ¶
func (nst *NonceSortedTxs) Drop(hashToDrop common.Uint256) (*transaction.Transaction, bool, error)
func (*NonceSortedTxs) Dump ¶
func (nst *NonceSortedTxs) Dump()
func (*NonceSortedTxs) Empty ¶
func (nst *NonceSortedTxs) Empty() bool
func (*NonceSortedTxs) Full ¶
func (nst *NonceSortedTxs) Full() bool
func (*NonceSortedTxs) GetAllTransactions ¶
func (nst *NonceSortedTxs) GetAllTransactions() []*transaction.Transaction
func (*NonceSortedTxs) GetByNonce ¶
func (nst *NonceSortedTxs) GetByNonce(nonce uint64) (*transaction.Transaction, error)
func (*NonceSortedTxs) GetLatestNonce ¶
func (nst *NonceSortedTxs) GetLatestNonce() (uint64, error)
func (*NonceSortedTxs) GetLatestTxn ¶
func (nst *NonceSortedTxs) GetLatestTxn() (*transaction.Transaction, error)
func (*NonceSortedTxs) Len ¶
func (nst *NonceSortedTxs) Len() int
func (*NonceSortedTxs) PopN ¶
func (nst *NonceSortedTxs) PopN(n uint16) ([]*transaction.Transaction, error)
func (*NonceSortedTxs) Push ¶
func (nst *NonceSortedTxs) Push(tx *transaction.Transaction) error
func (*NonceSortedTxs) Replace ¶
func (nst *NonceSortedTxs) Replace(tx *transaction.Transaction) error
func (*NonceSortedTxs) Seek ¶
func (nst *NonceSortedTxs) Seek() (*transaction.Transaction, error)
type TxPooler ¶
type TxPooler interface { GetTxnByCount(num int) (map[common.Uint256]*transaction.Transaction, error) GetTransaction(hash common.Uint256) *transaction.Transaction AppendTxnPool(txn *transaction.Transaction) error CleanSubmittedTransactions(txns []*transaction.Transaction) error }
type TxnPool ¶
type TxnPool struct { TxLists sync.Map // NonceSortedTxs instance to store user's account. TxMap sync.Map TxShortHashMap sync.Map NanoPayTxs sync.Map // tx with nano pay type. sync.RWMutex // contains filtered or unexported fields }
TxnPool is a list of txns that need to by add to ledger sent by user.
func (*TxnPool) AppendTxnPool ¶
func (tp *TxnPool) AppendTxnPool(txn *transaction.Transaction) error
func (*TxnPool) CleanBlockValidationState ¶
func (tp *TxnPool) CleanBlockValidationState(txns []*transaction.Transaction) error
func (*TxnPool) CleanSubmittedTransactions ¶
func (tp *TxnPool) CleanSubmittedTransactions(txns []*transaction.Transaction) error
func (*TxnPool) GetAllTransactionLists ¶
func (tp *TxnPool) GetAllTransactionLists() map[common.Uint160][]*transaction.Transaction
func (*TxnPool) GetAllTransactions ¶
func (tp *TxnPool) GetAllTransactions() []*transaction.Transaction
func (*TxnPool) GetAllTransactionsBySender ¶
func (tp *TxnPool) GetAllTransactionsBySender(programHash common.Uint160) []*transaction.Transaction
func (*TxnPool) GetNonceByTxnPool ¶
func (*TxnPool) GetSubscribers ¶
func (*TxnPool) GetSubscribersWithMeta ¶
func (*TxnPool) GetSyncTime ¶ added in v2.2.0
set last sync time
func (*TxnPool) GetTransaction ¶
func (tp *TxnPool) GetTransaction(hash common.Uint256) *transaction.Transaction
func (*TxnPool) GetTwtAddrNonce ¶ added in v2.2.0
get address and nonce from txn with time map
func (*TxnPool) GetTwtFingerprintAndCount ¶ added in v2.2.0
get xorHashOfTxnTime
func (*TxnPool) GetTwtTxnAfter ¶ added in v2.2.0
func (tp *TxnPool) GetTwtTxnAfter(earliest int64, reqAddrNonce map[common.Uint160]uint64) ([]*pb.Transaction, error)
get transactions later than specific time from txn with time map earliest is in milli-second
func (*TxnPool) GetTxnByCount ¶
func (tp *TxnPool) GetTxnByCount(num int) (map[common.Uint256]*transaction.Transaction, error)
func (*TxnPool) GetTxnByHash ¶
func (tp *TxnPool) GetTxnByHash(hash common.Uint256) *transaction.Transaction
func (*TxnPool) GetTxnByShortHash ¶
func (tp *TxnPool) GetTxnByShortHash(shortHash []byte) *transaction.Transaction
func (*TxnPool) RemoveExpiredTwt ¶ added in v2.2.0
func (tp *TxnPool) RemoveExpiredTwt() (expiredTwt []*txnWithTime)
romve expired items from txn with time list
Click to show internal directories.
Click to hide internal directories.