From eab9bcf1ffd1d9a689cb25867286d58249b569a6 Mon Sep 17 00:00:00 2001 From: Niko Storni Date: Tue, 4 Aug 2020 01:23:05 +0200 Subject: [PATCH] don't wait for confirmations unnecessarily fix sqlite crap --- manager/s3_storage.go | 12 +++++++++++- manager/ytsync.go | 8 +++++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/manager/s3_storage.go b/manager/s3_storage.go index cccb5a1..d682b9c 100644 --- a/manager/s3_storage.go +++ b/manager/s3_storage.go @@ -2,6 +2,7 @@ package manager import ( "os" + "path/filepath" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awserr" @@ -86,7 +87,16 @@ func (s *Sync) downloadBlockchainDB() error { if err != nil { return errors.Err(err) } - _ = os.Remove(defaultBDBDir) + files, err := filepath.Glob(defaultBDBDir + "*") + if err != nil { + return errors.Err(err) + } + for _, f := range files { + err = os.Remove(f) + if err != nil { + return errors.Err(err) + } + } downloader, err := s.getS3Downloader() if err != nil { diff --git a/manager/ytsync.go b/manager/ytsync.go index 4339656..0b45e02 100644 --- a/manager/ytsync.go +++ b/manager/ytsync.go @@ -200,9 +200,11 @@ func (s *Sync) FullCycle() (e error) { func (s *Sync) processTransfers() (e error) { log.Println("Processing transfers") - err := waitConfirmations(s) - if err != nil { - return err + if s.transferState != 2 { + err := waitConfirmations(s) + if err != nil { + return err + } } supportAmount, err := abandonSupports(s) if err != nil {