lnwallet: copy commitment transaction in getSignedCommitTx

In this commit, we move to make a full deep copy of the commitment
transaction in `getSignedCommitTx` to ensure that we don't mutate the
commitment on disk, possibly resulting in a "hot commitment".
This commit is contained in:
Olaoluwa Osuntokun 2019-09-30 19:50:31 -07:00
parent 450e5a7df4
commit 1e67040145
No known key found for this signature in database
GPG Key ID: BC13F65E2DC84465

@ -4946,7 +4946,7 @@ func (lc *LightningChannel) getSignedCommitTx() (*wire.MsgTx, error) {
// Fetch the current commitment transaction, along with their signature
// for the transaction.
localCommit := lc.channelState.LocalCommitment
commitTx := localCommit.CommitTx
commitTx := localCommit.CommitTx.Copy()
theirSig := append(localCommit.CommitSig, byte(txscript.SigHashAll))
// With this, we then generate the full witness so the caller can