From 646c74733da2da1a8bac1c14ba8b418b8d945dbd Mon Sep 17 00:00:00 2001 From: ehsan shariati Date: Mon, 4 Mar 2024 09:10:12 -0500 Subject: [PATCH] n --- blockchain/blockchain.go | 2 +- exchange/fx_exchange.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/blockchain/blockchain.go b/blockchain/blockchain.go index 4936665..c2dbe62 100644 --- a/blockchain/blockchain.go +++ b/blockchain/blockchain.go @@ -837,7 +837,7 @@ func (bl *FxBlockchain) SetAuth(ctx context.Context, on peer.ID, subject peer.ID } func (bl *FxBlockchain) authorized(pid peer.ID, action string) bool { - if bl.authorizer == "" { + if bl.authorizer == bl.h.ID() { //to cover the cases where in poolHost mode return action == actionReplicateInPool } switch action { diff --git a/exchange/fx_exchange.go b/exchange/fx_exchange.go index 787fb99..b16177c 100644 --- a/exchange/fx_exchange.go +++ b/exchange/fx_exchange.go @@ -699,7 +699,7 @@ func (e *FxExchange) SetAuth(ctx context.Context, on peer.ID, subject peer.ID, a func (e *FxExchange) authorized(pid peer.ID, action string, cid string) bool { log.Debugw("checking authorization", "pid", pid, "action", action, "cid", cid) - if e.authorizer == "" && action != actionAuth { + if e.authorizer == e.h.ID() && action != actionAuth { //to cover the cases where in poolHost mode // If no authorizer is set allow all. return true } else if e.authorizer == "" && action == actionAuth {