From 1b4862d8154744543012cee94830d9a0babbb7ad Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Wed, 10 May 2017 17:43:11 -0700 Subject: [PATCH] lnwallet: use new ChainNotifier API, typo fixes --- chainntnfs/interface.go | 6 +++--- lnwallet/channel.go | 3 ++- lnwallet/script_utils.go | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/chainntnfs/interface.go b/chainntnfs/interface.go index 7ee1817df..23a65db9c 100644 --- a/chainntnfs/interface.go +++ b/chainntnfs/interface.go @@ -89,7 +89,7 @@ type TxConfirmation struct { // disconnected from the blockchain as a result of a re-org. // // Once the txid reaches the specified number of confirmations, the 'Confirmed' -// channel will be sent upon fufulling the notification. +// channel will be sent upon fulfilling the notification. // // If the event that the original transaction becomes re-org'd out of the main // chain, the 'NegativeConf' will be sent upon with a value representing the @@ -133,7 +133,7 @@ type SpendEvent struct { Spend <-chan *SpendDetail // MUST be buffered. // Cancel is a closure that should be executed by the caller in the - // case that they wish to prematurely abandon their regsitered spend + // case that they wish to prematurely abandon their registered spend // notification. Cancel func() } @@ -141,7 +141,7 @@ type SpendEvent struct { // BlockEpoch represents metadata concerning each new block connected to the // main chain. type BlockEpoch struct { - // Hash is the block hash of the latest blcok to be added to the tip of + // Hash is the block hash of the latest block to be added to the tip of // the main chain. Hash *chainhash.Hash diff --git a/lnwallet/channel.go b/lnwallet/channel.go index 0762e6216..e27ca0f97 100644 --- a/lnwallet/channel.go +++ b/lnwallet/channel.go @@ -775,7 +775,8 @@ func NewLightningChannel(signer Signer, events chainntnfs.ChainNotifier, // the remote party has broadcasted a commitment transaction // on-chain. fundingOut := &lc.fundingTxIn.PreviousOutPoint - channelCloseNtfn, err := lc.channelEvents.RegisterSpendNtfn(fundingOut) + openHeight := lc.channelState.OpeningHeight + channelCloseNtfn, err := lc.channelEvents.RegisterSpendNtfn(fundingOut, openHeight) if err != nil { return nil, err } diff --git a/lnwallet/script_utils.go b/lnwallet/script_utils.go index 9f189197f..012335741 100644 --- a/lnwallet/script_utils.go +++ b/lnwallet/script_utils.go @@ -69,8 +69,8 @@ func genMultiSigScript(aPub, bPub []byte) ([]byte, error) { // Swap to sort pubkeys if needed. Keys are sorted in lexicographical // order. The signatures within the scriptSig must also adhere to the - // order, ensuring that the signatures for each public key appears - // in the proper order on the stack. + // order, ensuring that the signatures for each public key appears in + // the proper order on the stack. if bytes.Compare(aPub, bPub) == -1 { aPub, bPub = bPub, aPub }