From f817da97045bff5d77334fa77c49c167c2391696 Mon Sep 17 00:00:00 2001 From: Andrew Cann Date: Thu, 17 Jun 2021 16:56:32 +0800 Subject: [PATCH] SpendableBalance: enable when funding not locked When SpendableBalance is called when the funding is not yet locked, report the full channel balance rather than crashing. --- src/DotNetLightning.Core/Channel/Channel.fs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/DotNetLightning.Core/Channel/Channel.fs b/src/DotNetLightning.Core/Channel/Channel.fs index 653f03d18..d0c4b00d8 100644 --- a/src/DotNetLightning.Core/Channel/Channel.fs +++ b/src/DotNetLightning.Core/Channel/Channel.fs @@ -1168,9 +1168,7 @@ and Channel = { let remoteCommit = match remoteNextCommitInfo with | Some (RemoteNextCommitInfo.Waiting nextRemoteCommit) -> nextRemoteCommit - | Some (RemoteNextCommitInfo.Revoked _info) -> savedChannelState.RemoteCommit - // TODO: This could return a proper error, or report the full balance - | None -> failwith "funding is not locked" + | _ -> savedChannelState.RemoteCommit let reducedRes = remoteCommit.Spec.Reduce( savedChannelState.RemoteChanges.ACKed,