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.
This commit is contained in:
Wilmer Paulino 2020-09-03 16:06:47 -07:00
parent 203627643b
commit bf21305205
No known key found for this signature in database
GPG key ID: 6DF57B9F9514972F

View file

@ -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