take over any channel
This commit is contained in:
parent
a7b2bc816d
commit
7676e923fe
1 changed files with 0 additions and 16 deletions
16
setup.go
16
setup.go
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue