From e2b050aca3d57782c9b6d3145c8c2356f0e6d27f Mon Sep 17 00:00:00 2001 From: "Johan T. Halseth" Date: Mon, 6 Jan 2020 11:42:02 +0100 Subject: [PATCH] lnwallet: make addHtlc non-LightningChannel method It has no dependency on LightningChannel --- lnwallet/channel.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lnwallet/channel.go b/lnwallet/channel.go index b4bbe7f6..b1523db6 100644 --- a/lnwallet/channel.go +++ b/lnwallet/channel.go @@ -2467,7 +2467,7 @@ func (lc *LightningChannel) createCommitmentTx(c *commitment, continue } - err := lc.addHTLC(commitTx, c.isOurs, false, htlc, keyRing) + err := addHTLC(commitTx, c.isOurs, false, htlc, keyRing) if err != nil { return err } @@ -2479,7 +2479,7 @@ func (lc *LightningChannel) createCommitmentTx(c *commitment, continue } - err := lc.addHTLC(commitTx, c.isOurs, true, htlc, keyRing) + err := addHTLC(commitTx, c.isOurs, true, htlc, keyRing) if err != nil { return err } @@ -4995,7 +4995,7 @@ func genHtlcScript(isIncoming, ourCommit bool, timeout uint32, rHash [32]byte, // locate the added HTLC on the commitment transaction from the // PaymentDescriptor that generated it, the generated script is stored within // the descriptor itself. -func (lc *LightningChannel) addHTLC(commitTx *wire.MsgTx, ourCommit bool, +func addHTLC(commitTx *wire.MsgTx, ourCommit bool, isIncoming bool, paymentDesc *PaymentDescriptor, keyRing *CommitmentKeyRing) error {