-
Notifications
You must be signed in to change notification settings - Fork 42
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
feat(rpc): expose reserved balance for GetBalance #1925
Conversation
4cca27b
to
b08502d
Compare
Agreed and good thinking, I didn't actually mention this in the issue 👍 Can you take care of this PR too? |
Yes that's what I'm thinking, but it probably makes sense to keep it separate. |
@sangaman can u please fix conflicts?
|
43b0051
to
5641d1d
Compare
I fixed the conflicts, but I'm pretty stumped as to why this didn't work for you. I added some test cases as well as a simulation test assertion that verifies that Could you try testing again real quick and if you get the same result could you upload your log? I added some temporary logging statements that might be helpful to figure out what's going on. |
|
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.
above
5641d1d
to
2be8d45
Compare
OK I figured it out, I was setting the reserved balance properly when a single currency was specified for the |
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.
Approved, but in follow up PR with channel balance check we need to:
- add
in order
amount in GetBalance table; - think about behavoiur with closed channel - should we remove orders if channel was partially or fully closed?
I would say no for now, sounds like this could lead to unintended behaviour. In the case of arby, the next order issuance will account for the reduced balance, so shouldn't be a problem. |
Is it not there for you currently in the parentheses? Or are you suggesting it should be in a separate column? I can definitely change the formatting of the table in this PR if we'd like, I just tried to follow the example in the original issue.
I agree, auto cancelling orders would be fairly complicated and I'm not sure it would be desirable. |
As just discussed, we want this to be in for this PR |
I suspect this may have to do with the |
not sure how it can be in docker env, but now i also checked clean native fresh compiled xud and got same result. |
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. Looks good code wise - nice test coverage 👍
This adds a field to the `GetBalance` response to return the balance that is reserved for open orders.
2be8d45
to
165546e
Compare
I finally figured out why it wasn't displaying properly, so I fixed that and as per our discussions I moved the reserved
|
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.
May be merged after simulation tests passing
This adds a field to the
GetBalance
response to return the balance that is reserved for open orders.Related issue #1584 - before closing it though I think we'll need another PR that enforces the reserved outbound amount before accepting new orders. As is currently it's possible to have more outbound balance reserved than you have available if you keep adding orders in excess of your balance.
This is in draft status until #1916 is merged. I haven't tested this manually yet but it should be ready for testing.