From 1e0ed1e52fa203ffeecd5da50cdff32f34e39c9e Mon Sep 17 00:00:00 2001 From: Joost Jager Date: Fri, 13 Sep 2019 09:48:43 +0200 Subject: [PATCH] multi: fix dropped errors --- aezeed/cipherseed.go | 4 ++-- chanbackup/single.go | 4 ++-- contractcourt/briefcase.go | 4 ++-- htlcswitch/decayedlog.go | 4 ++-- rpcserver.go | 2 +- zpay32/invoice.go | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/aezeed/cipherseed.go b/aezeed/cipherseed.go index 5898eadd..112a5a99 100644 --- a/aezeed/cipherseed.go +++ b/aezeed/cipherseed.go @@ -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 diff --git a/chanbackup/single.go b/chanbackup/single.go index a708c855..83ddcb17 100644 --- a/chanbackup/single.go +++ b/chanbackup/single.go @@ -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 diff --git a/contractcourt/briefcase.go b/contractcourt/briefcase.go index 6420544a..989786f1 100644 --- a/contractcourt/briefcase.go +++ b/contractcourt/briefcase.go @@ -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 diff --git a/htlcswitch/decayedlog.go b/htlcswitch/decayedlog.go index d713a121..6b3c62b5 100644 --- a/htlcswitch/decayedlog.go +++ b/htlcswitch/decayedlog.go @@ -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 diff --git a/rpcserver.go b/rpcserver.go index d030c790..bafa8244 100644 --- a/rpcserver.go +++ b/rpcserver.go @@ -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 diff --git a/zpay32/invoice.go b/zpay32/invoice.go index f779bb48..43d9b532 100644 --- a/zpay32/invoice.go +++ b/zpay32/invoice.go @@ -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 {