From bf2130520592f6b0ef44e2afacab03433617dcda Mon Sep 17 00:00:00 2001 From: Wilmer Paulino Date: Thu, 3 Sep 2020 16:06:47 -0700 Subject: [PATCH] auctioneer: use StateInitiated for pending/open recovered accounts Using this state allows the trader to locate the transaction locally for recovered accounts in a pending open or open state. There is no risk of double sending funds in this case, as that's prevented through the recovery branch within the account manager. --- auctioneer/client.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/auctioneer/client.go b/auctioneer/client.go index 800e855..2a5d198 100644 --- a/auctioneer/client.go +++ b/auctioneer/client.go @@ -651,7 +651,7 @@ func (c *Client) RecoverAccounts(ctx context.Context, } // Account is ok, parse the rest of the fields. - acct, err := unmarshallServerAccount( + acct, err := unmarshallServerRecoveredAccount( keyDesc, acctMsg.Account, ) if err != nil { @@ -1020,7 +1020,7 @@ func (c *Client) HandleServerShutdown(err error) error { // unmarshallServerAccount parses the account information sent from the // auctioneer into our local account struct. -func unmarshallServerAccount(keyDesc *keychain.KeyDescriptor, +func unmarshallServerRecoveredAccount(keyDesc *keychain.KeyDescriptor, a *clmrpc.AuctionAccount) (*account.Account, error) { // Parse all raw public keys. @@ -1044,7 +1044,7 @@ func unmarshallServerAccount(keyDesc *keychain.KeyDescriptor, case clmrpc.AuctionAccountState_STATE_OPEN, clmrpc.AuctionAccountState_STATE_PENDING_OPEN: - state = account.StatePendingOpen + state = account.StateInitiated case clmrpc.AuctionAccountState_STATE_CLOSED: state = account.StatePendingClosed