fixes
This commit is contained in:
parent
b15e514638
commit
4942de8992
4 changed files with 11 additions and 3 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,3 +1,4 @@
|
||||||
/.idea
|
/.idea
|
||||||
/lbry
|
/lbry
|
||||||
/vendor
|
/vendor
|
||||||
|
tmp.sh
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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 {
|
||||||
|
if err.Error() == "-6: Insufficient funds" {
|
||||||
err = errors.Wrap(errInsufficientFunds, 0)
|
err = errors.Wrap(errInsufficientFunds, 0)
|
||||||
}
|
}
|
||||||
return hash, errors.Wrap(err, 0)
|
return nil, err
|
||||||
|
}
|
||||||
|
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) {
|
||||||
|
|
|
@ -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()
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue