Merge pull request #3502 from joostjager/err-returns

multi: fix dropped errors
This commit is contained in:
Conner Fromknecht 2019-09-13 11:24:04 -07:00 committed by GitHub
commit 72c5d11a1c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 10 additions and 10 deletions

@ -349,7 +349,7 @@ func cipherTextToMnemonic(cipherText [EncipheredCipherSeedSize]byte) (Mnemonic,
for i := 0; i < NummnemonicWords; i++ {
index, err := cipherBits.ReadBits(bitsPerWord)
if err != nil {
return words, nil
return Mnemonic{}, err
}
words[i] = defaultWordList[index]
@ -366,7 +366,7 @@ func (c *CipherSeed) ToMnemonic(pass []byte) (Mnemonic, error) {
// with our KDF salt appended to it.
cipherText, err := c.encipher(pass)
if err != nil {
return Mnemonic{}, nil
return Mnemonic{}, err
}
// Now that we have our cipher text, we'll convert it into a mnemonic

@ -276,12 +276,12 @@ func readRemoteKeyDesc(r io.Reader) (keychain.KeyDescriptor, error) {
_, err := io.ReadFull(r, pub[:])
if err != nil {
return keyDesc, nil
return keychain.KeyDescriptor{}, err
}
keyDesc.PubKey, err = btcec.ParsePubKey(pub[:], btcec.S256())
if err != nil {
return keyDesc, nil
return keychain.KeyDescriptor{}, err
}
keyDesc.PubKey.Curve = nil

@ -961,7 +961,7 @@ func decodeIncomingResolution(r io.Reader, h *lnwallet.IncomingHtlcResolution) e
func encodeOutgoingResolution(w io.Writer, o *lnwallet.OutgoingHtlcResolution) error {
if err := binary.Write(w, endian, o.Expiry); err != nil {
return nil
return err
}
if o.SignedTimeoutTx == nil {
@ -979,7 +979,7 @@ func encodeOutgoingResolution(w io.Writer, o *lnwallet.OutgoingHtlcResolution) e
}
if err := binary.Write(w, endian, o.CsvDelay); err != nil {
return nil
return err
}
if _, err := w.Write(o.ClaimOutpoint.Hash[:]); err != nil {
return err

@ -9,7 +9,7 @@ import (
"sync/atomic"
"github.com/coreos/bbolt"
"github.com/lightningnetwork/lightning-onion"
sphinx "github.com/lightningnetwork/lightning-onion"
"github.com/lightningnetwork/lnd/chainntnfs"
)
@ -237,7 +237,7 @@ func (d *DecayedLog) gcExpiredHashes(height uint32) (uint32, error) {
return nil
})
if err != nil {
return 0, nil
return 0, err
}
return numExpiredHashes, nil

@ -4461,7 +4461,7 @@ func (r *rpcServer) FeeReport(ctx context.Context,
for {
timeSlice, err := fwdEventLog.Query(query)
if err != nil {
return 0, nil
return 0, err
}
// If the timeslice is empty, then we'll return as

@ -1052,7 +1052,7 @@ func writeTaggedFields(bufferBase32 *bytes.Buffer, invoice *Invoice) error {
pubKeyBase32, err := bech32.ConvertBits(
invoice.Destination.SerializeCompressed(), 8, 5, true)
if err != nil {
return nil
return err
}
if len(pubKeyBase32) != pubKeyBase32Len {