multi: fix a-vs-an typos

This commit is contained in:
practicalswift 2018-04-18 04:02:04 +02:00 committed by Olaoluwa Osuntokun
parent 0720e83840
commit 663c396235
45 changed files with 67 additions and 67 deletions

@ -37,7 +37,7 @@ type databaseChannelGraph struct {
// autopilot.ChannelGraph interface. // autopilot.ChannelGraph interface.
var _ ChannelGraph = (*databaseChannelGraph)(nil) var _ ChannelGraph = (*databaseChannelGraph)(nil)
// ChannelGraphFromDatabase returns a instance of the autopilot.ChannelGraph // ChannelGraphFromDatabase returns an instance of the autopilot.ChannelGraph
// backed by a live, open channeldb instance. // backed by a live, open channeldb instance.
func ChannelGraphFromDatabase(db *channeldb.ChannelGraph) ChannelGraph { func ChannelGraphFromDatabase(db *channeldb.ChannelGraph) ChannelGraph {
return &databaseChannelGraph{ return &databaseChannelGraph{
@ -260,7 +260,7 @@ func (d *databaseChannelGraph) addRandChannel(node1, node2 *btcec.PublicKey,
nil nil
} }
// memChannelGraph is a implementation of the autopilot.ChannelGraph backed by // memChannelGraph is an implementation of the autopilot.ChannelGraph backed by
// an in-memory graph. // an in-memory graph.
type memChannelGraph struct { type memChannelGraph struct {
graph map[NodeID]memNode graph map[NodeID]memNode

@ -101,7 +101,7 @@ func (p *ConstrainedPrefAttachment) NeedMoreChans(channels []Channel,
return fundsAvailable, numAdditionalChans, true return fundsAvailable, numAdditionalChans, true
} }
// NodeID is a simple type that holds a EC public key serialized in compressed // NodeID is a simple type that holds an EC public key serialized in compressed
// format. // format.
type NodeID [33]byte type NodeID [33]byte

@ -104,7 +104,7 @@ func (c *Conn) ReadNextMessage() ([]byte, error) {
} }
// Read reads data from the connection. Read can be made to time out and // Read reads data from the connection. Read can be made to time out and
// return a Error with Timeout() == true after a fixed time limit; see // return an Error with Timeout() == true after a fixed time limit; see
// SetDeadline and SetReadDeadline. // SetDeadline and SetReadDeadline.
// //
// Part of the net.Conn interface. // Part of the net.Conn interface.
@ -129,7 +129,7 @@ func (c *Conn) Read(b []byte) (n int, err error) {
} }
// Write writes data to the connection. Write can be made to time out and // Write writes data to the connection. Write can be made to time out and
// return a Error with Timeout() == true after a fixed time limit; see // return an Error with Timeout() == true after a fixed time limit; see
// SetDeadline and SetWriteDeadline. // SetDeadline and SetWriteDeadline.
// //
// Part of the net.Conn interface. // Part of the net.Conn interface.

@ -464,7 +464,7 @@ func (b *Machine) GenActOne() ([ActOneSize]byte, error) {
// RecvActOne processes the act one packet sent by the initiator. The responder // RecvActOne processes the act one packet sent by the initiator. The responder
// executes the mirrored actions to that of the initiator extending the // executes the mirrored actions to that of the initiator extending the
// handshake digest and deriving a new shared secret based on a ECDH with the // handshake digest and deriving a new shared secret based on an ECDH with the
// initiator's ephemeral key and responder's static key. // initiator's ephemeral key and responder's static key.
func (b *Machine) RecvActOne(actOne [ActOneSize]byte) error { func (b *Machine) RecvActOne(actOne [ActOneSize]byte) error {
var ( var (

@ -369,7 +369,7 @@ func testSpendNotification(miner *rpctest.Harness,
t.Fatalf("unable to get current height: %v", err) t.Fatalf("unable to get current height: %v", err)
} }
// Now that we have a output index and the pkScript, register for a // Now that we have an output index and the pkScript, register for a
// spentness notification for the newly created output with multiple // spentness notification for the newly created output with multiple
// clients in order to ensure the implementation can support // clients in order to ensure the implementation can support
// multi-client spend notifications. // multi-client spend notifications.

@ -129,7 +129,7 @@ func (n *NeutrinoNotifier) Start() error {
n.bestHeight = bestHeight n.bestHeight = bestHeight
// Next, we'll create our set of rescan options. Currently it's // Next, we'll create our set of rescan options. Currently it's
// required that a user MUST set a addr/outpoint/txid when creating a // required that a user MUST set an addr/outpoint/txid when creating a
// rescan. To get around this, we'll add a "zero" outpoint, that won't // rescan. To get around this, we'll add a "zero" outpoint, that won't
// actually be matched. // actually be matched.
var zeroHash chainhash.Hash var zeroHash chainhash.Hash

@ -660,7 +660,7 @@ func fetchOpenChannel(chanBucket *bolt.Bucket,
// channels in the database globally, or according to the LinkNode they were // channels in the database globally, or according to the LinkNode they were
// created with. // created with.
// //
// TODO(roasbeef): addr param should eventually be a lnwire.NetAddress type // TODO(roasbeef): addr param should eventually be an lnwire.NetAddress type
// that includes service bits. // that includes service bits.
func (c *OpenChannel) SyncPending(addr net.Addr, pendingHeight uint32) error { func (c *OpenChannel) SyncPending(addr net.Addr, pendingHeight uint32) error {
c.Lock() c.Lock()

@ -65,8 +65,8 @@ var (
// in the bucket, grouping them according to their in/out nodes. // in the bucket, grouping them according to their in/out nodes.
// Additionally, the items in this bucket also contain the complete // Additionally, the items in this bucket also contain the complete
// edge information for a channel. The edge information includes the // edge information for a channel. The edge information includes the
// capacity of the channel, the nodes that made the channel, etc. This // capacity of the channel, the nodes that made the channel, etc. This
// bucket resides within the edgeBucket above. Creation of a edge // bucket resides within the edgeBucket above. Creation of an edge
// proceeds in two phases: first the edge is added to the edge index, // proceeds in two phases: first the edge is added to the edge index,
// afterwards the edgeBucket can be updated with the latest details of // afterwards the edgeBucket can be updated with the latest details of
// the edge as they are announced on the network. // the edge as they are announced on the network.
@ -1244,7 +1244,7 @@ func (l *LightningNode) ForEachChannel(tx *bolt.Tx,
// ChannelEdgeInfo represents a fully authenticated channel along with all its // ChannelEdgeInfo represents a fully authenticated channel along with all its
// unique attributes. Once an authenticated channel announcement has been // unique attributes. Once an authenticated channel announcement has been
// processed on the network, then a instance of ChannelEdgeInfo encapsulating // processed on the network, then an instance of ChannelEdgeInfo encapsulating
// the channels attributes is stored. The other portions relevant to routing // the channels attributes is stored. The other portions relevant to routing
// policy of a channel are stored within a ChannelEdgePolicy for each direction // policy of a channel are stored within a ChannelEdgePolicy for each direction
// of the channel. // of the channel.

@ -482,7 +482,7 @@ func TestDisconnectBlockAtHeight(t *testing.T) {
} }
// Call DisconnectBlockAtHeight, which should prune every channel // Call DisconnectBlockAtHeight, which should prune every channel
// that has an funding height of 'height' or greater. // that has a funding height of 'height' or greater.
removed, err := graph.DisconnectBlockAtHeight(uint32(height)) removed, err := graph.DisconnectBlockAtHeight(uint32(height))
if err != nil { if err != nil {
t.Fatalf("unable to prune %v", err) t.Fatalf("unable to prune %v", err)

@ -45,7 +45,7 @@ const (
// within the database along side incoming/outgoing invoices. // within the database along side incoming/outgoing invoices.
MaxReceiptSize = 1024 MaxReceiptSize = 1024
// MaxPaymentRequestSize is the max size of a a payment request for // MaxPaymentRequestSize is the max size of a payment request for
// this invoice. // this invoice.
// TODO(halseth): determine the max length payment request when field // TODO(halseth): determine the max length payment request when field
// lengths are final. // lengths are final.

@ -147,7 +147,7 @@ func (db *DB) FetchLinkNode(identity *btcec.PublicKey) (*LinkNode, error) {
} }
// If a link node for that particular public key cannot be // If a link node for that particular public key cannot be
// located, then exit early with a ErrNodeNotFound. // located, then exit early with an ErrNodeNotFound.
pubKey := identity.SerializeCompressed() pubKey := identity.SerializeCompressed()
nodeBytes := nodeMetaBucket.Get(pubKey) nodeBytes := nodeMetaBucket.Get(pubKey)
if nodeBytes == nil { if nodeBytes == nil {

@ -98,7 +98,7 @@ type ArbitratorLog interface {
WipeHistory() error WipeHistory() error
} }
// ArbitratorState is a enum that details the current state of the // ArbitratorState is an enum that details the current state of the
// ChannelArbitrator's state machine. // ChannelArbitrator's state machine.
type ArbitratorState uint8 type ArbitratorState uint8
@ -166,7 +166,7 @@ type resolverType uint8
const ( const (
// resolverTimeout is the type of a resolver that's tasked with // resolverTimeout is the type of a resolver that's tasked with
// resolving a outgoing HTLC that is very close to timing out. // resolving an outgoing HTLC that is very close to timing out.
resolverTimeout = 0 resolverTimeout = 0
// resolverSuccess is the type of a resolver that's tasked with // resolverSuccess is the type of a resolver that's tasked with

@ -86,7 +86,7 @@ type ChainArbitratorConfig struct {
// returned. // returned.
IsOurAddress func(btcutil.Address) bool IsOurAddress func(btcutil.Address) bool
// IncubateOutput sends either a incoming HTLC, an outgoing HTLC, or // IncubateOutput sends either an incoming HTLC, an outgoing HTLC, or
// both to the utxo nursery. Once this function returns, the nursery // both to the utxo nursery. Once this function returns, the nursery
// should have safely persisted the outputs to disk, and should start // should have safely persisted the outputs to disk, and should start
// the process of incubation. This is used when a resolver wishes to // the process of incubation. This is used when a resolver wishes to

@ -207,7 +207,7 @@ func (c *chainWatcher) Stop() error {
return nil return nil
} }
// SubscribeChannelEvents returns a n active subscription to the set of channel // SubscribeChannelEvents returns an active subscription to the set of channel
// events for the channel watched by this chain watcher. Once clients no longer // events for the channel watched by this chain watcher. Once clients no longer
// require the subscription, they should call the Cancel() method to allow the // require the subscription, they should call the Cancel() method to allow the
// watcher to regain those committed resources. The syncDispatch bool indicates // watcher to regain those committed resources. The syncDispatch bool indicates

@ -148,7 +148,7 @@ type AuthenticatedGossiper struct {
newBlocks <-chan *chainntnfs.BlockEpoch newBlocks <-chan *chainntnfs.BlockEpoch
// prematureAnnouncements maps a block height to a set of network // prematureAnnouncements maps a block height to a set of network
// messages which are "premature" from our PoV. An message is premature // messages which are "premature" from our PoV. A message is premature
// if it claims to be anchored in a block which is beyond the current // if it claims to be anchored in a block which is beyond the current
// main chain tip as we know it. Premature network messages will be // main chain tip as we know it. Premature network messages will be
// processed once the chain tip as we know it extends to/past the // processed once the chain tip as we know it extends to/past the
@ -168,7 +168,7 @@ type AuthenticatedGossiper struct {
// announcement messages. We use it to buffer half of the material // announcement messages. We use it to buffer half of the material
// needed to reconstruct a full authenticated channel announcement. // needed to reconstruct a full authenticated channel announcement.
// Once we receive the other half the channel proof, we'll be able to // Once we receive the other half the channel proof, we'll be able to
// properly validate it an re-broadcast it out to the network. // properly validate it and re-broadcast it out to the network.
waitingProofs *channeldb.WaitingProofStore waitingProofs *channeldb.WaitingProofStore
// networkMsgs is a channel that carries new network broadcasted // networkMsgs is a channel that carries new network broadcasted

@ -7,7 +7,7 @@ import (
"github.com/lightningnetwork/lnd/lnwire" "github.com/lightningnetwork/lnd/lnwire"
) )
// packetQueue is an goroutine-safe queue of htlc packets which over flow the // packetQueue is a goroutine-safe queue of htlc packets which over flow the
// current commitment transaction. An HTLC will overflow the current commitment // current commitment transaction. An HTLC will overflow the current commitment
// transaction if one attempts to add a new HTLC to the state machine which // transaction if one attempts to add a new HTLC to the state machine which
// already has the max number of pending HTLC's present on the commitment // already has the max number of pending HTLC's present on the commitment

@ -52,7 +52,7 @@ type pendingPayment struct {
response chan *htlcPacket response chan *htlcPacket
err chan error err chan error
// deobfuscator is an serializable entity which is used if we received // deobfuscator is a serializable entity which is used if we received
// an error, it deobfuscates the onion failure blob, and extracts the // an error, it deobfuscates the onion failure blob, and extracts the
// exact error from it. // exact error from it.
deobfuscator ErrorDecrypter deobfuscator ErrorDecrypter
@ -65,7 +65,7 @@ type plexPacket struct {
err chan error err chan error
} }
// ChannelCloseType is a enum which signals the type of channel closure the // ChannelCloseType is an enum which signals the type of channel closure the
// peer should execute. // peer should execute.
type ChannelCloseType uint8 type ChannelCloseType uint8

@ -591,7 +591,7 @@ type threeHopNetwork struct {
} }
// generateHops creates the per hop payload, the total amount to be sent, and // generateHops creates the per hop payload, the total amount to be sent, and
// also the time lock value needed to route a HTLC with the target amount over // also the time lock value needed to route an HTLC with the target amount over
// the specified path. // the specified path.
func generateHops(payAmt lnwire.MilliSatoshi, startingHeight uint32, func generateHops(payAmt lnwire.MilliSatoshi, startingHeight uint32,
path ...*channelLink) (lnwire.MilliSatoshi, uint32, []ForwardingInfo) { path ...*channelLink) (lnwire.MilliSatoshi, uint32, []ForwardingInfo) {

@ -1784,7 +1784,7 @@ func testChannelForceClosure(net *lntest.NetworkHarness, t *harnessTest) {
time.Sleep(duration) time.Sleep(duration)
// We now restart Alice, to ensure that she will broadcast the presigned // We now restart Alice, to ensure that she will broadcast the presigned
// htlc timeout txns after the delay expires after experiencing an while // htlc timeout txns after the delay expires after experiencing a while
// waiting for the htlc outputs to incubate. // waiting for the htlc outputs to incubate.
if err := net.RestartNode(net.Alice, nil); err != nil { if err := net.RestartNode(net.Alice, nil); err != nil {
t.Fatalf("Node restart failed: %v", err) t.Fatalf("Node restart failed: %v", err)
@ -4991,7 +4991,7 @@ func testAsyncPayments(net *lntest.NetworkHarness, t *harnessTest) {
// Initialize seed random in order to generate invoices. // Initialize seed random in order to generate invoices.
prand.Seed(time.Now().UnixNano()) prand.Seed(time.Now().UnixNano())
// With the channel open, we'll create a invoices for Bob that Alice // With the channel open, we'll create invoices for Bob that Alice
// will pay to in order to advance the state of the channel. // will pay to in order to advance the state of the channel.
bobPayReqs := make([]string, numInvoices) bobPayReqs := make([]string, numInvoices)
for i := 0; i < numInvoices; i++ { for i := 0; i < numInvoices; i++ {
@ -5169,7 +5169,7 @@ func testBidirectionalAsyncPayments(net *lntest.NetworkHarness, t *harnessTest)
// Initialize seed random in order to generate invoices. // Initialize seed random in order to generate invoices.
prand.Seed(time.Now().UnixNano()) prand.Seed(time.Now().UnixNano())
// With the channel open, we'll create a invoices for Bob that Alice // With the channel open, we'll create invoices for Bob that Alice
// will pay to in order to advance the state of the channel. // will pay to in order to advance the state of the channel.
bobPayReqs := make([]string, numInvoices) bobPayReqs := make([]string, numInvoices)
for i := 0; i < numInvoices; i++ { for i := 0; i < numInvoices; i++ {
@ -5192,7 +5192,7 @@ func testBidirectionalAsyncPayments(net *lntest.NetworkHarness, t *harnessTest)
bobPayReqs[i] = resp.PaymentRequest bobPayReqs[i] = resp.PaymentRequest
} }
// With the channel open, we'll create a invoices for Alice that Bob // With the channel open, we'll create invoices for Alice that Bob
// will pay to in order to advance the state of the channel. // will pay to in order to advance the state of the channel.
alicePayReqs := make([]string, numInvoices) alicePayReqs := make([]string, numInvoices)
for i := 0; i < numInvoices; i++ { for i := 0; i < numInvoices; i++ {

@ -1247,7 +1247,7 @@ message RoutingPolicy {
/** /**
A fully authenticated channel along with all its unique attributes. A fully authenticated channel along with all its unique attributes.
Once an authenticated channel announcement has been processed on the network, Once an authenticated channel announcement has been processed on the network,
then a instance of ChannelEdgeInfo encapsulating the channels attributes is then an instance of ChannelEdgeInfo encapsulating the channels attributes is
stored. The other portions relevant to routing policy of a channel are stored stored. The other portions relevant to routing policy of a channel are stored
within a ChannelEdgePolicy for each direction of the channel. within a ChannelEdgePolicy for each direction of the channel.
*/ */

@ -1056,7 +1056,7 @@
"$ref": "#/definitions/lnrpcRoutingPolicy" "$ref": "#/definitions/lnrpcRoutingPolicy"
} }
}, },
"description": "*\nA fully authenticated channel along with all its unique attributes.\nOnce an authenticated channel announcement has been processed on the network,\nthen a instance of ChannelEdgeInfo encapsulating the channels attributes is\nstored. The other portions relevant to routing policy of a channel are stored\nwithin a ChannelEdgePolicy for each direction of the channel." "description": "*\nA fully authenticated channel along with all its unique attributes.\nOnce an authenticated channel announcement has been processed on the network,\nthen an instance of ChannelEdgeInfo encapsulating the channels attributes is\nstored. The other portions relevant to routing policy of a channel are stored\nwithin a ChannelEdgePolicy for each direction of the channel."
}, },
"lnrpcChannelEdgeUpdate": { "lnrpcChannelEdgeUpdate": {
"type": "object", "type": "object",

@ -602,7 +602,7 @@ func (hn *HarnessNode) lightningNetworkWatcher() {
// TODO(roasbeef): add update type also, checks for // TODO(roasbeef): add update type also, checks for
// multiple of 2 // multiple of 2
if watchRequest.chanOpen { if watchRequest.chanOpen {
// If this is a open request, then it can be // If this is an open request, then it can be
// dispatched if the number of edges seen for // dispatched if the number of edges seen for
// the channel is at least two. // the channel is at least two.
if numEdges := openChans[targetChan]; numEdges >= 2 { if numEdges := openChans[targetChan]; numEdges >= 2 {

@ -283,7 +283,7 @@ func (b *BtcWallet) LockOutpoint(o wire.OutPoint) {
b.wallet.LockOutpoint(o) b.wallet.LockOutpoint(o)
} }
// UnlockOutpoint unlocks an previously locked output, marking it eligible for // UnlockOutpoint unlocks a previously locked output, marking it eligible for
// coin selection. // coin selection.
// //
// This is a part of the WalletController interface. // This is a part of the WalletController interface.
@ -515,7 +515,7 @@ func minedTransactionsToDetails(
} }
// unminedTransactionsToDetail is a helper function which converts a summary // unminedTransactionsToDetail is a helper function which converts a summary
// for a unconfirmed transaction to a transaction detail. // for an unconfirmed transaction to a transaction detail.
func unminedTransactionsToDetail( func unminedTransactionsToDetail(
summary base.TransactionSummary, summary base.TransactionSummary,
) (*lnwallet.TransactionDetail, error) { ) (*lnwallet.TransactionDetail, error) {

@ -2556,8 +2556,8 @@ func genRemoteHtlcSigJobs(keyRing *CommitmentKeyRing,
feePerKw := remoteCommitView.feePerKw feePerKw := remoteCommitView.feePerKw
// With the keys generated, we'll make a slice with enough capacity to // With the keys generated, we'll make a slice with enough capacity to
// hold potentially all the HTLC's. The actual slice may be a bit // hold potentially all the HTLCs. The actual slice may be a bit
// smaller (than its total capacity) an some HTLC's may be dust. // smaller (than its total capacity) and some HTLCs may be dust.
numSigs := (len(remoteCommitView.incomingHTLCs) + numSigs := (len(remoteCommitView.incomingHTLCs) +
len(remoteCommitView.outgoingHTLCs)) len(remoteCommitView.outgoingHTLCs))
sigBatch := make([]signJob, 0, numSigs) sigBatch := make([]signJob, 0, numSigs)
@ -2565,7 +2565,7 @@ func genRemoteHtlcSigJobs(keyRing *CommitmentKeyRing,
var err error var err error
cancelChan := make(chan struct{}) cancelChan := make(chan struct{})
// For ech outgoing and incoming HTLC, if the HTLC isn't considered a // For each outgoing and incoming HTLC, if the HTLC isn't considered a
// dust output after taking into account second-level HTLC fees, then a // dust output after taking into account second-level HTLC fees, then a
// sigJob will be generated and appended to the current batch. // sigJob will be generated and appended to the current batch.
for _, htlc := range remoteCommitView.incomingHTLCs { for _, htlc := range remoteCommitView.incomingHTLCs {

@ -3026,7 +3026,7 @@ func TestChanSyncOweCommitment(t *testing.T) {
for i := 0; i < 3; i++ { for i := 0; i < 3; i++ {
settleMsg, ok := aliceMsgsToSend[i].(*lnwire.UpdateFulfillHTLC) settleMsg, ok := aliceMsgsToSend[i].(*lnwire.UpdateFulfillHTLC)
if !ok { if !ok {
t.Fatalf("expected a htlc settle message, "+ t.Fatalf("expected an HTLC settle message, "+
"instead have %v", spew.Sdump(settleMsg)) "instead have %v", spew.Sdump(settleMsg))
} }
if settleMsg.ID != uint64(i) { if settleMsg.ID != uint64(i) {
@ -3045,7 +3045,7 @@ func TestChanSyncOweCommitment(t *testing.T) {
// The HTLC add message should be identical. // The HTLC add message should be identical.
if _, ok := aliceMsgsToSend[3].(*lnwire.UpdateAddHTLC); !ok { if _, ok := aliceMsgsToSend[3].(*lnwire.UpdateAddHTLC); !ok {
t.Fatalf("expected a htlc add message, instead have %v", t.Fatalf("expected an HTLC add message, instead have %v",
spew.Sdump(aliceMsgsToSend[3])) spew.Sdump(aliceMsgsToSend[3]))
} }
if !reflect.DeepEqual(aliceHtlc, aliceMsgsToSend[3]) { if !reflect.DeepEqual(aliceHtlc, aliceMsgsToSend[3]) {

@ -15,7 +15,7 @@ import (
// to spend a specified output. // to spend a specified output.
var ErrNotMine = errors.New("the passed output doesn't belong to the wallet") var ErrNotMine = errors.New("the passed output doesn't belong to the wallet")
// AddressType is a enum-like type which denotes the possible address types // AddressType is an enum-like type which denotes the possible address types
// WalletController supports. // WalletController supports.
type AddressType uint8 type AddressType uint8
@ -169,7 +169,7 @@ type WalletController interface {
// usage when funding a channel. // usage when funding a channel.
LockOutpoint(o wire.OutPoint) LockOutpoint(o wire.OutPoint)
// UnlockOutpoint unlocks an previously locked output, marking it // UnlockOutpoint unlocks a previously locked output, marking it
// eligible for coin selection. // eligible for coin selection.
UnlockOutpoint(o wire.OutPoint) UnlockOutpoint(o wire.OutPoint)

@ -726,7 +726,7 @@ func createHtlcSuccessTx(htlcOutput wire.OutPoint, htlcAmt btcutil.Amount,
// secondLevelHtlcScript is the uniform script that's used as the output for // secondLevelHtlcScript is the uniform script that's used as the output for
// the second-level HTLC transactions. The second level transaction act as a // the second-level HTLC transactions. The second level transaction act as a
// sort of covenant, ensuring that an 2-of-2 multi-sig output can only be // sort of covenant, ensuring that a 2-of-2 multi-sig output can only be
// spent in a particular way, and to a particular output. // spent in a particular way, and to a particular output.
// //
// Possible Input Scripts: // Possible Input Scripts:
@ -809,7 +809,7 @@ func htlcSpendSuccess(signer Signer, signDesc *SignDescriptor,
// this instance. // this instance.
signDesc.SigHashes = txscript.NewTxSigHashes(sweepTx) signDesc.SigHashes = txscript.NewTxSigHashes(sweepTx)
// With the proper sequence an version set, we'll now sign the timeout // With the proper sequence and version set, we'll now sign the timeout
// transaction using the passed signed descriptor. In order to generate // transaction using the passed signed descriptor. In order to generate
// a valid signature, then signDesc should be using the base delay // a valid signature, then signDesc should be using the base delay
// public key, and the proper single tweak bytes. // public key, and the proper single tweak bytes.
@ -865,7 +865,7 @@ func htlcSpendRevoke(signer Signer, signDesc *SignDescriptor,
func HtlcSecondLevelSpend(signer Signer, signDesc *SignDescriptor, func HtlcSecondLevelSpend(signer Signer, signDesc *SignDescriptor,
sweepTx *wire.MsgTx) (wire.TxWitness, error) { sweepTx *wire.MsgTx) (wire.TxWitness, error) {
// With the proper sequence an version set, we'll now sign the timeout // With the proper sequence and version set, we'll now sign the timeout
// transaction using the passed signed descriptor. In order to generate // transaction using the passed signed descriptor. In order to generate
// a valid signature, then signDesc should be using the base delay // a valid signature, then signDesc should be using the base delay
// public key, and the proper single tweak bytes. // public key, and the proper single tweak bytes.

@ -8,7 +8,7 @@ import (
) )
// AcceptChannel is the message Bob sends to Alice after she initiates the // AcceptChannel is the message Bob sends to Alice after she initiates the
// single funder channel workflow via a AcceptChannel message. Once Alice // single funder channel workflow via an AcceptChannel message. Once Alice
// receives Bob's response, then she has all the items necessary to construct // receives Bob's response, then she has all the items necessary to construct
// the funding transaction, and both commitment transactions. // the funding transaction, and both commitment transactions.
type AcceptChannel struct { type AcceptChannel struct {
@ -141,7 +141,7 @@ func (a *AcceptChannel) Decode(r io.Reader, pver uint32) error {
} }
// MsgType returns the MessageType code which uniquely identifies this message // MsgType returns the MessageType code which uniquely identifies this message
// as a AcceptChannel on the wire. // as an AcceptChannel on the wire.
// //
// This is part of the lnwire.Message interface. // This is part of the lnwire.Message interface.
func (a *AcceptChannel) MsgType() MessageType { func (a *AcceptChannel) MsgType() MessageType {

@ -28,7 +28,7 @@ type CommitSig struct {
// created commitment. The order of the signatures is expected to be // created commitment. The order of the signatures is expected to be
// identical to the placement of the HTLC's within the BIP 69 sorted // identical to the placement of the HTLC's within the BIP 69 sorted
// commitment transaction. For each outgoing HTLC (from the PoV of the // commitment transaction. For each outgoing HTLC (from the PoV of the
// sender of this message), a signature for a HTLC timeout transaction // sender of this message), a signature for an HTLC timeout transaction
// should be signed, for each incoming HTLC the HTLC timeout // should be signed, for each incoming HTLC the HTLC timeout
// transaction should be signed. // transaction should be signed.
HtlcSigs []Sig HtlcSigs []Sig

@ -117,7 +117,7 @@ func (c *Error) MsgType() MessageType {
return MsgError return MsgError
} }
// MaxPayloadLength returns the maximum allowed payload size for a Error // MaxPayloadLength returns the maximum allowed payload size for an Error
// complete message observing the specified protocol version. // complete message observing the specified protocol version.
// //
// This is part of the lnwire.Message interface. // This is part of the lnwire.Message interface.

@ -58,7 +58,7 @@ func (msg *Init) MsgType() MessageType {
return MsgInit return MsgInit
} }
// MaxPayloadLength returns the maximum allowed payload size for a Init // MaxPayloadLength returns the maximum allowed payload size for an Init
// complete message observing the specified protocol version. // complete message observing the specified protocol version.
// //
// This is part of the lnwire.Message interface. // This is part of the lnwire.Message interface.

@ -185,7 +185,7 @@ func (o *OpenChannel) Decode(r io.Reader, pver uint32) error {
} }
// MsgType returns the MessageType code which uniquely identifies this message // MsgType returns the MessageType code which uniquely identifies this message
// as a OpenChannel on the wire. // as an OpenChannel on the wire.
// //
// This is part of the lnwire.Message interface. // This is part of the lnwire.Message interface.
func (o *OpenChannel) MsgType() MessageType { func (o *OpenChannel) MsgType() MessageType {

@ -99,7 +99,7 @@ func (c *UpdateAddHTLC) MsgType() MessageType {
return MsgUpdateAddHTLC return MsgUpdateAddHTLC
} }
// MaxPayloadLength returns the maximum allowed payload size for a UpdateAddHTLC // MaxPayloadLength returns the maximum allowed payload size for an UpdateAddHTLC
// complete message observing the specified protocol version. // complete message observing the specified protocol version.
// //
// This is part of the lnwire.Message interface. // This is part of the lnwire.Message interface.

@ -62,7 +62,7 @@ func (c *UpdateFailHTLC) MsgType() MessageType {
return MsgUpdateFailHTLC return MsgUpdateFailHTLC
} }
// MaxPayloadLength returns the maximum allowed payload size for a UpdateFailHTLC // MaxPayloadLength returns the maximum allowed payload size for an UpdateFailHTLC
// complete message observing the specified protocol version. // complete message observing the specified protocol version.
// //
// This is part of the lnwire.Message interface. // This is part of the lnwire.Message interface.

@ -60,7 +60,7 @@ func (c *UpdateFee) MsgType() MessageType {
return MsgUpdateFee return MsgUpdateFee
} }
// MaxPayloadLength returns the maximum allowed payload size for a UpdateFee // MaxPayloadLength returns the maximum allowed payload size for an UpdateFee
// complete message observing the specified protocol version. // complete message observing the specified protocol version.
// //
// This is part of the lnwire.Message interface. // This is part of the lnwire.Message interface.

@ -68,7 +68,7 @@ func (c *UpdateFulfillHTLC) MsgType() MessageType {
return MsgUpdateFulfillHTLC return MsgUpdateFulfillHTLC
} }
// MaxPayloadLength returns the maximum allowed payload size for a UpdateFulfillHTLC // MaxPayloadLength returns the maximum allowed payload size for an UpdateFulfillHTLC
// complete message observing the specified protocol version. // complete message observing the specified protocol version.
// //
// This is part of the lnwire.Message interface. // This is part of the lnwire.Message interface.

@ -1041,7 +1041,7 @@ func (ns *nurseryStore) enterPreschool(tx *bolt.Tx, kid *kidOutput) error {
return err return err
} }
// We'll first check if a entry for this key is already stored. If so, // We'll first check if an entry for this key is already stored. If so,
// then we'll ignore this request, and return a nil error. // then we'll ignore this request, and return a nil error.
if rawBytes := chanBucket.Get(pfxOutputKey); rawBytes != nil { if rawBytes := chanBucket.Get(pfxOutputKey); rawBytes != nil {
return nil return nil

@ -53,7 +53,7 @@ type outgoingMsg struct {
errChan chan error // MUST be buffered. errChan chan error // MUST be buffered.
} }
// newChannelMsg packages a lnwallet.LightningChannel with a channel that // newChannelMsg packages an lnwallet.LightningChannel with a channel that
// allows the receiver of the request to report when the funding transaction // allows the receiver of the request to report when the funding transaction
// has been confirmed and the channel creation process completed. // has been confirmed and the channel creation process completed.
type newChannelMsg struct { type newChannelMsg struct {

@ -19,7 +19,7 @@ type FilteredChainView interface {
// sent over. Each time a block is connected to the end of a main // sent over. Each time a block is connected to the end of a main
// chain, and appropriate FilteredBlock which contains the transactions // chain, and appropriate FilteredBlock which contains the transactions
// which mutate our watched UTXO set is to be returned. In case of a // which mutate our watched UTXO set is to be returned. In case of a
// UpdateFilter call with a updateHeight lower than the current best // UpdateFilter call with an updateHeight lower than the current best
// height, blocks with the updated filter will be resent, and must be // height, blocks with the updated filter will be resent, and must be
// handled by the receiver as an update to an already known block, NOT // handled by the receiver as an update to an already known block, NOT
// as a new block being connected to the chain. // as a new block being connected to the chain.

@ -55,7 +55,7 @@ var _ FilteredChainView = (*CfFilteredChainView)(nil)
// NewCfFilteredChainView creates a new instance of the CfFilteredChainView // NewCfFilteredChainView creates a new instance of the CfFilteredChainView
// which is connected to an active neutrino node. // which is connected to an active neutrino node.
// //
// NOTE: The node should already be running an syncing before being passed into // NOTE: The node should already be running and syncing before being passed into
// this function. // this function.
func NewCfFilteredChainView(node *neutrino.ChainService) (*CfFilteredChainView, error) { func NewCfFilteredChainView(node *neutrino.ChainService) (*CfFilteredChainView, error) {
return &CfFilteredChainView{ return &CfFilteredChainView{
@ -93,7 +93,7 @@ func (c *CfFilteredChainView) Start() error {
} }
// Next, we'll create our set of rescan options. Currently it's // Next, we'll create our set of rescan options. Currently it's
// required that a user MUST set a addr/outpoint/txid when creating a // required that an user MUST set a addr/outpoint/txid when creating a
// rescan. To get around this, we'll add a "zero" outpoint, that won't // rescan. To get around this, we'll add a "zero" outpoint, that won't
// actually be matched. // actually be matched.
var zeroPoint wire.OutPoint var zeroPoint wire.OutPoint

@ -61,7 +61,7 @@ func (e *routerError) Error() string {
// A compile time check to ensure routerError implements the error interface. // A compile time check to ensure routerError implements the error interface.
var _ error = (*routerError)(nil) var _ error = (*routerError)(nil)
// newErr creates an routerError by the given error description and its // newErr creates a routerError by the given error description and its
// corresponding error code. // corresponding error code.
func newErr(code errorCode, a interface{}) *routerError { func newErr(code errorCode, a interface{}) *routerError {
return &routerError{ return &routerError{
@ -70,7 +70,7 @@ func newErr(code errorCode, a interface{}) *routerError {
} }
} }
// newErrf creates an routerError by the given error formatted description and // newErrf creates a routerError by the given error formatted description and
// its corresponding error code. // its corresponding error code.
func newErrf(code errorCode, format string, a ...interface{}) *routerError { func newErrf(code errorCode, format string, a ...interface{}) *routerError {
return &routerError{ return &routerError{

@ -1697,7 +1697,7 @@ func (r *ChannelRouter) SendPayment(payment *LightningPayment) ([32]byte, *Route
// If the onion error includes a channel update, and // If the onion error includes a channel update, and
// isn't necessarily fatal, then we'll apply the update // isn't necessarily fatal, then we'll apply the update
// an continue with the rest of the routes. // and continue with the rest of the routes.
case *lnwire.FailAmountBelowMinimum: case *lnwire.FailAmountBelowMinimum:
update := onionErr.Update update := onionErr.Update
if err := r.applyChannelUpdate(&update); err != nil { if err := r.applyChannelUpdate(&update); err != nil {

@ -44,7 +44,7 @@ type ValidationBarrier struct {
// NewValidationBarrier creates a new instance of a validation barrier given // NewValidationBarrier creates a new instance of a validation barrier given
// the total number of active requests, and a quit channel which will be used // the total number of active requests, and a quit channel which will be used
// to know when to kill an pending, but unfilled jobs. // to know when to kill pending, but unfilled jobs.
func NewValidationBarrier(numActiveReqs int, func NewValidationBarrier(numActiveReqs int,
quitChan chan struct{}) *ValidationBarrier { quitChan chan struct{}) *ValidationBarrier {

@ -1096,7 +1096,7 @@ func (r *rpcServer) CloseChannel(in *lnrpc.CloseChannelRequest,
if feeRate == 0 { if feeRate == 0 {
// If the fee rate returned isn't usable, then we'll // If the fee rate returned isn't usable, then we'll
// fall back to an lax fee estimate. // fall back to a lax fee estimate.
feeRate, err = r.server.cc.feeEstimator.EstimateFeePerVSize(6) feeRate, err = r.server.cc.feeEstimator.EstimateFeePerVSize(6)
if err != nil { if err != nil {
return err return err

@ -351,7 +351,7 @@ func (u *utxoNursery) IncubateOutputs(chanPoint wire.OutPoint,
// Kid outputs can be swept after an initial confirmation // Kid outputs can be swept after an initial confirmation
// followed by a maturity period.Baby outputs are two stage and // followed by a maturity period.Baby outputs are two stage and
// will need to wait for a absolute time out to reach a // will need to wait for an absolute time out to reach a
// confirmation, then require a relative confirmation delay. // confirmation, then require a relative confirmation delay.
kidOutputs = make([]kidOutput, 0, 1+len(incomingHtlcs)) kidOutputs = make([]kidOutput, 0, 1+len(incomingHtlcs))
babyOutputs = make([]babyOutput, 0, len(outgoingHtlcs)) babyOutputs = make([]babyOutput, 0, len(outgoingHtlcs))
@ -918,7 +918,7 @@ func (u *utxoNursery) createSweepTx(kgtnOutputs []kidOutput,
classHeight uint32) (*wire.MsgTx, error) { classHeight uint32) (*wire.MsgTx, error) {
// Create a transaction which sweeps all the newly mature outputs into // Create a transaction which sweeps all the newly mature outputs into
// a output controlled by the wallet. // an output controlled by the wallet.
// TODO(roasbeef): can be more intelligent about buffering outputs to // TODO(roasbeef): can be more intelligent about buffering outputs to
// be more efficient on-chain. // be more efficient on-chain.
@ -1541,7 +1541,7 @@ func (c *contractMaturityReport) AddLimboStage2Htlc(kid *kidOutput) {
c.htlcs = append(c.htlcs, htlcReport) c.htlcs = append(c.htlcs, htlcReport)
} }
// AddRecoveredHtlc adds an graduate output to the maturity report's htlcs, and // AddRecoveredHtlc adds a graduate output to the maturity report's htlcs, and
// contributes its amount to the recovered balance. // contributes its amount to the recovered balance.
func (c *contractMaturityReport) AddRecoveredHtlc(kid *kidOutput) { func (c *contractMaturityReport) AddRecoveredHtlc(kid *kidOutput) {
c.recoveredBalance += kid.Amount() c.recoveredBalance += kid.Amount()