diff --git a/manager/setup.go b/manager/setup.go index 5a172ef..e2ea92c 100644 --- a/manager/setup.go +++ b/manager/setup.go @@ -94,14 +94,19 @@ func (s *Sync) walletSetup() error { videosOnYoutube = s.Manager.videosLimit } unallocatedVideos := videosOnYoutube - (publishedCount + failedCount) - requiredBalance := float64(unallocatedVideos)*(publishAmount+estimatedMaxTxFee) + channelClaimAmount + channelFee := channelClaimAmount + channelAlreadyClaimed := s.lbryChannelID != "" + if channelAlreadyClaimed { + channelFee = 0.0 + } + requiredBalance := float64(unallocatedVideos)*(publishAmount+estimatedMaxTxFee) + channelFee if s.Manager.SyncFlags.UpgradeMetadata { requiredBalance += float64(notUpgradedCount) * 0.001 } refillAmount := 0.0 if balance < requiredBalance || balance < minimumAccountBalance { - refillAmount = math.Max(requiredBalance-balance, minimumRefillAmount) + refillAmount = math.Max(math.Max(requiredBalance-balance, minimumAccountBalance-balance), minimumRefillAmount) } if s.Refill > 0 { diff --git a/manager/ytsync.go b/manager/ytsync.go index 63a6279..aacf3b7 100644 --- a/manager/ytsync.go +++ b/manager/ytsync.go @@ -39,7 +39,7 @@ import ( const ( channelClaimAmount = 0.01 estimatedMaxTxFee = 0.1 - minimumAccountBalance = 4.0 + minimumAccountBalance = 1.0 minimumRefillAmount = 1 publishAmount = 0.01 maxReasonLength = 500 @@ -545,6 +545,9 @@ func (s *Sync) updateRemoteDB(claims []jsonrpc.Claim) (total, fixed, removed int if !claimInDatabase { log.Debugf("%s: Published but is not in database (%s - %s)", videoID, c.Name, c.ClaimID) } + if s.syncedVideos[videoID].Transferred { + log.Debugf("%s: Marked as transferred while in fact it's not (%s - %s). Publish address: %s, expected: %s", videoID, c.Name, c.ClaimID, c.Address, s.publishAddress) + } if !claimInDatabase || metadataDiffers || claimIDDiffers || claimNameDiffers || claimMarkedUnpublished { claimSize, err := c.GetStreamSizeByMagic() if err != nil { @@ -569,7 +572,8 @@ func (s *Sync) updateRemoteDB(claims []jsonrpc.Claim) (total, fixed, removed int idsToRemove := make([]string, 0, len(videoIDMap)) for vID, sv := range s.syncedVideos { if sv.Transferred { - log.Infof("%s: claim was transferred, ignoring") + log.Infof("%s: claim was transferred, ignoring", vID) + count++ //still count them as publishes continue } _, ok := videoIDMap[vID]