-
Notifications
You must be signed in to change notification settings - Fork 492
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
Add listpaymentsincoinjoin
and cancelpaymentincoinjoin
RPC calls
#11976
Conversation
lontivero
commented
Nov 21, 2023
•
edited by yahiheb
edited by yahiheb
adb19fd
to
1560d8c
Compare
listpayments
RPC calllistpayments
and cancelpayment
RPC call
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.
tested lgtm
-
payincoinjoin
amount unit is in BTC? I thought it was in sats
good to have it the same unit aslistpayments
(and all other RPC are also in sats)
maybe could add the fix here -
listpendingpayments
/listpayincoinjoin
instead oflistpayments
feels more intuitive to me, as listpayments can also mean just the wallet history outgoing tx. -
Maybe write to the logs when payment is cancelled/removed?
as we also write to log when payment get "scheduled"
@MarnixCroes, I renamed the methods:
The logs look as follow now:
I didn't get the issue about amounts? What do you mean with that? Can you give me an example? |
|
ok, it's unrelated to this PR: for |
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.
Fought a hard battle, but finally I can write tACK
{ | ||
if (payment.State is PendingPayment) | ||
{ | ||
_payments.Remove(payment); |
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 wonder how this works.
I did a payincoinjoin
and after that I cancelled it.
It was successfully removed from this list, but the CJ itself will be confirmed once I mine a block. So it's not really cancelled unless the client replaces the CJ with an RBF tx.
So, cancelling payments means only removing the item from the _payments
list?
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.
You can only cancel payments that are not still participating in a coinjoin.
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.
Oh OK, so cancelling payments means the GetBestPaymentSet
won't select it (bc it's removed from the list) in OutputReg
phase.
I think I got it now. Thanks
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.
utACK, PR easy to review
There are cf related issues
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.
tack 611c153
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.
tACK
listpayments
and cancelpayment
RPC calllistpaymentsincoinjoin
and cancelpaymentincoinjoin
RPC calls
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.
ok, it's unrelated to this PR: for
payincoinjoin
if I enter amount 1, it registers 1 BTC, instead of 1 sat.
It registers 1 sat not 1 BTC, so it is working as expected.
There are cf related issues
I fixed them.
tACK
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.
Sometimes you don't use arrow function and sometimes you does. Maybe we should follow common styles for short methods (I suggest to use arrow functions, because of looks).
public record Payment(IDestination Destination, Money Amount) | ||
{ | ||
public Guid Id { get; } = Guid.NewGuid(); | ||
public PaymentState State { get; init; } = new PendingPayment(null); |
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.
We could avoid using needless null as parameter via using parameterless constructor.
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.
We can create a new constructor and move the null there ofc.
I will merge this PR even when there is a bug because that bug was not introduced here and it is a general bug that affects all the methods that use Money. |