Skip to content

Commit

Permalink
Use correct channel ID in WaitForFundingSigned
Browse files Browse the repository at this point in the history
  • Loading branch information
canndrew committed Jul 16, 2020
1 parent 0d7ca38 commit 3e48d7b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/DotNetLightning.Core/Channel/Channel.fs
Original file line number Diff line number Diff line change
Expand Up @@ -169,26 +169,28 @@ module Channel =
assert (state.LastSent.FundingPubKey = localParams.ChannelPubKeys.FundingPubKey)
let commitmentSpec = state.InputInitFunder.DeriveCommitmentSpec()
let commitmentSeed = state.InputInitFunder.ChannelKeys.CommitmentSeed
let fundingTxId = fundingTx.Value.GetTxId()
let! (_localSpec, localCommitTx, remoteSpec, remoteCommitTx) =
ChannelHelpers.makeFirstCommitTxs localParams
remoteParams
state.LastSent.FundingSatoshis
state.LastSent.PushMSat
state.LastSent.FeeRatePerKw
outIndex
(fundingTx.Value.GetHash() |> TxId)
fundingTxId
(ChannelUtils.buildCommitmentPoint(commitmentSeed, 0UL))
msg.FirstPerCommitmentPoint
cs.Secp256k1Context
cs.Network
let localSigOfRemoteCommit, _ = (cs.KeysRepository.GetSignatureFor(remoteCommitTx.Value, state.LastSent.FundingPubKey))
let nextMsg: FundingCreatedMsg = {
TemporaryChannelId = msg.TemporaryChannelId
FundingTxId = fundingTx.Value.GetTxId()
FundingTxId = fundingTxId
FundingOutputIndex = outIndex
Signature = !>localSigOfRemoteCommit.Signature
}
let data = { Data.WaitForFundingSignedData.ChannelId = msg.TemporaryChannelId
let channelId = OutPoint(fundingTxId.Value, uint32 outIndex.Value).ToChannelId()
let data = { Data.WaitForFundingSignedData.ChannelId = channelId
LocalParams = localParams
RemoteParams = remoteParams
Data.WaitForFundingSignedData.FundingTx = fundingTx
Expand Down

0 comments on commit 3e48d7b

Please sign in to comment.