Skip to content

Commit 5c23836

Browse files
committed
add getfilesize, update getfile, reportFileTag
1 parent dce7d18 commit 5c23836

File tree

4 files changed

+849
-23
lines changed

4 files changed

+849
-23
lines changed

configs/system.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const (
2222
// Name is the name of the program
2323
Name = "miner"
2424
// version
25-
Version = "v0.8.2 2502131402-1739426530376"
25+
Version = "v0.8.2 2502131653-1739436791719"
2626
// Description is the description of the program
2727
Description = "Storage miner implementation in CESS networks"
2828
// NameSpace is the cached namespace

node/calctag.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ func (n *Node) reportFileTag(fid string, tags []string) (string, error) {
534534
tagSigInfo.Digest[j].TeePubkey, _ = chain.BytesToWorkPublickey(digest[j].TeeAccountId)
535535
}
536536
n.Stag("info", fmt.Sprintf("[%s] Will report file tag", fid))
537-
for j := 0; j < 10; j++ {
537+
for j := 0; j < 3; j++ {
538538
txhash, err = n.CalculateReport(latestSig, tagSigInfo)
539539
if err != nil || txhash == "" {
540540
n.Stag("err", fmt.Sprintf("[%s] ReportTagCalculated: %s %v", fid, txhash, err))
@@ -576,7 +576,13 @@ func (n *Node) reportFileTag(fid string, tags []string) (string, error) {
576576
if err != nil {
577577
n.Stag("err", err.Error())
578578
}
579-
if (j + 1) >= 10 {
579+
if (j + 1) >= 3 {
580+
if !onChainFlag {
581+
for _, v := range tags {
582+
os.Remove(v)
583+
}
584+
return "", fmt.Errorf("report file tag failed")
585+
}
580586
break
581587
}
582588
time.Sleep(time.Minute)

node/node.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,10 @@ func (n *Node) TaskPeriod_10m() {
183183
tick_10m := time.NewTicker(time.Minute * 10)
184184
defer tick_10m.Stop()
185185
syncTeeCh := make(chan bool, 1)
186-
syncTeeCh <- true
187186
replaceIdleCh := make(chan bool, 1)
188187
replaceIdleCh <- true
188+
189+
go n.SyncTeeInfo(syncTeeCh)
189190
for {
190191
select {
191192
case <-tick_10m.C:

0 commit comments

Comments
 (0)