From 37603f80dfc8fde2180ff37c63cc943820f2c3e8 Mon Sep 17 00:00:00 2001 From: Nico Vergauwen Date: Thu, 12 Dec 2019 14:22:26 +0100 Subject: [PATCH 1/8] core: orchestrator active check in ProcessPayment() Source-Repository: https://github.com/livepeer/go-livepeer Original-Commit: 5bfee8f76a16b61a779c635c68deb379a5612665 Source-Scope: core/orchestrator.go:isActive --- core/orchestrator.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 core/orchestrator.go diff --git a/core/orchestrator.go b/core/orchestrator.go new file mode 100644 index 0000000..76e6cf1 --- /dev/null +++ b/core/orchestrator.go @@ -0,0 +1,15 @@ +package core + +func (orch *orchestrator) isActive() (bool, error) { + filter := &common.DBOrchFilter{ + CurrentRound: orch.rm.LastInitializedRound(), + Addresses: []ethcommon.Address{orch.Address()}, + } + orchs, err := orch.node.Database.SelectOrchs(filter) + if err != nil { + return false, err + } + + return len(orchs) > 0, nil +} + From 9d85eeb0a7fdfe085422622a669e9ce2fdb77b77 Mon Sep 17 00:00:00 2001 From: Yondon Fu Date: Sat, 2 May 2020 13:27:27 -0400 Subject: [PATCH 2/8] core: Check if ticket recipient is active in ProcessPayment() The node address might be different than the ticket recipient address since a node can receive tickets on behalf of another address. Source-Repository: https://github.com/livepeer/go-livepeer Original-Commit: 9bfeaee0c2da8cfd57953d9be9acd0d1c8d5a0a4 Source-Scope: core/orchestrator.go:isActive --- core/orchestrator.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/orchestrator.go b/core/orchestrator.go index 76e6cf1..82bf513 100644 --- a/core/orchestrator.go +++ b/core/orchestrator.go @@ -1,9 +1,9 @@ package core -func (orch *orchestrator) isActive() (bool, error) { +func (orch *orchestrator) isActive(addr ethcommon.Address) (bool, error) { filter := &common.DBOrchFilter{ CurrentRound: orch.rm.LastInitializedRound(), - Addresses: []ethcommon.Address{orch.Address()}, + Addresses: []ethcommon.Address{addr}, } orchs, err := orch.node.Database.SelectOrchs(filter) if err != nil { From 375fc8302f869aa944dea94b87ccd982b41ee8d6 Mon Sep 17 00:00:00 2001 From: Rafal Leszko Date: Tue, 21 Dec 2021 15:23:00 +0100 Subject: [PATCH 3/8] core: Allows Os received payments while pending activation Source-Repository: https://github.com/livepeer/go-livepeer Original-Commit: 4d6e27449c06913d75150e7c1a710f1e326835d5 Source-Scope: core/orchestrator.go:isActive --- core/orchestrator.go | 15 --------------- 1 file changed, 15 deletions(-) delete mode 100644 core/orchestrator.go diff --git a/core/orchestrator.go b/core/orchestrator.go deleted file mode 100644 index 82bf513..0000000 --- a/core/orchestrator.go +++ /dev/null @@ -1,15 +0,0 @@ -package core - -func (orch *orchestrator) isActive(addr ethcommon.Address) (bool, error) { - filter := &common.DBOrchFilter{ - CurrentRound: orch.rm.LastInitializedRound(), - Addresses: []ethcommon.Address{addr}, - } - orchs, err := orch.node.Database.SelectOrchs(filter) - if err != nil { - return false, err - } - - return len(orchs) > 0, nil -} - From 7d00675545fbe9007bd5434cce5da544e4d3220c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Leszko?= Date: Fri, 17 Feb 2023 09:52:48 +0100 Subject: [PATCH 4/8] Revert accepting pending Os to accept traffic (#2758) Source-Repository: https://github.com/livepeer/go-livepeer Original-Commit: 1bdb33454063e35fe34030a60d347a53434732e7 Source-Scope: core/orchestrator.go:isActive --- core/orchestrator.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 core/orchestrator.go diff --git a/core/orchestrator.go b/core/orchestrator.go new file mode 100644 index 0000000..82bf513 --- /dev/null +++ b/core/orchestrator.go @@ -0,0 +1,15 @@ +package core + +func (orch *orchestrator) isActive(addr ethcommon.Address) (bool, error) { + filter := &common.DBOrchFilter{ + CurrentRound: orch.rm.LastInitializedRound(), + Addresses: []ethcommon.Address{addr}, + } + orchs, err := orch.node.Database.SelectOrchs(filter) + if err != nil { + return false, err + } + + return len(orchs) > 0, nil +} + From ad9e819c7b40066fd0051056969c125b1eac947e Mon Sep 17 00:00:00 2001 From: Nico Vergauwen Date: Thu, 12 Dec 2019 14:22:26 +0100 Subject: [PATCH 5/8] core: orchestrator active check in ProcessPayment() Source-Repository: https://github.com/livepeer/go-livepeer Original-Commit: 5bfee8f76a16b61a779c635c68deb379a5612665 Source-Scope: core/orchestrator.go:isActive --- core/orchestrator.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 core/orchestrator.go diff --git a/core/orchestrator.go b/core/orchestrator.go new file mode 100644 index 0000000..76e6cf1 --- /dev/null +++ b/core/orchestrator.go @@ -0,0 +1,15 @@ +package core + +func (orch *orchestrator) isActive() (bool, error) { + filter := &common.DBOrchFilter{ + CurrentRound: orch.rm.LastInitializedRound(), + Addresses: []ethcommon.Address{orch.Address()}, + } + orchs, err := orch.node.Database.SelectOrchs(filter) + if err != nil { + return false, err + } + + return len(orchs) > 0, nil +} + From 2766cac629331752d4e19b128891fe3e67ad8bd6 Mon Sep 17 00:00:00 2001 From: Yondon Fu Date: Sat, 2 May 2020 13:27:27 -0400 Subject: [PATCH 6/8] core: Check if ticket recipient is active in ProcessPayment() The node address might be different than the ticket recipient address since a node can receive tickets on behalf of another address. Source-Repository: https://github.com/livepeer/go-livepeer Original-Commit: 9bfeaee0c2da8cfd57953d9be9acd0d1c8d5a0a4 Source-Scope: core/orchestrator.go:isActive --- core/orchestrator.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/orchestrator.go b/core/orchestrator.go index 76e6cf1..82bf513 100644 --- a/core/orchestrator.go +++ b/core/orchestrator.go @@ -1,9 +1,9 @@ package core -func (orch *orchestrator) isActive() (bool, error) { +func (orch *orchestrator) isActive(addr ethcommon.Address) (bool, error) { filter := &common.DBOrchFilter{ CurrentRound: orch.rm.LastInitializedRound(), - Addresses: []ethcommon.Address{orch.Address()}, + Addresses: []ethcommon.Address{addr}, } orchs, err := orch.node.Database.SelectOrchs(filter) if err != nil { From eb96453eaeedae800174c2d1a0521dda5894e732 Mon Sep 17 00:00:00 2001 From: Rafal Leszko Date: Tue, 21 Dec 2021 15:23:00 +0100 Subject: [PATCH 7/8] core: Allows Os received payments while pending activation Source-Repository: https://github.com/livepeer/go-livepeer Original-Commit: 4d6e27449c06913d75150e7c1a710f1e326835d5 Source-Scope: core/orchestrator.go:isActive --- core/orchestrator.go | 15 --------------- 1 file changed, 15 deletions(-) delete mode 100644 core/orchestrator.go diff --git a/core/orchestrator.go b/core/orchestrator.go deleted file mode 100644 index 82bf513..0000000 --- a/core/orchestrator.go +++ /dev/null @@ -1,15 +0,0 @@ -package core - -func (orch *orchestrator) isActive(addr ethcommon.Address) (bool, error) { - filter := &common.DBOrchFilter{ - CurrentRound: orch.rm.LastInitializedRound(), - Addresses: []ethcommon.Address{addr}, - } - orchs, err := orch.node.Database.SelectOrchs(filter) - if err != nil { - return false, err - } - - return len(orchs) > 0, nil -} - From 769fb3ce9be86f853d35d8ffb0bf48240d86d2df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Leszko?= Date: Fri, 17 Feb 2023 09:52:48 +0100 Subject: [PATCH 8/8] Revert accepting pending Os to accept traffic (#2758) Source-Repository: https://github.com/livepeer/go-livepeer Original-Commit: 1bdb33454063e35fe34030a60d347a53434732e7 Source-Scope: core/orchestrator.go:isActive --- core/orchestrator.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 core/orchestrator.go diff --git a/core/orchestrator.go b/core/orchestrator.go new file mode 100644 index 0000000..82bf513 --- /dev/null +++ b/core/orchestrator.go @@ -0,0 +1,15 @@ +package core + +func (orch *orchestrator) isActive(addr ethcommon.Address) (bool, error) { + filter := &common.DBOrchFilter{ + CurrentRound: orch.rm.LastInitializedRound(), + Addresses: []ethcommon.Address{addr}, + } + orchs, err := orch.node.Database.SelectOrchs(filter) + if err != nil { + return false, err + } + + return len(orchs) > 0, nil +} +