remove delay when mine new block

This commit is contained in:
parmarrushabh 2018-11-03 17:12:18 +05:30
parent c6c993a1f1
commit 1857fe3991
4 changed files with 12 additions and 10 deletions

View file

@ -24,19 +24,19 @@ import (
"os" "os"
"reflect" "reflect"
"unicode" "unicode"
"strings"
"gopkg.in/urfave/cli.v1" "gopkg.in/urfave/cli.v1"
"github.com/ethereum/go-ethereum/cmd/utils" "github.com/ethereum/go-ethereum/cmd/utils"
"github.com/ethereum/go-ethereum/dashboard" "github.com/ethereum/go-ethereum/dashboard"
"github.com/ethereum/go-ethereum/eth" "github.com/ethereum/go-ethereum/eth"
"github.com/ethereum/go-ethereum/internal/debug" "github.com/ethereum/go-ethereum/internal/debug"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/node" "github.com/ethereum/go-ethereum/node"
"github.com/ethereum/go-ethereum/params" "github.com/ethereum/go-ethereum/params"
whisper "github.com/ethereum/go-ethereum/whisper/whisperv6" whisper "github.com/ethereum/go-ethereum/whisper/whisperv6"
"github.com/naoina/toml" "github.com/naoina/toml"
"strings" "
"github.com/ethereum/go-ethereum/log"
) )
var ( var (

View file

@ -23,10 +23,11 @@ import (
"io" "io"
"math/big" "math/big"
mrand "math/rand" mrand "math/rand"
"os"
"sort"
"sync" "sync"
"sync/atomic" "sync/atomic"
"time" "time"
"sort"
"github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
@ -1203,9 +1204,10 @@ func (bc *BlockChain) insertChain(chain types.Blocks) (int, []interface{}, []*ty
err := bc.UpdateM1() err := bc.UpdateM1()
if err != nil { if err != nil {
if err == ErrNotXDPoS { if err == ErrNotXDPoS {
log.Crit("Error when update M1 ", "err", err) log.Error("Stopping node", "err", err)
os.Exit(1)
} else { } else {
log.Error("Error when update M1 ", "err", err) log.Error("Error when update masternodes set. Keep the current masternodes set for the next epoch.", "err", err)
} }
} }
} }
@ -1400,7 +1402,7 @@ func (bc *BlockChain) PostChainEvents(events []interface{}, logs []*types.Log) {
} }
func (bc *BlockChain) update() { func (bc *BlockChain) update() {
futureTimer := time.NewTicker(5 * time.Second) futureTimer := time.NewTicker(10 * time.Millisecond)
defer futureTimer.Stop() defer futureTimer.Stop()
for { for {
select { select {

View file

@ -1221,9 +1221,9 @@ func submitTransaction(ctx context.Context, b Backend, tx *types.Transaction) (c
return common.Hash{}, err return common.Hash{}, err
} }
addr := crypto.CreateAddress(from, tx.Nonce()) addr := crypto.CreateAddress(from, tx.Nonce())
log.Info("Submitted contract creation", "fullhash", tx.Hash().Hex(), "contract", addr.Hex()) log.Trace("Submitted contract creation", "fullhash", tx.Hash().Hex(), "contract", addr.Hex())
} else { } else {
log.Info("Submitted transaction", "fullhash", tx.Hash().Hex(), "recipient", tx.To()) log.Trace("Submitted transaction", "fullhash", tx.Hash().Hex(), "recipient", tx.To())
} }
return tx.Hash(), nil return tx.Hash(), nil
} }