pull/131/head
Minh Doan 6 years ago
parent 2031ec09df
commit 074d468fe6
  1. 4
      consensus/consensus.go
  2. 4
      node/worker/worker.go

@ -299,6 +299,7 @@ func (consensus *Consensus) UpdatePublicKeys(pubKeys []kyber.Point) int {
return len(consensus.PublicKeys) return len(consensus.PublicKeys)
} }
// NewFaker returns a faker consensus.
func NewFaker() *Consensus { func NewFaker() *Consensus {
return &Consensus{} return &Consensus{}
} }
@ -386,11 +387,14 @@ func (consensus *Consensus) SealHash(header *types.Header) (hash common.Hash) {
return hash return hash
} }
// Seal is to seal final block.
func (consensus *Consensus) Seal(chain ChainReader, block *types.Block, results chan<- *types.Block, stop <-chan struct{}) error { func (consensus *Consensus) Seal(chain ChainReader, block *types.Block, results chan<- *types.Block, stop <-chan struct{}) error {
// TODO: implement final block sealing // TODO: implement final block sealing
return nil return nil
} }
// Prepare is to prepare ...
// TODO(RJ): fix it.
func (consensus *Consensus) Prepare(chain ChainReader, header *types.Header) error { func (consensus *Consensus) Prepare(chain ChainReader, header *types.Header) error {
// TODO: implement prepare method // TODO: implement prepare method
return nil return nil

@ -1,10 +1,11 @@
package worker package worker
import ( import (
"github.com/harmony-one/harmony/log"
"math/big" "math/big"
"time" "time"
"github.com/harmony-one/harmony/log"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/params" "github.com/ethereum/go-ethereum/params"
"github.com/harmony-one/harmony/consensus" "github.com/harmony-one/harmony/consensus"
@ -38,6 +39,7 @@ type Worker struct {
gasCeil uint64 gasCeil uint64
} }
// SelectTransactionsForNewBlock selects transactions for new block.
func (w *Worker) SelectTransactionsForNewBlock(txs types.Transactions, maxNumTxs int) (types.Transactions, types.Transactions, types.Transactions) { func (w *Worker) SelectTransactionsForNewBlock(txs types.Transactions, maxNumTxs int) (types.Transactions, types.Transactions, types.Transactions) {
if w.current.gasPool == nil { if w.current.gasPool == nil {
w.current.gasPool = new(core.GasPool).AddGas(w.current.header.GasLimit) w.current.gasPool = new(core.GasPool).AddGas(w.current.header.GasLimit)

Loading…
Cancel
Save