don't wait for confirmations unnecessarily
fix sqlite crap
This commit is contained in:
parent
751bc84ce5
commit
eab9bcf1ff
2 changed files with 16 additions and 4 deletions
|
@ -2,6 +2,7 @@ package manager
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"os"
|
"os"
|
||||||
|
"path/filepath"
|
||||||
|
|
||||||
"github.com/aws/aws-sdk-go/aws"
|
"github.com/aws/aws-sdk-go/aws"
|
||||||
"github.com/aws/aws-sdk-go/aws/awserr"
|
"github.com/aws/aws-sdk-go/aws/awserr"
|
||||||
|
@ -86,7 +87,16 @@ func (s *Sync) downloadBlockchainDB() error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Err(err)
|
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()
|
downloader, err := s.getS3Downloader()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -200,10 +200,12 @@ func (s *Sync) FullCycle() (e error) {
|
||||||
|
|
||||||
func (s *Sync) processTransfers() (e error) {
|
func (s *Sync) processTransfers() (e error) {
|
||||||
log.Println("Processing transfers")
|
log.Println("Processing transfers")
|
||||||
|
if s.transferState != 2 {
|
||||||
err := waitConfirmations(s)
|
err := waitConfirmations(s)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
}
|
||||||
supportAmount, err := abandonSupports(s)
|
supportAmount, err := abandonSupports(s)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Prefix(fmt.Sprintf("%.6f LBCs were abandoned before failing", supportAmount), err)
|
return errors.Prefix(fmt.Sprintf("%.6f LBCs were abandoned before failing", supportAmount), err)
|
||||||
|
|
Loading…
Reference in a new issue