Browse Source

ignore request to failover peer

abhishek9686 9 tháng trước cách đây
mục cha
commit
44769aff31
1 tập tin đã thay đổi với 8 bổ sung0 xóa
  1. 8 0
      pro/controllers/failover.go

+ 8 - 0
pro/controllers/failover.go

@@ -211,6 +211,14 @@ func failOverME(w http.ResponseWriter, r *http.Request) {
 		)
 		return
 	}
+	if peerNode.IsFailOver {
+		logic.ReturnErrorResponse(
+			w,
+			r,
+			logic.FormatError(errors.New("peer is acting as failover"), "badrequest"),
+		)
+		return
+	}
 	if node.IsRelayed && node.RelayedBy == peerNode.ID.String() {
 		logic.ReturnErrorResponse(
 			w,