take over any channel

This commit is contained in:
Niko Storni 2018-11-15 18:34:01 -05:00
parent a7b2bc816d
commit 7676e923fe

View file

@ -1,7 +1,6 @@
package main package main
import ( import (
"strings"
"time" "time"
"github.com/lbryio/lbry.go/errors" "github.com/lbryio/lbry.go/errors"
@ -201,23 +200,8 @@ func (s *Sync) ensureChannelOwnership() error {
return nil return nil
} }
resolveResp, err := s.daemon.Resolve(s.LbryChannelName)
if err != nil {
return err
}
channel := (*resolveResp)[s.LbryChannelName]
channelBidAmount := channelClaimAmount channelBidAmount := channelClaimAmount
channelNotFound := channel.Error != nil && strings.Contains(*(channel.Error), "cannot be resolved")
if !channelNotFound {
if !s.TakeOverExistingChannel {
return errors.Err("Channel exists and we don't own it. Pick another channel.")
}
log.Println("Channel exists and we don't own it. Outbidding existing claim.")
channelBidAmount, _ = channel.Certificate.Amount.Add(decimal.NewFromFloat(channelClaimAmount)).Float64()
}
balanceResp, err := s.daemon.WalletBalance() balanceResp, err := s.daemon.WalletBalance()
if err != nil { if err != nil {
return err return err