Skip to content

Commit

Permalink
core: Add debug log for staging balance update
Browse files Browse the repository at this point in the history
  • Loading branch information
yondonfu committed May 21, 2021
1 parent 09d1216 commit 08dc757
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions core/accounting.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import (
"time"

ethcommon "github.com/ethereum/go-ethereum/common"
"github.com/golang/glog"
"github.com/livepeer/go-livepeer/common"
)

// Balance holds the credit balance for a broadcast session
Expand Down Expand Up @@ -41,6 +43,9 @@ func (b *Balance) StageUpdate(minCredit, ev *big.Rat) (int, *big.Rat, *big.Rat)
}

creditGap := new(big.Rat).Sub(minCredit, existingCredit)

glog.V(common.DEBUG).Infof("Staging balance update existingCredit=%v minCredit=%v creditGap=%v", existingCredit.FloatString(3), minCredit.FloatString(3), creditGap.FloatString(3))

sizeRat := creditGap.Quo(creditGap, ev)
res := sizeRat.Num()
if !sizeRat.IsInt() {
Expand Down

0 comments on commit 08dc757

Please sign in to comment.