OSDN Git Service

Merge pull request #576 from Bytom/config
authorYongfeng LI <wliyongfeng@gmail.com>
Tue, 10 Apr 2018 11:03:51 +0000 (19:03 +0800)
committerGitHub <noreply@github.com>
Tue, 10 Apr 2018 11:03:51 +0000 (19:03 +0800)
remove useless configuration

config/genesis.go
consensus/general.go
mining/miningpool/minepool.go

index b4ad165..4a7191d 100644 (file)
@@ -53,8 +53,8 @@ func GenerateGenesisBlock() *types.Block {
                BlockHeader: types.BlockHeader{
                        Version:   1,
                        Height:    0,
-                       Nonce:     4216221,
-                       Timestamp: 1516788453,
+                       Nonce:     4216236,
+                       Timestamp: 1523352600,
                        BlockCommitment: types.BlockCommitment{
                                TransactionsMerkleRoot: merkleRoot,
                                TransactionStatusHash:  txStatusHash,
index afde669..f18a0b3 100644 (file)
@@ -15,12 +15,12 @@ const (
        //config parameter for coinbase reward
        CoinbasePendingBlockNumber = uint64(6)
        subsidyReductionInterval   = uint64(560640)
-       baseSubsidy                = uint64(624000000000)
+       baseSubsidy                = uint64(41250000000)
        InitialBlockSubsidy        = uint64(1470000000000000000)
 
        // config for pow mining
        PowMinBits            = uint64(2305843009213861724)
-       BlocksPerRetarget     = uint64(1024)
+       BlocksPerRetarget     = uint64(128)
        TargetSecondsPerBlock = uint64(60)
        SeedPerRetarget       = uint64(128)
 
index 2f23c5d..823a515 100644 (file)
@@ -59,7 +59,7 @@ func (m *MiningPool) blockUpdater() {
 
                case submitMsg := <-m.submitCh:
                        err := m.submitWork(submitMsg.blockHeader)
-                       if err != nil {
+                       if err == nil {
                                m.generateBlock()
                        }
                        submitMsg.reply <- err
@@ -116,9 +116,8 @@ func (m *MiningPool) submitWork(bh *types.BlockHeader) error {
        if err != nil {
                return err
        }
-
        if isOrphan {
-               log.Warning("SubmitWork is orphan")
+               return errors.New("submit result is orphan")
        }
 
        blockHash := bh.Hash()