mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 18:32:23 +00:00
Merge branch 'master' of https://github.com/tomochain/tomochain into half-mn
This commit is contained in:
commit
4b1fa05415
9 changed files with 73 additions and 46 deletions
|
|
@ -479,7 +479,7 @@ func (c *Posv) YourTurn(chain consensus.ChainReader, parent *types.Header, signe
|
||||||
masternodes = masternodes[:len(masternodes)/2+1]
|
masternodes = masternodes[:len(masternodes)/2+1]
|
||||||
snap, err := c.GetSnapshot(chain, parent)
|
snap, err := c.GetSnapshot(chain, parent)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error("Failed when trying to commit new work", "err", err)
|
log.Warn("Failed when trying to commit new work", "err", err)
|
||||||
return 0, -1, -1, false, err
|
return 0, -1, -1, false, err
|
||||||
}
|
}
|
||||||
if len(masternodes) == 0 {
|
if len(masternodes) == 0 {
|
||||||
|
|
@ -500,7 +500,7 @@ func (c *Posv) YourTurn(chain consensus.ChainReader, parent *types.Header, signe
|
||||||
log.Info("Masternodes cycle info", "number of masternodes", len(masternodes), "previous", pre, "position", preIndex, "current", signer, "position", curIndex)
|
log.Info("Masternodes cycle info", "number of masternodes", len(masternodes), "previous", pre, "position", preIndex, "current", signer, "position", curIndex)
|
||||||
}
|
}
|
||||||
for i, s := range masternodes {
|
for i, s := range masternodes {
|
||||||
fmt.Printf("%d - %s\n", i, s.String())
|
log.Info("%d - %s\n", i, s.String())
|
||||||
}
|
}
|
||||||
if (preIndex+1)%len(masternodes) == curIndex {
|
if (preIndex+1)%len(masternodes) == curIndex {
|
||||||
return len(masternodes), preIndex, curIndex, true, nil
|
return len(masternodes), preIndex, curIndex, true, nil
|
||||||
|
|
|
||||||
|
|
@ -85,7 +85,7 @@ func CreateTransactionSign(chainConfig *params.ChainConfig, pool *core.TxPool, m
|
||||||
// Add tx signed to local tx pool.
|
// Add tx signed to local tx pool.
|
||||||
err = pool.AddLocal(txSigned)
|
err = pool.AddLocal(txSigned)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error("Fail to add tx sign to local pool.", "error", err, "number", block.NumberU64(), "hash", block.Hash().Hex(), "from", account.Address, "nonce", nonce)
|
log.Warn("Fail to add tx sign to local pool.", "error", err, "number", block.NumberU64(), "hash", block.Hash().Hex(), "from", account.Address, "nonce", nonce)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create secret tx.
|
// Create secret tx.
|
||||||
|
|
|
||||||
|
|
@ -120,6 +120,7 @@ func (p *StateProcessor) ProcessBlockNoValidator(cBlock *CalculatedBlock, stated
|
||||||
return nil, nil, 0, ErrStopPreparingBlock
|
return nil, nil, 0, ErrStopPreparingBlock
|
||||||
}
|
}
|
||||||
receipts[i] = receipt
|
receipts[i] = receipt
|
||||||
|
allLogs = append(allLogs, receipt.Logs...)
|
||||||
}
|
}
|
||||||
// Finalize the block, applying any consensus engine specific extras (e.g. block rewards)
|
// Finalize the block, applying any consensus engine specific extras (e.g. block rewards)
|
||||||
p.engine.Finalize(p.bc, header, statedb, block.Transactions(), block.Uncles(), receipts)
|
p.engine.Finalize(p.bc, header, statedb, block.Transactions(), block.Uncles(), receipts)
|
||||||
|
|
|
||||||
|
|
@ -1171,7 +1171,7 @@ func (pool *TxPool) demoteUnexecutables() {
|
||||||
if list.Len() > 0 && list.txs.Get(nonce) == nil {
|
if list.Len() > 0 && list.txs.Get(nonce) == nil {
|
||||||
for _, tx := range list.Cap(0) {
|
for _, tx := range list.Cap(0) {
|
||||||
hash := tx.Hash()
|
hash := tx.Hash()
|
||||||
log.Error("Demoting invalidated transaction", "hash", hash)
|
log.Warn("Demoting invalidated transaction", "hash", hash)
|
||||||
pool.enqueueTx(hash, tx)
|
pool.enqueueTx(hash, tx)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -355,7 +355,7 @@ func New(ctx *node.ServiceContext, config *Config) (*Ethereum, error) {
|
||||||
currentHeader := eth.blockchain.CurrentHeader()
|
currentHeader := eth.blockchain.CurrentHeader()
|
||||||
snap, err := c.GetSnapshot(eth.blockchain, currentHeader)
|
snap, err := c.GetSnapshot(eth.blockchain, currentHeader)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error("Can't get snapshot with current header ", "number", currentHeader.Number, "hash", currentHeader.Hash().Hex())
|
log.Error("Can't get snapshot with current header ", "number", currentHeader.Number, "hash", currentHeader.Hash().Hex(), "err", err)
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
if _, ok := snap.Signers[address]; ok {
|
if _, ok := snap.Signers[address]; ok {
|
||||||
|
|
|
||||||
|
|
@ -295,7 +295,7 @@ func (d *Downloader) UnregisterPeer(id string) error {
|
||||||
logger := log.New("peer", id)
|
logger := log.New("peer", id)
|
||||||
logger.Trace("Unregistering sync peer")
|
logger.Trace("Unregistering sync peer")
|
||||||
if err := d.peers.Unregister(id); err != nil {
|
if err := d.peers.Unregister(id); err != nil {
|
||||||
logger.Error("Failed to unregister sync peer", "err", err)
|
logger.Warn("Failed to unregister sync peer", "err", err)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
d.queue.Revoke(id)
|
d.queue.Revoke(id)
|
||||||
|
|
|
||||||
|
|
@ -205,7 +205,7 @@ func (pm *ProtocolManager) removePeer(id string) {
|
||||||
// Unregister the peer from the downloader and Ethereum peer set
|
// Unregister the peer from the downloader and Ethereum peer set
|
||||||
pm.downloader.UnregisterPeer(id)
|
pm.downloader.UnregisterPeer(id)
|
||||||
if err := pm.peers.Unregister(id); err != nil {
|
if err := pm.peers.Unregister(id); err != nil {
|
||||||
log.Error("Peer removal failed", "peer", id, "err", err)
|
log.Warn("Peer removal failed", "peer", id, "err", err)
|
||||||
}
|
}
|
||||||
// Hard disconnect at the networking layer
|
// Hard disconnect at the networking layer
|
||||||
if peer != nil {
|
if peer != nil {
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -499,7 +499,7 @@ func (self *worker) commitNewWork() {
|
||||||
c := self.engine.(*posv.Posv)
|
c := self.engine.(*posv.Posv)
|
||||||
len, preIndex, curIndex, ok, err := c.YourTurn(self.chain, parent.Header(),self.coinbase)
|
len, preIndex, curIndex, ok, err := c.YourTurn(self.chain, parent.Header(),self.coinbase)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error("Failed when trying to commit new work", "err", err)
|
log.Warn("Failed when trying to commit new work", "err", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if !ok {
|
if !ok {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue