chain *protocol.Chain
accountManager *account.Manager
txPool *protocol.TxPool
- Preprocessors []Preprocessor
+ preprocessors []Preprocessor
started bool
quit chan struct{}
eventDispatcher *event.Dispatcher
packageTxs = append(packageTxs, txDesc.Tx)
}
- for i, p := range b.Preprocessors {
+ for i, p := range b.preprocessors {
txs, err := p.BeforeProposalBlock(packageTxs)
if err != nil {
log.WithFields(log.Fields{"module": logModule, "index": i, "error": err}).Error("failed on sub protocol txs package")
chain: c,
accountManager: accountManager,
txPool: txPool,
- Preprocessors: preprocessors,
+ preprocessors: preprocessors,
eventDispatcher: dispatcher,
}
}
for _, p := range c.subProtocols {
if err := p.ApplyBlock(block); err != nil {
- return errors.Wrap(err, "sub protocol connect block")
+ return errors.Wrap(err, p.Name(), "sub protocol connect block")
}
}
for _, p := range c.subProtocols {
if err := p.DetachBlock(b); err != nil {
- return errors.Wrap(err, "sub protocol detach block")
+ return errors.Wrap(err, p.Name(), "sub protocol detach block")
}
}
for _, p := range c.subProtocols {
if err := p.ApplyBlock(b); err != nil {
- return errors.Wrap(err, "sub protocol attach block")
+ return errors.Wrap(err, p.Name(), "sub protocol attach block")
}
}
"github.com/vapor/protocol/bc/types"
)
-// startHeight mov protocol startup height.
-const startHeight = 0
+const (
+ name = "MOV"
+ // startHeight mov protocol startup height.
+ startHeight = 0
+)
type combination interface {
ApplyBlock(block *types.Block) error
}
func (m MOV) Name() string {
- return "MOV"
+ return name
}
func (m MOV) ValidateBlock(block *bc.Block) error {
return nil
}
-func (m MOV) Status() (uint64, *bc.Hash){
- return 0,nil
+func (m MOV) Status() (uint64, *bc.Hash) {
+ return 0, nil
}
func (m MOV) SyncStatus() error {