Fix possible race when syncing peer

This commit is contained in:
braginini 2024-07-20 20:11:15 +02:00
parent 0a8c78deb1
commit dde4693fdd

View File

@ -1870,7 +1870,7 @@ func (am *DefaultAccountManager) SyncAndMarkPeer(ctx context.Context, peerPubKey
return nil, nil, nil, err
}
unlock := am.Store.AcquireAccountReadLock(ctx, accountID)
unlock := am.Store.AcquireAccountWriteLock(ctx, accountID)
defer unlock()
account, err := am.Store.GetAccount(ctx, accountID)