support create fixes
various bug fixes
This commit is contained in:
parent
a5657aaf46
commit
1f9a645c57
3 changed files with 21 additions and 3 deletions
|
@ -92,6 +92,7 @@ const (
|
||||||
TransferStateNotTouched = iota
|
TransferStateNotTouched = iota
|
||||||
TransferStatePending
|
TransferStatePending
|
||||||
TransferStateComplete
|
TransferStateComplete
|
||||||
|
TransferStateManual
|
||||||
)
|
)
|
||||||
|
|
||||||
func (s *SyncManager) Start() error {
|
func (s *SyncManager) Start() error {
|
||||||
|
|
|
@ -448,7 +448,11 @@ func (s *Sync) addCredits(amountToAdd float64) error {
|
||||||
return err
|
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 {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
} else if addressResp == nil {
|
} else if addressResp == nil {
|
||||||
|
|
|
@ -357,7 +357,18 @@ func (s *Sync) processTransfers() (e error) {
|
||||||
isTip := true
|
isTip := true
|
||||||
summary, err := s.daemon.SupportCreate(s.lbryChannelID, fmt.Sprintf("%.6f", supportAmount), &isTip, nil, []string{defaultAccount}, nil)
|
summary, err := s.daemon.SupportCreate(s.lbryChannelID, fmt.Sprintf("%.6f", supportAmount), &isTip, nil, []string{defaultAccount}, nil)
|
||||||
if err != 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 {
|
if len(summary.Outputs) < 1 {
|
||||||
return errors.Err("something went wrong while tipping the channel for %.6f LBCs", supportAmount)
|
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
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if s.transferState != TransferStateComplete {
|
if s.transferState < TransferStateComplete {
|
||||||
cert, err := s.daemon.ChannelExport(s.lbryChannelID, nil, nil)
|
cert, err := s.daemon.ChannelExport(s.lbryChannelID, nil, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return errors.Prefix("error getting channel cert", err)
|
return errors.Prefix("error getting channel cert", err)
|
||||||
|
@ -883,6 +894,7 @@ func (s *Sync) startWorker(workerNum int) {
|
||||||
"This video is not available",
|
"This video is not available",
|
||||||
"requested format not available",
|
"requested format not available",
|
||||||
"interrupted by user",
|
"interrupted by user",
|
||||||
|
"Sign in to confirm your age",
|
||||||
}
|
}
|
||||||
if util.SubstringInSlice(err.Error(), errorsNoRetry) {
|
if util.SubstringInSlice(err.Error(), errorsNoRetry) {
|
||||||
log.Println("This error should not be retried at all")
|
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.",
|
"Watch this video on YouTube.",
|
||||||
"have blocked it on copyright grounds",
|
"have blocked it on copyright grounds",
|
||||||
"giving up after 0 fragment retries",
|
"giving up after 0 fragment retries",
|
||||||
|
"Sign in to confirm your age",
|
||||||
}
|
}
|
||||||
if ok && !sv.Published && util.SubstringInSlice(sv.FailureReason, neverRetryFailures) {
|
if ok && !sv.Published && util.SubstringInSlice(sv.FailureReason, neverRetryFailures) {
|
||||||
log.Println(v.ID() + " can't ever be published")
|
log.Println(v.ID() + " can't ever be published")
|
||||||
|
|
Loading…
Reference in a new issue