lnwallet/channel: return missing errors
This commit corrects a few cases where we would encounter errors, but return nil by mistake.
This commit is contained in:
1 file changed
+4
-5
+4
-5
@@ -138,8 +138,7 @@ const (
|
|||||||
// from the log. Adding a MalformedFail entry to ones log will modify
|
// from the log. Adding a MalformedFail entry to ones log will modify
|
||||||
// the _remote_ parties update log once a new commitment view has been
|
// the _remote_ parties update log once a new commitment view has been
|
||||||
// evaluated which contains the MalformedFail entry. The difference
|
// evaluated which contains the MalformedFail entry. The difference
|
||||||
// from Fail type lie in
|
// from Fail type lie in the different data we have to store.
|
||||||
// the different data we have to store.
|
|
||||||
MalformedFail
|
MalformedFail
|
||||||
|
|
||||||
// Settle is an update type which settles a prior HTLC crediting the
|
// Settle is an update type which settles a prior HTLC crediting the
|
||||||
@@ -623,13 +622,13 @@ func (c *commitment) populateHtlcIndexes() error {
|
|||||||
for i := 0; i < len(c.outgoingHTLCs); i++ {
|
for i := 0; i < len(c.outgoingHTLCs); i++ {
|
||||||
htlc := &c.outgoingHTLCs[i]
|
htlc := &c.outgoingHTLCs[i]
|
||||||
if err := populateIndex(htlc, false); err != nil {
|
if err := populateIndex(htlc, false); err != nil {
|
||||||
return nil
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for i := 0; i < len(c.incomingHTLCs); i++ {
|
for i := 0; i < len(c.incomingHTLCs); i++ {
|
||||||
htlc := &c.incomingHTLCs[i]
|
htlc := &c.incomingHTLCs[i]
|
||||||
if err := populateIndex(htlc, true); err != nil {
|
if err := populateIndex(htlc, true); err != nil {
|
||||||
return nil
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1640,7 +1639,7 @@ func (lc *LightningChannel) restoreCommitState(
|
|||||||
// extended to the remote party but which was never ACK'd.
|
// extended to the remote party but which was never ACK'd.
|
||||||
pendingRemoteCommitDiff, err = lc.channelState.RemoteCommitChainTip()
|
pendingRemoteCommitDiff, err = lc.channelState.RemoteCommitChainTip()
|
||||||
if err != nil && err != channeldb.ErrNoPendingCommit {
|
if err != nil && err != channeldb.ErrNoPendingCommit {
|
||||||
return nil
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if pendingRemoteCommitDiff != nil {
|
if pendingRemoteCommitDiff != nil {
|
||||||
|
|||||||
Reference in new issue
Block a user