mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 02:42:27 +00:00
remove fmt print
This commit is contained in:
parent
177750f1e7
commit
b042f3ca81
3 changed files with 12 additions and 19 deletions
|
|
@ -859,13 +859,11 @@ func (c *Posv) Finalize(chain consensus.ChainReader, header *types.Header, state
|
||||||
number := header.Number.Uint64()
|
number := header.Number.Uint64()
|
||||||
rCheckpoint := chain.Config().Posv.RewardCheckpoint
|
rCheckpoint := chain.Config().Posv.RewardCheckpoint
|
||||||
|
|
||||||
start := time.Now()
|
|
||||||
_ = c.cacheData(txs, receipts)
|
_ = c.cacheData(txs, receipts)
|
||||||
fmt.Println("Time processed txs", len(txs), "time", common.PrettyDuration(time.Since(start)))
|
|
||||||
|
|
||||||
if c.HookReward != nil && number%rCheckpoint == 0 {
|
if c.HookReward != nil && number%rCheckpoint == 0 {
|
||||||
if !c.EnableCache && uint64(c.BlockSigners.Len()) >= (rCheckpoint*3) {
|
if !c.EnableCache && uint64(c.BlockSigners.Len()) >= (rCheckpoint*3) {
|
||||||
fmt.Println("EnableCache true c.BlockSigners.Len()", c.BlockSigners.Len())
|
log.Debug("EnableCache true c.BlockSigners.Len()", c.BlockSigners.Len())
|
||||||
c.EnableCache = true
|
c.EnableCache = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1060,7 +1058,6 @@ func (c *Posv) cacheData(txs []*types.Transaction, receipts []*types.Receipt) er
|
||||||
}
|
}
|
||||||
|
|
||||||
if b == types.ReceiptStatusFailed {
|
if b == types.ReceiptStatusFailed {
|
||||||
fmt.Println("Tx receipt status false", tx.Hash().Hex())
|
|
||||||
wg.Done()
|
wg.Done()
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
@ -1081,7 +1078,7 @@ func (c *Posv) cacheData(txs []*types.Transaction, receipts []*types.Receipt) er
|
||||||
vote.Masternode = *addr
|
vote.Masternode = *addr
|
||||||
vote.Voter = *tx.From()
|
vote.Voter = *tx.From()
|
||||||
|
|
||||||
fmt.Println("Remove from Votes cache", vote.Masternode.String(), vote.Voter.String())
|
log.Debug("Remove from Votes cache", vote.Masternode.String(), vote.Voter.String())
|
||||||
c.Votes.Remove(vote)
|
c.Votes.Remove(vote)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -396,7 +396,6 @@ func GetRewardForCheckpoint(c *posv.Posv, chain consensus.ChainReader, blockSign
|
||||||
|
|
||||||
wg.Wait()
|
wg.Wait()
|
||||||
}
|
}
|
||||||
fmt.Println("totalSigner", *totalSigner)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Info("Calculate reward at checkpoint", "startBlock", startBlockNumber, "endBlock", endBlockNumber)
|
log.Info("Calculate reward at checkpoint", "startBlock", startBlockNumber, "endBlock", endBlockNumber)
|
||||||
|
|
@ -491,7 +490,7 @@ func GetRewardBalancesRate(c *posv.Posv, foudationWalletAddr common.Address, mas
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Crit("Fail to get vote capacity", "error", err)
|
log.Crit("Fail to get vote capacity", "error", err)
|
||||||
}
|
}
|
||||||
fmt.Println("Add to Votes cache", vote.Masternode.String(), vote.Voter.String(), voterCap.String())
|
log.Debug("Add to Votes cache", vote.Masternode.String(), vote.Voter.String(), voterCap.String())
|
||||||
c.Votes.Add(vote, voterCap)
|
c.Votes.Add(vote, voterCap)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -279,8 +279,7 @@ func New(ctx *node.ServiceContext, config *Config) (*Ethereum, error) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// log.Debug("Time Calculated HookPenalty ", "block", blockNumberEpoc, "time", common.PrettyDuration(time.Since(start)))
|
log.Debug("Time Calculated HookPenalty ", "block", blockNumberEpoc, "time", common.PrettyDuration(time.Since(start)))
|
||||||
fmt.Println("Time Calculated HookPenalty ", "block", blockNumberEpoc, "time", common.PrettyDuration(time.Since(start)))
|
|
||||||
return penSigners, nil
|
return penSigners, nil
|
||||||
}
|
}
|
||||||
return []common.Address{}, nil
|
return []common.Address{}, nil
|
||||||
|
|
@ -309,8 +308,7 @@ func New(ctx *node.ServiceContext, config *Config) (*Ethereum, error) {
|
||||||
|
|
||||||
totalSigner := new(uint64)
|
totalSigner := new(uint64)
|
||||||
signers, err := contracts.GetRewardForCheckpoint(c, chain, addr, number, rCheckpoint, client, totalSigner)
|
signers, err := contracts.GetRewardForCheckpoint(c, chain, addr, number, rCheckpoint, client, totalSigner)
|
||||||
// signers, err := contracts.GetRewardForCheckpoint(chain, addr, number, rCheckpoint, client, totalSigner)
|
log.Debug("Time Get Signers", "block", header.Number.Uint64(), "time", common.PrettyDuration(time.Since(start)))
|
||||||
fmt.Println("Time Get Signers", "block", header.Number.Uint64(), "time", common.PrettyDuration(time.Since(start)))
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Crit("Fail to get signers for reward checkpoint", "error", err)
|
log.Crit("Fail to get signers for reward checkpoint", "error", err)
|
||||||
}
|
}
|
||||||
|
|
@ -336,8 +334,7 @@ func New(ctx *node.ServiceContext, config *Config) (*Ethereum, error) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
rewards["rewards"] = voterResults
|
rewards["rewards"] = voterResults
|
||||||
// log.Debug("Time Calculated HookReward ", "block", header.Number.Uint64(), "time", common.PrettyDuration(time.Since(start)))
|
log.Debug("Time Calculated HookReward ", "block", header.Number.Uint64(), "time", common.PrettyDuration(time.Since(start)))
|
||||||
fmt.Println("Time Calculated HookReward ", "block", header.Number.Uint64(), "time", common.PrettyDuration(time.Since(start)))
|
|
||||||
}
|
}
|
||||||
return nil, rewards
|
return nil, rewards
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue