miner: support disabling empty blockprecommits form the Go API (#20736)
* cmd, miner: add noempty-precommit flag * cmd, miner: get rid of external flag * miner: change bool to atomic int * miner: fix tiny typo Co-authored-by: Péter Szilágyi <peterke@gmail.com>
This commit is contained in:
@ -183,6 +183,23 @@ func (miner *Miner) SetEtherbase(addr common.Address) {
|
||||
miner.worker.setEtherbase(addr)
|
||||
}
|
||||
|
||||
// EnablePreseal turns on the preseal mining feature. It's enabled by default.
|
||||
// Note this function shouldn't be exposed to API, it's unnecessary for users
|
||||
// (miners) to actually know the underlying detail. It's only for outside project
|
||||
// which uses this library.
|
||||
func (miner *Miner) EnablePreseal() {
|
||||
miner.worker.enablePreseal()
|
||||
}
|
||||
|
||||
// DisablePreseal turns off the preseal mining feature. It's necessary for some
|
||||
// fake consensus engine which can seal blocks instantaneously.
|
||||
// Note this function shouldn't be exposed to API, it's unnecessary for users
|
||||
// (miners) to actually know the underlying detail. It's only for outside project
|
||||
// which uses this library.
|
||||
func (miner *Miner) DisablePreseal() {
|
||||
miner.worker.disablePreseal()
|
||||
}
|
||||
|
||||
// SubscribePendingLogs starts delivering logs from pending transactions
|
||||
// to the given channel.
|
||||
func (self *Miner) SubscribePendingLogs(ch chan<- []*types.Log) event.Subscription {
|
||||
|
Reference in New Issue
Block a user