From a7b369977279d89b89a0edbf928ffdaa3d234564 Mon Sep 17 00:00:00 2001 From: ehsan shariati Date: Mon, 6 Nov 2023 17:56:43 -0500 Subject: [PATCH] checked if announcer is empty (on mobile) --- blockchain/bl_pool.go | 6 ++++-- mobile/config.go | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/blockchain/bl_pool.go b/blockchain/bl_pool.go index b1e80080..ffea720a 100644 --- a/blockchain/bl_pool.go +++ b/blockchain/bl_pool.go @@ -88,8 +88,10 @@ func (bl *FxBlockchain) PoolJoin(ctx context.Context, to peer.ID, r PoolJoinRequ if err != nil { return b, err } - bl.wg.Add(1) - go bl.a.AnnounceJoinPoolRequestPeriodically(ctx) + if bl.a != nil { + bl.wg.Add(1) + go bl.a.AnnounceJoinPoolRequestPeriodically(ctx) + } return b, nil } } diff --git a/mobile/config.go b/mobile/config.go index 0ccf40a4..c91fae10 100644 --- a/mobile/config.go +++ b/mobile/config.go @@ -171,7 +171,7 @@ func (cfg *Config) init(mc *Client) error { if err != nil { return err } - mc.bl, err = blockchain.NewFxBlockchain(mc.h, nil, + mc.bl, err = blockchain.NewFxBlockchain(mc.h, nil, nil, blockchain.NewSimpleKeyStorer(""), blockchain.WithAuthorizer(mc.h.ID()), blockchain.WithAllowTransientConnection(cfg.AllowTransientConnection),