From 5d0a35e1f6f009878fc2d573017b56863bb056c7 Mon Sep 17 00:00:00 2001 From: Slyghtning Date: Thu, 17 Aug 2023 13:31:10 +0200 Subject: [PATCH] typos: fix godoc and style --- loopd/daemon.go | 2 +- swap/htlc.go | 21 +++++++++++---------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/loopd/daemon.go b/loopd/daemon.go index 0d02385..60075f9 100644 --- a/loopd/daemon.go +++ b/loopd/daemon.go @@ -546,7 +546,7 @@ func (d *Daemon) initialize(withMacaroonService bool) error { case <-d.quit: } - // We need to shutdown before sending the error on the channel, + // We need to shut down before sending the error on the channel, // otherwise a caller might exit the process too early. d.stop() cleanupMacaroonStore() diff --git a/swap/htlc.go b/swap/htlc.go index daa7ef3..196f77b 100644 --- a/swap/htlc.go +++ b/swap/htlc.go @@ -41,7 +41,7 @@ const ( HtlcV3 ) -// htlcScript defines an interface for the different HTLC implementations. +// HtlcScript defines an interface for the different HTLC implementations. type HtlcScript interface { // genSuccessWitness returns the success script to spend this htlc with // the preimage. @@ -186,8 +186,8 @@ func NewHtlcV2(cltvExpiry int32, senderKey, receiverKey [33]byte, }, nil } -// NewHtlcV3 returns a new V3 HTLC (P2TR) instance. Internal pubkey generated -// by both participants must be provided. +// NewHtlcV3 returns a new V3 HTLC (P2TR) instance. Internal pubkey generated by +// both participants must be provided. func NewHtlcV3(muSig2Version input.MuSig2Version, cltvExpiry int32, senderInternalKey, receiverInternalKey, senderKey, receiverKey [33]byte, hash lntypes.Hash, chainParams *chaincfg.Params) (*Htlc, error) { @@ -524,10 +524,11 @@ func parsePubKey(muSig2Version input.MuSig2Version, key [33]byte) ( } } -// newHTLCScriptV3 constructs a HtlcScipt with the HTLC V3 taproot script. +// newHTLCScriptV3 constructs a HtlcScript with the HTLC V3 taproot script. func newHTLCScriptV3(muSig2Version input.MuSig2Version, cltvExpiry int32, senderInternalKey, receiverInternalKey, senderHtlcKey, - receiverHtlcKey [33]byte, swapHash lntypes.Hash) (*HtlcScriptV3, error) { + receiverHtlcKey [33]byte, swapHash lntypes.Hash) (*HtlcScriptV3, + error) { senderPubKey, err := parsePubKey(muSig2Version, senderHtlcKey) if err != nil { @@ -539,8 +540,8 @@ func newHTLCScriptV3(muSig2Version input.MuSig2Version, cltvExpiry int32, return nil, err } - // Create our success path script, we'll use this separately - // to generate the success path leaf. + // Create our success path script, we'll use this separately to generate + // the success path leaf. successPathScript, err := GenSuccessPathScript( receiverPubKey, swapHash, ) @@ -674,8 +675,8 @@ func (h *HtlcScriptV3) genControlBlock(leafScript []byte) ([]byte, error) { return controlBlock.ToBytes() } -// genSuccessWitness returns the success script to spend this htlc with -// the preimage. +// genSuccessWitness returns the success script to spend this htlc with the +// preimage. func (h *HtlcScriptV3) genSuccessWitness( receiverSig []byte, preimage lntypes.Preimage) (wire.TxWitness, error) { @@ -777,7 +778,7 @@ func (h *HtlcScriptV3) SuccessSequence() uint32 { return 1 } -// Sighash is the signature hash to use for transactions spending from the htlc. +// SigHash is the signature hash to use for transactions spending from the htlc. func (h *HtlcScriptV3) SigHash() txscript.SigHashType { return txscript.SigHashDefault }