diff --git a/manager/manager.go b/manager/manager.go index 9d6d5d2..97d897e 100644 --- a/manager/manager.go +++ b/manager/manager.go @@ -92,6 +92,7 @@ const ( TransferStateNotTouched = iota TransferStatePending TransferStateComplete + TransferStateManual ) func (s *SyncManager) Start() error { diff --git a/manager/setup.go b/manager/setup.go index 82f0ad3..aef66d8 100644 --- a/manager/setup.go +++ b/manager/setup.go @@ -448,7 +448,11 @@ func (s *Sync) addCredits(amountToAdd float64) error { return err } - addressResp, err := s.daemon.AddressUnused(nil) + defaultAccount, err := s.getDefaultAccount() + if err != nil { + return err + } + addressResp, err := s.daemon.AddressUnused(&defaultAccount) if err != nil { return err } else if addressResp == nil { diff --git a/manager/ytsync.go b/manager/ytsync.go index 097796f..e7a136c 100644 --- a/manager/ytsync.go +++ b/manager/ytsync.go @@ -357,7 +357,18 @@ func (s *Sync) processTransfers() (e error) { isTip := true summary, err := s.daemon.SupportCreate(s.lbryChannelID, fmt.Sprintf("%.6f", supportAmount), &isTip, nil, []string{defaultAccount}, nil) if err != nil { - return errors.Err(err) + if strings.Contains(err.Error(), "tx-size") { //TODO: this is a silly workaround and should be written in an recursive function + summary, err = s.daemon.SupportCreate(s.lbryChannelID, fmt.Sprintf("%.6f", supportAmount/2.0), &isTip, nil, []string{defaultAccount}, nil) + if err != nil { + return errors.Prefix(fmt.Sprintf("something went wrong while tipping the channel for %.6f LBCs", supportAmount), err) + } + summary, err = s.daemon.SupportCreate(s.lbryChannelID, fmt.Sprintf("%.6f", supportAmount/2.0), &isTip, nil, []string{defaultAccount}, nil) + if err != nil { + return errors.Err(err) + } + } else { + return errors.Err(err) + } } if len(summary.Outputs) < 1 { return errors.Err("something went wrong while tipping the channel for %.6f LBCs", supportAmount) @@ -777,7 +788,7 @@ func (s *Sync) doSync() error { return err } - if s.transferState != TransferStateComplete { + if s.transferState < TransferStateComplete { cert, err := s.daemon.ChannelExport(s.lbryChannelID, nil, nil) if err != nil { return errors.Prefix("error getting channel cert", err) @@ -883,6 +894,7 @@ func (s *Sync) startWorker(workerNum int) { "This video is not available", "requested format not available", "interrupted by user", + "Sign in to confirm your age", } if util.SubstringInSlice(err.Error(), errorsNoRetry) { log.Println("This error should not be retried at all") @@ -1105,6 +1117,7 @@ func (s *Sync) processVideo(v video) (err error) { "Watch this video on YouTube.", "have blocked it on copyright grounds", "giving up after 0 fragment retries", + "Sign in to confirm your age", } if ok && !sv.Published && util.SubstringInSlice(sv.FailureReason, neverRetryFailures) { log.Println(v.ID() + " can't ever be published")