From ef890c647c7eb2a3a7a698da8bd3dffdc08b5d25 Mon Sep 17 00:00:00 2001 From: Josh Rickmar Date: Mon, 10 Jun 2024 20:32:48 +0000 Subject: [PATCH] error during the warmup phase --- mixing/mixclient/client.go | 2 ++ mixing/mixclient/errors.go | 2 ++ 2 files changed, 4 insertions(+) diff --git a/mixing/mixclient/client.go b/mixing/mixclient/client.go index 4a07567017..b1a3239c08 100644 --- a/mixing/mixclient/client.go +++ b/mixing/mixclient/client.go @@ -739,6 +739,8 @@ func (c *Client) Dicemix(ctx context.Context, rand io.Reader, cj *CoinJoin) erro case <-c.warming: case <-ctx.Done(): return ctx.Err() + default: + return ErrWarming } pub, priv, err := generateSecp256k1(rand) diff --git a/mixing/mixclient/errors.go b/mixing/mixclient/errors.go index 20fe58d502..a53cb7c588 100644 --- a/mixing/mixclient/errors.go +++ b/mixing/mixclient/errors.go @@ -6,6 +6,8 @@ var ( ErrTooFewPeers = errors.New("not enough peers required to mix") ErrUnknownPRs = errors.New("unable to participate in reformed session referencing unknown PRs") + + ErrWarming = errors.New("mixing client is observing messages; retry request later") ) // testPeerBlamedError describes the error condition of a misbehaving peer