Skip to content

Commit

Permalink
[PSl-1207] fix ticket db txid
Browse files Browse the repository at this point in the history
  • Loading branch information
j-rafique committed Jul 5, 2024
1 parent 35d6596 commit f59bb6f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
3 changes: 1 addition & 2 deletions common/storage/ticketstore/files.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@ func (s *TicketStore) UpsertFile(file types.File) error {
size_of_original_big_file = COALESCE(excluded.size_of_original_big_file, files.size_of_original_big_file),
data_type_of_original_big_file = COALESCE(excluded.data_type_of_original_big_file, files.data_type_of_original_big_file),
start_block = COALESCE(excluded.start_block, files.start_block),
done_block = COALESCE(excluded.done_block, files.done_block),
txid = COALESCE(excluded.txid, files.txid);`
done_block = COALESCE(excluded.done_block, files.done_block);`

_, err := s.db.Exec(upsertQuery,
file.FileID, file.UploadTimestamp, file.Path, file.FileIndex, file.BaseFileID, file.TaskID,
Expand Down
5 changes: 3 additions & 2 deletions walletnode/api/services/cascade.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ import (
"context"
"encoding/hex"
"fmt"
"github.com/pastelnetwork/gonode/common/types"
"os"
"path/filepath"
"strings"
"sync"
"time"

"github.com/pastelnetwork/gonode/common/types"

"github.com/gorilla/websocket"
"github.com/pastelnetwork/gonode/common/errors"
"github.com/pastelnetwork/gonode/common/log"
Expand Down Expand Up @@ -606,7 +607,7 @@ func (service *CascadeAPIHandler) RestoreFiles(ctx context.Context, p *cascade.R
Passphrase: p.Key,
}

err = service.register.ActivateActionTicketAndRegisterVolumeTicket(ctx, activateActReq, *unConcludedVolume, actAttemptId)
err = service.register.ActivateActionTicket(ctx, activateActReq, *unConcludedVolume, actAttemptId)
if err != nil {
log.WithContext(ctx).WithField("file_id", unConcludedVolume.FileID).WithError(err).Error("error activating or registering un-concluded volume")
continue
Expand Down
2 changes: 1 addition & 1 deletion walletnode/services/cascaderegister/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ func (service *CascadeRegistrationService) GetBurnTxIdByAmount(ctx context.Conte
return txID, nil
}

func (service *CascadeRegistrationService) ActivateActionTicketAndRegisterVolumeTicket(ctx context.Context, aar pastel.ActivateActionRequest, baseFile types.File, actAttemptId int64) error {
func (service *CascadeRegistrationService) ActivateActionTicket(ctx context.Context, aar pastel.ActivateActionRequest, baseFile types.File, actAttemptId int64) error {
blockCount, err := service.pastelHandler.PastelClient.GetBlockCount(ctx)
if err != nil {
return err
Expand Down

0 comments on commit f59bb6f

Please sign in to comment.