Documentation ¶
Index ¶
- Variables
- func NewPool(bc chainDb) *pool
- type BCPool
- func (self *BCPool) AddBlock(block commonBlock)
- func (self *BCPool) CurrentChain() *forkedChain
- func (self *BCPool) CurrentModifyToChain(target *forkedChain, hashH *ledger.HashHeight) error
- func (self *BCPool) CurrentModifyToEmpty() error
- func (self *BCPool) LongerChain(minHeight uint64) []*forkedChain
- func (self *BCPool) LongestChain() *forkedChain
- type BlockPool
- type ByHeight
- type ByTailHeight
- type Chain
- type ChainReader
- type Debug
- type ForkChainError
- type ForkVersion
- type MockChain
- func (*MockChain) DeleteAccountBlocks(addr *types.Address, toHeight uint64) (map[types.Address][]*ledger.AccountBlock, error)
- func (*MockChain) DeleteSnapshotBlocksToHeight(toHeight uint64) ([]*ledger.SnapshotBlock, map[types.Address][]*ledger.AccountBlock, error)
- func (*MockChain) GetAccountBlockByHash(blockHash *types.Hash) (*ledger.AccountBlock, error)
- func (*MockChain) GetAccountBlockByHeight(addr *types.Address, height uint64) (*ledger.AccountBlock, error)
- func (*MockChain) GetFirstConfirmedAccountBlockBySbHeight(snapshotBlockHeight uint64, addr *types.Address) (*ledger.AccountBlock, error)
- func (*MockChain) GetLatestAccountBlock(addr *types.Address) (*ledger.AccountBlock, error)
- func (*MockChain) GetLatestSnapshotBlock() *ledger.SnapshotBlock
- func (*MockChain) GetSnapshotBlockByHash(hash *types.Hash) (*ledger.SnapshotBlock, error)
- func (*MockChain) GetSnapshotBlockByHeight(height uint64) (*ledger.SnapshotBlock, error)
- func (*MockChain) GetUnConfirmAccountBlocks(addr *types.Address) []*ledger.AccountBlock
- func (*MockChain) InsertAccountBlocks(vmAccountBlocks []*vm_context.VmAccountBlock) error
- func (*MockChain) InsertSnapshotBlock(snapshotBlock *ledger.SnapshotBlock) error
- type MockSyncer
- func (*MockSyncer) BroadcastAccountBlock(block *ledger.AccountBlock)
- func (*MockSyncer) BroadcastAccountBlocks(blocks []*ledger.AccountBlock)
- func (*MockSyncer) BroadcastSnapshotBlock(block *ledger.SnapshotBlock)
- func (*MockSyncer) BroadcastSnapshotBlocks(blocks []*ledger.SnapshotBlock)
- func (*MockSyncer) FetchAccountBlocks(start types.Hash, count uint64, address *types.Address)
- func (*MockSyncer) FetchAccountBlocksWithHeight(start types.Hash, count uint64, address *types.Address, sHeight uint64)
- func (*MockSyncer) FetchSnapshotBlocks(start types.Hash, count uint64)
- func (*MockSyncer) SubscribeAccountBlock(fn net.AccountblockCallback) (subId int)
- func (*MockSyncer) SubscribeSnapshotBlock(fn net.SnapshotBlockCallback) (subId int)
- func (*MockSyncer) SubscribeSyncStatus(fn net.SyncStateCallback) (subId int)
- func (*MockSyncer) SyncState() net.SyncState
- func (*MockSyncer) UnsubscribeAccountBlock(subId int)
- func (*MockSyncer) UnsubscribeSnapshotBlock(subId int)
- func (*MockSyncer) UnsubscribeSyncStatus(subId int)
- type Reader
- type SnapshotProducerWriter
- type Writer
Constants ¶
This section is empty.
Variables ¶
View Source
var ( GOMAXPROCS = runtime.NumCPU() ACCOUNT_PARALLEL = GOMAXPROCS )
Functions ¶
Types ¶
type BCPool ¶
type BCPool struct { Id string LIMIT_HEIGHT uint64 LIMIT_LONGEST_NUM uint64 // contains filtered or unexported fields }
func (*BCPool) CurrentChain ¶
func (self *BCPool) CurrentChain() *forkedChain
func (*BCPool) CurrentModifyToChain ¶
func (self *BCPool) CurrentModifyToChain(target *forkedChain, hashH *ledger.HashHeight) error
func (*BCPool) CurrentModifyToEmpty ¶
func (*BCPool) LongerChain ¶
func (*BCPool) LongestChain ¶
func (self *BCPool) LongestChain() *forkedChain
type BlockPool ¶
type BlockPool interface { Writer Reader SnapshotProducerWriter Debug Start() Stop() Init(s syncer, wt *wallet.Manager, snapshotV *verifier.SnapshotVerifier, accountV *verifier.AccountVerifier) Details(addr *types.Address, hash types.Hash) string }
type ByTailHeight ¶
type ByTailHeight []*snippetChain
func (ByTailHeight) Len ¶
func (a ByTailHeight) Len() int
func (ByTailHeight) Less ¶
func (a ByTailHeight) Less(i, j int) bool
func (ByTailHeight) Swap ¶
func (a ByTailHeight) Swap(i, j int)
type ChainReader ¶
type ChainReader interface { Head() commonBlock GetBlock(height uint64) commonBlock }
type Debug ¶
type Debug interface { Info(addr *types.Address) string Snapshot() map[string]interface{} SnapshotPendingNum() uint64 AccountPendingNum() *big.Int Account(addr types.Address) map[string]interface{} SnapshotChainDetail(chainId string) map[string]interface{} AccountChainDetail(addr types.Address, chainId string) map[string]interface{} }
type ForkChainError ¶
type ForkChainError struct {
What string
}
func (ForkChainError) Error ¶
func (e ForkChainError) Error() string
type ForkVersion ¶
type ForkVersion struct {
// contains filtered or unexported fields
}
func (*ForkVersion) Inc ¶
func (self *ForkVersion) Inc()
func (*ForkVersion) String ¶
func (self *ForkVersion) String() string
func (*ForkVersion) Val ¶
func (self *ForkVersion) Val() int
type MockChain ¶
type MockChain struct { }
func (*MockChain) DeleteAccountBlocks ¶
func (*MockChain) DeleteSnapshotBlocksToHeight ¶
func (*MockChain) DeleteSnapshotBlocksToHeight(toHeight uint64) ([]*ledger.SnapshotBlock, map[types.Address][]*ledger.AccountBlock, error)
func (*MockChain) GetAccountBlockByHash ¶
func (*MockChain) GetAccountBlockByHeight ¶
func (*MockChain) GetFirstConfirmedAccountBlockBySbHeight ¶
func (*MockChain) GetLatestAccountBlock ¶
func (*MockChain) GetLatestSnapshotBlock ¶
func (*MockChain) GetLatestSnapshotBlock() *ledger.SnapshotBlock
func (*MockChain) GetSnapshotBlockByHash ¶
func (*MockChain) GetSnapshotBlockByHeight ¶
func (*MockChain) GetSnapshotBlockByHeight(height uint64) (*ledger.SnapshotBlock, error)
func (*MockChain) GetUnConfirmAccountBlocks ¶
func (*MockChain) GetUnConfirmAccountBlocks(addr *types.Address) []*ledger.AccountBlock
func (*MockChain) InsertAccountBlocks ¶
func (*MockChain) InsertAccountBlocks(vmAccountBlocks []*vm_context.VmAccountBlock) error
func (*MockChain) InsertSnapshotBlock ¶
func (*MockChain) InsertSnapshotBlock(snapshotBlock *ledger.SnapshotBlock) error
type MockSyncer ¶
type MockSyncer struct { }
func (*MockSyncer) BroadcastAccountBlock ¶
func (*MockSyncer) BroadcastAccountBlock(block *ledger.AccountBlock)
func (*MockSyncer) BroadcastAccountBlocks ¶
func (*MockSyncer) BroadcastAccountBlocks(blocks []*ledger.AccountBlock)
func (*MockSyncer) BroadcastSnapshotBlock ¶
func (*MockSyncer) BroadcastSnapshotBlock(block *ledger.SnapshotBlock)
func (*MockSyncer) BroadcastSnapshotBlocks ¶
func (*MockSyncer) BroadcastSnapshotBlocks(blocks []*ledger.SnapshotBlock)
func (*MockSyncer) FetchAccountBlocks ¶
func (*MockSyncer) FetchAccountBlocksWithHeight ¶
func (*MockSyncer) FetchSnapshotBlocks ¶
func (*MockSyncer) FetchSnapshotBlocks(start types.Hash, count uint64)
func (*MockSyncer) SubscribeAccountBlock ¶
func (*MockSyncer) SubscribeAccountBlock(fn net.AccountblockCallback) (subId int)
func (*MockSyncer) SubscribeSnapshotBlock ¶
func (*MockSyncer) SubscribeSnapshotBlock(fn net.SnapshotBlockCallback) (subId int)
func (*MockSyncer) SubscribeSyncStatus ¶
func (*MockSyncer) SubscribeSyncStatus(fn net.SyncStateCallback) (subId int)
func (*MockSyncer) SyncState ¶
func (*MockSyncer) SyncState() net.SyncState
func (*MockSyncer) UnsubscribeAccountBlock ¶
func (*MockSyncer) UnsubscribeAccountBlock(subId int)
func (*MockSyncer) UnsubscribeSnapshotBlock ¶
func (*MockSyncer) UnsubscribeSnapshotBlock(subId int)
func (*MockSyncer) UnsubscribeSyncStatus ¶
func (*MockSyncer) UnsubscribeSyncStatus(subId int)
type SnapshotProducerWriter ¶
type Writer ¶
type Writer interface { // for normal account AddDirectAccountBlock(address types.Address, vmAccountBlock *vm_context.VmAccountBlock) error // for contract account AddDirectAccountBlocks(address types.Address, received *vm_context.VmAccountBlock, sendBlocks []*vm_context.VmAccountBlock) error }
Click to show internal directories.
Click to hide internal directories.