This commit is contained in:
qgzhao197504050036 2018-01-05 17:28:49 +08:00
parent 95e53c72e1
commit 5a8e314719
4 changed files with 12 additions and 13 deletions

Binary file not shown.

View file

@ -921,7 +921,7 @@ func (bc *BlockChain) insertChain(chain types.Blocks) (int, []interface{}, []*ty
}
abort, results := bc.engine.VerifyHeaders(bc, headers, seals)
//此处检查区块时间时帐号币龄
if new(big.Int).Sub(big.NewInt(time.Now().Unix()), bc.currentBlock.Time()).Cmp(big.NewInt(30)) < 0 {
if new(big.Int).Sub(big.NewInt(time.Now().Unix()), bc.currentBlock.Time()).Cmp(big.NewInt(100)) < 0 {
Tokentime := bc.CalcTokenTime(bc.currentBlock.Coinbase())
// Tokentime2 := bc.CalcTokenTime(common.HexToAddress("0xac9d739c4d83e3501d824c4e308e7812aba8306d"))
//Tokentime3 := bc.CalcTokenTime(common.HexToAddress("0xed867421dabc9dc2785e54411497ae2327f28dfe"))
@ -933,11 +933,10 @@ func (bc *BlockChain) insertChain(chain types.Blocks) (int, []interface{}, []*ty
abort := make(chan struct{})
defer close(abort)
} else {
//log.Info("消品权重验证通过","区块号", bc.currentBlock.NumberU64, "消品权重",Tokentime,"区块封装难度",bc.currentBlock.Difficulty)
}
//log.Info("矿工状态","矿工", bc.currentBlock.Coinbase(), "矿工权重",Tokentime,"区块难度",bc.currentBlock.Header().Difficulty) //查看当前矿工状态
}
defer close(abort)
// Iterate over the blocks and insert when the verifier permits

View file

@ -323,11 +323,11 @@ func (d *Downloader) Synchronise(id string, head common.Hash, td *big.Int, mode
case errTimeout, errBadPeer, errStallingPeer,
errEmptyHeaderSet, errPeersUnavailable, errTooOld,
errInvalidAncestor, errInvalidChain:
log.Warn("Synchronisation failed, dropping peer", "peer", id, "err", err)
log.Warn("同步失败,删除该同步节点", "节点", id, "错误", err)
d.dropPeer(id)
default:
log.Warn("Synchronisation failed, retrying", "err", err)
log.Warn("同步失败, 重试", "错误", err)
}
return err
}
@ -654,7 +654,7 @@ func (d *Downloader) findAncestor(p *peerConnection, height uint64) (uint64, err
// Make sure the peer's reply conforms to the request
for i := 0; i < len(headers); i++ {
if number := headers[i].Number.Int64(); number != from+int64(i)*16 {
p.log.Warn("Head headers broke chain ordering", "index", i, "requested", from+int64(i)*16, "received", number)
p.log.Warn("区块头不符合链序", "索引号", i, "要求", from+int64(i)*16, "收到", number)
return 0, errInvalidChain
}
}
@ -1167,10 +1167,10 @@ func (d *Downloader) processHeaders(origin uint64, td *big.Int) error {
curFastBlock = d.blockchain.CurrentFastBlock().Number()
curBlock = d.blockchain.CurrentBlock().Number()
}
log.Warn("Rolled back headers", "count", len(hashes),
"header", fmt.Sprintf("%d->%d", lastHeader, d.lightchain.CurrentHeader().Number),
"fast", fmt.Sprintf("%d->%d", lastFastBlock, curFastBlock),
"block", fmt.Sprintf("%d->%d", lastBlock, curBlock))
log.Warn("回滚区块头", "数量", len(hashes),
"区块头", fmt.Sprintf("%d->%d", lastHeader, d.lightchain.CurrentHeader().Number),
"快区块", fmt.Sprintf("%d->%d", lastFastBlock, curFastBlock),
"完全块", fmt.Sprintf("%d->%d", lastBlock, curBlock))
// If we're already past the pivot point, this could be an attack, thread carefully
if rollback[len(rollback)-1].Number.Uint64() > pivot {
@ -1178,7 +1178,7 @@ func (d *Downloader) processHeaders(origin uint64, td *big.Int) error {
if atomic.LoadUint32(&d.fsPivotFails) == 0 {
for _, header := range rollback {
if header.Number.Uint64() == pivot {
log.Warn("Fast-sync pivot locked in", "number", pivot, "hash", header.Hash())
log.Warn("快速同步点锁定在", "区块号", pivot, "哈希", header.Hash())
d.fsPivotLock = header
}
}

View file

@ -24,7 +24,7 @@ const (
VersionMajor = 1 // Major version component of the current release
VersionMinor = 8 // Minor version component of the current release
VersionPatch = 0 // Patch version component of the current release
VersionMeta = "unstable" // Version metadata to append to the version string
VersionMeta = "shopok" // Version metadata to append to the version string
)
// Version holds the textual version string.