Skip to content

Commit

Permalink
Live Video Payment Mechanism (#3225)
Browse files Browse the repository at this point in the history
  • Loading branch information
leszko authored Nov 5, 2024
1 parent 836d006 commit 95ecb08
Show file tree
Hide file tree
Showing 13 changed files with 692 additions and 267 deletions.
1 change: 1 addition & 0 deletions common/testutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ func IgnoreRoutines() []goleak.Option {
"github.com/livepeer/go-livepeer/server.(*LivepeerServer).HandlePush.func1", "github.com/rjeczalik/notify.(*nonrecursiveTree).dispatch",
"github.com/rjeczalik/notify.(*nonrecursiveTree).internal", "github.com/livepeer/lpms/stream.NewBasicRTMPVideoStream.func1", "github.com/patrickmn/go-cache.(*janitor).Run",
"github.com/golang/glog.(*fileSink).flushDaemon", "github.com/livepeer/go-livepeer/core.(*LivepeerNode).transcodeFrames.func2", "github.com/ipfs/go-log/writer.(*MirrorWriter).logRoutine",
"github.com/livepeer/go-livepeer/core.(*Balances).StartCleanup",
}

res := make([]goleak.Option, 0, len(funcs2ignore))
Expand Down
7 changes: 7 additions & 0 deletions core/orchestrator.go
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,13 @@ func (orch *orchestrator) DebitFees(addr ethcommon.Address, manifestID ManifestI
orch.node.Balances.Debit(addr, manifestID, priceRat.Mul(priceRat, big.NewRat(pixels, 1)))
}

func (orch *orchestrator) Balance(addr ethcommon.Address, manifestID ManifestID) *big.Rat {
if orch.node == nil || orch.node.Balances == nil {
return nil
}
return orch.node.Balances.Balance(addr, manifestID)
}

func (orch *orchestrator) Capabilities() *net.Capabilities {
if orch.node == nil {
return nil
Expand Down
Loading

0 comments on commit 95ecb08

Please sign in to comment.