-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mono-hop unidirectional payments #2
Conversation
Please:
|
Also comment out this line in ci.yml:
|
b24eaca
to
a878176
Compare
f43bd8c
to
4617a02
Compare
4617a02
to
1353d6b
Compare
I guess you can merge the commits here (except for the ones being proposed to Joe or the hacky one) |
merge->squash |
@canndrew i've updated the tip of this repo's master to sync with Joe's, you can rebase |
c42e57d
to
0e90ded
Compare
@@ -458,6 +470,18 @@ module internal AcceptChannelMsgValidation = | |||
|
|||
(check1 |> Validation.ofResult) *^> check2 *^> check3 *^> check4 *^> check5 *^> check6 *^> check7 | |||
|
|||
module UpdateMonoHopUnidirectionalPaymentWithContext = | |||
let internal checkWeHaveSufficientFunds (state: Commitments) (currentSpec) = | |||
let fees = if (state.LocalParams.IsFunder) then (Transactions.commitTxFee (state.RemoteParams.DustLimitSatoshis) currentSpec) else Money.Zero |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please split this long line in the same way we do in geewallet:
let foo =
if bar then
baz
else
bazz
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(also no need for so many parenthesis)
tests/DotNetLightning.Infrastructure.Tests/ChannelOperationTests.fs
Outdated
Show resolved
Hide resolved
a0dba66
to
0e90ded
Compare
0e90ded
to
06726a3
Compare
ok then separate that one but let's not delay this so much |
6f88df3
to
7f242df
Compare
d1edb32
to
7ab6e5c
Compare
504ba35
to
d0e55cb
Compare
1d27824
to
698ea77
Compare
@canndrew pls rebase when u have time |
698ea77
to
7fc86f6
Compare
dotnet nuget push ./bin/Release/DotNetLightning.Kiss.1*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks wrong, we should push BouncyCastle binaries, not native
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops. I've fixed it so that we only upload the BouncyCastle build and we upload it as DotNetLightning.Kiss
let totalBalance = reduced.ToRemote | ||
let untrimmedSpendableBalance = totalBalance - channelReserve - fees | ||
let htlcSuccessFee = | ||
reduced.FeeRatePerKw.ToFee(Transactions.Constants.HTLC_SUCCESS_WEIGHT) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we use any HTLC-related stuff here if we don't use HTLCs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because I had to think hard about how exactly this function needs to be implemented and I didn't want to have to do that again, or to have the code silently break, when we eventually add support for HTLCs. So I just made it HTLC-compatible to begin with.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's great but I'd prefer if you move this code into another PR, to pick it up later
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've removed the HTLC fees from the calculation and created a seperate PR which adds them back here: #3
static member Zero = | ||
let b: bool array = [||] | ||
b |> BitArray |> FeatureBit | ||
static member Zero = FeatureBit() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this change really needed for this PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope. I can remove it.
d054b8b
to
3a59364
Compare
Errors: string list | ||
} | ||
with | ||
static member Create msg e = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hey let's remove this Create method, as the record can be instantiated easily anyway without it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can do. All the other invalid msg types have it though, though they all seem equally pointless. Is it important to be consistent here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point; let's remove it here and I'll prepare a PR to remove them upstream
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
3a59364
to
e8beb8e
Compare
e8beb8e
to
bbc27ea
Compare
This is a work-in-progress PR for monodirectional, unihop (non-htlc) payments.