Merge pull request #1643 from cfromknecht/fail-expiry-too-soon

[htlcswitch/link] use FailFinalExpiryTooSoon as exit hop
This commit is contained in:
Olaoluwa Osuntokun authored and GitHub committed 2018-07-29 23:05:35 -04:00
commit 804598057d
2 files changed
+7 -7

No files matched your search

+2 -2
View File
@@ -9,6 +9,7 @@ import (
"sync/atomic"
"time"
"github.com/btcsuite/btcd/chaincfg/chainhash"
"github.com/davecgh/go-spew/spew"
"github.com/go-errors/errors"
"github.com/lightningnetwork/lnd/channeldb"
@@ -17,7 +18,6 @@ import (
"github.com/lightningnetwork/lnd/lnpeer"
"github.com/lightningnetwork/lnd/lnwallet"
"github.com/lightningnetwork/lnd/lnwire"
"github.com/btcsuite/btcd/chaincfg/chainhash"
)
func init() {
@@ -2155,7 +2155,7 @@ func (l *channelLink) processRemoteAdds(fwdPkg *channeldb.FwdPkg,
"soon: expiry=%v, best_height=%v",
pd.RHash[:], pd.Timeout, heightNow)
failure := lnwire.FailFinalIncorrectCltvExpiry{}
failure := lnwire.FailFinalExpiryTooSoon{}
l.sendHTLCError(
pd.HtlcIndex, &failure, obfuscator, pd.SourceRef,
)
+5 -5
View File
@@ -15,6 +15,10 @@ import (
"testing"
"time"
"github.com/btcsuite/btcd/btcec"
"github.com/btcsuite/btcd/chaincfg/chainhash"
"github.com/btcsuite/btcd/wire"
"github.com/btcsuite/btcutil"
"github.com/coreos/bbolt"
"github.com/davecgh/go-spew/spew"
"github.com/go-errors/errors"
@@ -24,10 +28,6 @@ import (
"github.com/lightningnetwork/lnd/lnpeer"
"github.com/lightningnetwork/lnd/lnwallet"
"github.com/lightningnetwork/lnd/lnwire"
"github.com/btcsuite/btcd/btcec"
"github.com/btcsuite/btcd/chaincfg/chainhash"
"github.com/btcsuite/btcd/wire"
"github.com/btcsuite/btcutil"
)
const (
@@ -1247,7 +1247,7 @@ func TestChannelLinkExpiryTooSoonExitNode(t *testing.T) {
}
switch ferr.FailureMessage.(type) {
case *lnwire.FailFinalIncorrectCltvExpiry:
case *lnwire.FailFinalExpiryTooSoon:
default:
t.Fatalf("incorrect error, expected final time lock too "+
"early, instead have: %v", err)