lnwallet: make addHtlc non-LightningChannel method

It has no dependency on LightningChannel
This commit is contained in:
Johan T. Halseth 2020-01-06 11:42:02 +01:00
parent f0019006a7
commit e2b050aca3
No known key found for this signature in database
GPG Key ID: 15BAADA29DA20D26

@ -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 {