Skip to content

Commit f817da9

Browse files
committed
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.
1 parent bdbd7f0 commit f817da9

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/DotNetLightning.Core/Channel/Channel.fs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1168,9 +1168,7 @@ and Channel = {
11681168
let remoteCommit =
11691169
match remoteNextCommitInfo with
11701170
| Some (RemoteNextCommitInfo.Waiting nextRemoteCommit) -> nextRemoteCommit
1171-
| Some (RemoteNextCommitInfo.Revoked _info) -> savedChannelState.RemoteCommit
1172-
// TODO: This could return a proper error, or report the full balance
1173-
| None -> failwith "funding is not locked"
1171+
| _ -> savedChannelState.RemoteCommit
11741172
let reducedRes =
11751173
remoteCommit.Spec.Reduce(
11761174
savedChannelState.RemoteChanges.ACKed,

0 commit comments

Comments
 (0)