Skip to content
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 address filtering to websocket block confirmation subscription #37

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

dylan1951
Copy link
Contributor

@dylan1951 dylan1951 commented Jun 15, 2024

Disclaimer: I have never written or seen go before and ChatGPT wrote all of the code.

Resolves #3


addresses, err := w.GetAllAccountAddresses()
if err != nil {
// Handle error
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know gpt wrote this, but this should be handled. Maybe modify the function to return an error and consider panicking if there's an error.

Action: "subscribe",
Topic: "confirmation",
Ack: false,
Id: guuid.New().String(),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My understanding is the point of the "id" here is for the node to respond with an acknowledgement that it received the message. It would be nice to actually respond to it, or just remove this all together and maybe add a todo type of thing.

@bbedward
Copy link
Collaborator

I have a couple of questions that I annotated, but did you try to run this code yourself with success? I'm curious as to the motivation for creating this PR.

@dylan1951
Copy link
Contributor Author

I have a couple of questions that I annotated, but did you try to run this code yourself with success? I'm curious as to the motivation for creating this PR.

The motivation for fixing this issue is the websockets subscription doesn't work for public nodes because they don't support subscribing to all block confirmations. It does work and I'm using it currently.

Thanks for those reviews I'll try fix it up a bit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Websocket confirmations only for in-wallet accounts
2 participants