lnwallet: modify NewUnilateralCloseSummary to be aware of pending remote commits
In this commit, we modify the NewUnilateralCloseSummary to be able to distinguish between a unilateral closure using the lowest+highest commitment the remote party possesses. Before this commit, if the remote party broadcast their highest commitment, when they have a lower unrevoked commitment, then this function would fail to find the proper output, leaving funds on the chain. To fix this, it's now the duty of the caller to pass remotePendingCommit with the proper value. The caller should use the lowest unrevoked commitment, and the height hint of the broadcast commitment to discern if this is a pending commitment or not.
This commit is contained in:
3 files changed
+30
-20
No files matched your search
@@ -419,7 +419,7 @@ func TestCommitmentAndHTLCTransactions(t *testing.T) {
|
||||
// of the dependencies.
|
||||
channel := LightningChannel{
|
||||
channelState: &channelState,
|
||||
signer: signer,
|
||||
Signer: signer,
|
||||
localChanCfg: &channelState.LocalChanCfg,
|
||||
remoteChanCfg: &channelState.RemoteChanCfg,
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user