lnwallet: add assertion in createCommitmentTx to detect overdraw attempts

In this commit, we add a precautionary assertion at the end of
createCommitmentTx. This assertion is meant to ensure that we don't
accept or propose a commitment transaction that attempts to send out
more than it was funded with.
This commit is contained in:
Olaoluwa Osuntokun committed 2018-05-21 16:52:57 -07:00
1 parent c7afb867bc
commit 95293f5102
2 files changed
+15 -1

No files matched your search

+1 -1
View File
@@ -685,7 +685,7 @@ func (l *LightningWallet) handleContributionMsg(req *addContributionMsg) {
return
}
// Grab the mutex on the ChannelReservation to ensure thead-safety
// Grab the mutex on the ChannelReservation to ensure thread-safety
pendingReservation.Lock()
defer pendingReservation.Unlock()