clean up unused DV code

This commit is contained in:
Tuna 2018-10-25 15:22:11 +07:00
parent 7c561e5117
commit 8d40a72155

View file

@ -142,7 +142,6 @@ type Fetcher struct {
queueChangeHook func(common.Hash, bool) // Method to call upon adding or deleting a block from the import queue
fetchingHook func([]common.Hash) // Method to call upon starting a block (eth/61) or header (eth/62) fetch
completingHook func([]common.Hash) // Method to call upon starting a block body fetch (eth/62)
doubleValidateHook func(*types.Block) error
signHook func(*types.Block) error
appendM2HeaderHook func(*types.Block) (*types.Block, error)
}
@ -674,13 +673,6 @@ func (f *Fetcher) insert(peer string, block *types.Block) {
f.dropPeer(peer)
return
}
// Invoke the dv hook to run double validation layer
if f.doubleValidateHook != nil {
if err := f.doubleValidateHook(block); err != nil {
log.Error("Double validation failed", "err", err, "Discard this block!")
return
}
}
// Run the actual import and log any issues
if _, err := f.insertChain(types.Blocks{block}); err != nil {
@ -756,11 +748,6 @@ func (f *Fetcher) forgetBlock(hash common.Hash) {
}
}
// Bind double validate hook before block imported into chain.
func (f *Fetcher) SetDoubleValidateHook(doubleValidateHook func(*types.Block) error) {
f.doubleValidateHook = doubleValidateHook
}
// Bind double validate hook before block imported into chain.
func (f *Fetcher) SetSignHook(signHook func(*types.Block) error) {
f.signHook = signHook