This commit is contained in:
Alex Grintsvayg 2017-12-29 18:51:38 -05:00
parent b15e514638
commit 4942de8992
No known key found for this signature in database
GPG key ID: AEB3F089F86A22B5
4 changed files with 11 additions and 3 deletions

1
.gitignore vendored
View file

@ -1,3 +1,4 @@
/.idea /.idea
/lbry /lbry
/vendor /vendor
tmp.sh

View file

@ -431,6 +431,9 @@ func (d *Client) NumClaimsInChannel(url string) (uint64, error) {
return 0, errors.New("url not in response") return 0, errors.New("url not in response")
} }
if channel.Error != "" { if channel.Error != "" {
if strings.Contains(channel.Error, "cannot be resolved") {
return 0, nil
}
return 0, errors.New(channel.Error) return 0, errors.New(channel.Error)
} }
return channel.ClaimsInChannel, nil return channel.ClaimsInChannel, nil

View file

@ -96,10 +96,13 @@ func (c *Client) SimpleSend(toAddress string, amount float64) (*chainhash.Hash,
} }
hash, err := c.Client.SendFromMinConf("", decodedAddress, lbcAmount, 0) hash, err := c.Client.SendFromMinConf("", decodedAddress, lbcAmount, 0)
if err != nil && err.Error() == "-6: Insufficient funds" { if err != nil {
err = errors.Wrap(errInsufficientFunds, 0) if err.Error() == "-6: Insufficient funds" {
err = errors.Wrap(errInsufficientFunds, 0)
}
return nil, err
} }
return hash, errors.Wrap(err, 0) return hash, nil
} }
//func (c *Client) SendWithSplit(toAddress string, amount float64, numUTXOs int) (*chainhash.Hash, error) { //func (c *Client) SendWithSplit(toAddress string, amount float64, numUTXOs int) (*chainhash.Hash, error) {

View file

@ -111,6 +111,7 @@ func (s *Sync) FullCycle() error {
signal.Notify(interruptChan, os.Interrupt, syscall.SIGTERM) signal.Notify(interruptChan, os.Interrupt, syscall.SIGTERM)
go func() { go func() {
<-interruptChan <-interruptChan
log.Println("Got interrupt signal. Will shut down after current publishes finish")
s.stop.Stop() s.stop.Stop()
}() }()