diff --git a/mixing/mixclient/blame.go b/mixing/mixclient/blame.go index 3bdb44a51..6143bee9b 100644 --- a/mixing/mixclient/blame.go +++ b/mixing/mixclient/blame.go @@ -20,6 +20,8 @@ import ( "github.com/decred/dcrd/wire" ) +var errBlameFailed = errors.New("blame failed") + // blamedIdentities identifies detected misbehaving peers. // // If a run returns a blamedIdentities error, these peers are immediately @@ -140,7 +142,11 @@ func (c *Client) blame(ctx context.Context, sesRun *sessionRun) (err error) { sesRun.logf("blaming %x for false failure accusation", id[:]) blamed = append(blamed, *id) } - err = blamed + if len(blamed) > 0 { + err = blamed + } else { + err = errBlamedFailed + } }() defer c.mu.Unlock() diff --git a/mixing/mixclient/client.go b/mixing/mixclient/client.go index 9f174650b..bdc6fb73a 100644 --- a/mixing/mixclient/client.go +++ b/mixing/mixclient/client.go @@ -75,7 +75,7 @@ const ( msgRS ) -func blameTimedOut(sesRun *sessionRun, timeoutMessage int) blamedIdentities { +func blameTimedOut(sesRun *sessionRun, timeoutMessage int) error { var blamed blamedIdentities var stage string for _, p := range sesRun.peers { @@ -102,8 +102,11 @@ func blameTimedOut(sesRun *sessionRun, timeoutMessage int) blamedIdentities { } } } - sesRun.logf("blaming %x during run (%s timeout)", []identity(blamed), stage) - return blamed + if len(blamed) > 0 { + sesRun.logf("blaming %x during run (%s timeout)", []identity(blamed), stage) + return blamed + } + return errBlameFailed } // Wallet signs mix transactions and listens for and broadcasts mixing