lnwallet: update line wrapping to project style where needed

This commit is contained in:
Olaoluwa Osuntokun 2019-03-08 16:05:28 -08:00
parent 032eacb796
commit 49c38ed56d
No known key found for this signature in database
GPG Key ID: CE58F7F8E20FD9A2

@ -3067,8 +3067,9 @@ func (lc *LightningChannel) SignNextCommitment() (lnwire.Sig, []lnwire.Sig, erro
// ensure that we aren't violating any of the constraints the remote // ensure that we aren't violating any of the constraints the remote
// party set up when we initially set up the channel. If we are, then // party set up when we initially set up the channel. If we are, then
// we'll abort this state transition. // we'll abort this state transition.
err := lc.validateCommitmentSanity(remoteACKedIndex, err := lc.validateCommitmentSanity(
lc.localUpdateLog.logIndex, true, nil) remoteACKedIndex, lc.localUpdateLog.logIndex, true, nil,
)
if err != nil { if err != nil {
return sig, htlcSigs, err return sig, htlcSigs, err
} }
@ -3076,8 +3077,9 @@ func (lc *LightningChannel) SignNextCommitment() (lnwire.Sig, []lnwire.Sig, erro
// Grab the next commitment point for the remote party. This will be // Grab the next commitment point for the remote party. This will be
// used within fetchCommitmentView to derive all the keys necessary to // used within fetchCommitmentView to derive all the keys necessary to
// construct the commitment state. // construct the commitment state.
keyRing := deriveCommitmentKeys(commitPoint, false, lc.localChanCfg, keyRing := deriveCommitmentKeys(
lc.remoteChanCfg) commitPoint, false, lc.localChanCfg, lc.remoteChanCfg,
)
// Create a new commitment view which will calculate the evaluated // Create a new commitment view which will calculate the evaluated
// state of the remote node's new commitment including our latest added // state of the remote node's new commitment including our latest added
@ -4017,8 +4019,9 @@ func (lc *LightningChannel) ReceiveNewCommitment(commitSig lnwire.Sig,
// Ensure that this new local update from the remote node respects all // Ensure that this new local update from the remote node respects all
// the constraints we specified during initial channel setup. If not, // the constraints we specified during initial channel setup. If not,
// then we'll abort the channel as they've violated our constraints. // then we'll abort the channel as they've violated our constraints.
err := lc.validateCommitmentSanity(lc.remoteUpdateLog.logIndex, err := lc.validateCommitmentSanity(
localACKedIndex, false, nil) lc.remoteUpdateLog.logIndex, localACKedIndex, false, nil,
)
if err != nil { if err != nil {
return err return err
} }
@ -4033,8 +4036,9 @@ func (lc *LightningChannel) ReceiveNewCommitment(commitSig lnwire.Sig,
return err return err
} }
commitPoint := input.ComputeCommitmentPoint(commitSecret[:]) commitPoint := input.ComputeCommitmentPoint(commitSecret[:])
keyRing := deriveCommitmentKeys(commitPoint, true, lc.localChanCfg, keyRing := deriveCommitmentKeys(
lc.remoteChanCfg) commitPoint, true, lc.localChanCfg, lc.remoteChanCfg,
)
// With the current commitment point re-calculated, construct the new // With the current commitment point re-calculated, construct the new
// commitment view which includes all the entries (pending or committed) // commitment view which includes all the entries (pending or committed)
@ -4067,9 +4071,10 @@ func (lc *LightningChannel) ReceiveNewCommitment(commitSig lnwire.Sig,
localCommitTx := localCommitmentView.txn localCommitTx := localCommitmentView.txn
multiSigScript := lc.signDesc.WitnessScript multiSigScript := lc.signDesc.WitnessScript
hashCache := txscript.NewTxSigHashes(localCommitTx) hashCache := txscript.NewTxSigHashes(localCommitTx)
sigHash, err := txscript.CalcWitnessSigHash(multiSigScript, hashCache, sigHash, err := txscript.CalcWitnessSigHash(
txscript.SigHashAll, localCommitTx, 0, multiSigScript, hashCache, txscript.SigHashAll,
int64(lc.channelState.Capacity)) localCommitTx, 0, int64(lc.channelState.Capacity),
)
if err != nil { if err != nil {
// TODO(roasbeef): fetchview has already mutated the HTLCs... // TODO(roasbeef): fetchview has already mutated the HTLCs...
// * need to either roll-back, or make pure // * need to either roll-back, or make pure
@ -4442,8 +4447,10 @@ func (lc *LightningChannel) ReceiveRevocation(revMsg *lnwire.RevokeAndAck) (
// As we've just completed a new state transition, attempt to see if we // As we've just completed a new state transition, attempt to see if we
// can remove any entries from the update log which have been removed // can remove any entries from the update log which have been removed
// from the PoV of both commitment chains. // from the PoV of both commitment chains.
compactLogs(lc.localUpdateLog, lc.remoteUpdateLog, compactLogs(
localChainTail, remoteChainTail) lc.localUpdateLog, lc.remoteUpdateLog, localChainTail,
remoteChainTail,
)
return fwdPkg, addsToForward, settleFailsToForward, nil return fwdPkg, addsToForward, settleFailsToForward, nil
} }