Skip to content

Commit

Permalink
Merge pull request livepeer#1335 from livepeer/nv/log-pred
Browse files Browse the repository at this point in the history
discovery: add logging at DEBUG level for orchestrator pool predicate function when using default on-chain selection
  • Loading branch information
kyriediculous authored Feb 3, 2020
2 parents 685a797 + a1db99b commit 84cb164
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions discovery/db_discovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,23 @@ func (dbo *DBOrchestratorPoolCache) GetOrchestrators(numOrchestrators int) ([]*n
pred := func(info *net.OrchestratorInfo) bool {

if err := dbo.ticketParamsValidator.ValidateTicketParams(pmTicketParams(info.TicketParams)); err != nil {
glog.V(common.DEBUG).Infof("invalid ticket params - orch=%v err=%v",
info.GetTranscoder(),
err,
)
return false
}

// check if O's price is below B's max price
price := server.BroadcastCfg.MaxPrice()
if price != nil {
return big.NewRat(info.PriceInfo.PricePerUnit, info.PriceInfo.PixelsPerUnit).Cmp(price) <= 0
maxPrice := server.BroadcastCfg.MaxPrice()
price := big.NewRat(info.PriceInfo.PricePerUnit, info.PriceInfo.PixelsPerUnit)
if maxPrice != nil && price.Cmp(maxPrice) > 0 {
glog.V(common.DEBUG).Infof("orchestrator's price is too high - orch=%v price=%v wei/pixel maxPrice=%v wei/pixel",
info.GetTranscoder(),
price.FloatString(3),
maxPrice.FloatString(3),
)
return false
}
return true
}
Expand Down

0 comments on commit 84cb164

Please sign in to comment.