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 getzmqnotifications RPC in rpcclient #1555

Closed
wants to merge 0 commits into from

Conversation

torkelrogstad
Copy link
Contributor

In this PR we implement the getzmqnotifications RPC
in the RPC client.

Copy link
Contributor

@onyb onyb left a comment

Choose a reason for hiding this comment

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

Added my initial review comments.

@@ -864,6 +873,7 @@ func init() {
MustRegisterCmd("gettxout", (*GetTxOutCmd)(nil), flags)
MustRegisterCmd("gettxoutproof", (*GetTxOutProofCmd)(nil), flags)
MustRegisterCmd("gettxoutsetinfo", (*GetTxOutSetInfoCmd)(nil), flags)
MustRegisterCmd("getzmqnotifications", (*GetZmqNotificationsCmd)(nil), flags)
Copy link
Contributor

Choose a reason for hiding this comment

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

Wondering if getzmqnotifications is really a chain command. Bitcoin Core categorizes it separately under the zmq section. Maybe walletsvrcmds.go is a better file for this?

What do you think, @jcvernaleo @jakesyl?

btcjson/chainsvrresults.go Outdated Show resolved Hide resolved
rpcclient/zmq.go Outdated Show resolved Hide resolved
Comment on lines 402 to 406
type basicNotification struct {
Type string
Address string
Hwm int
}
Copy link
Contributor

Choose a reason for hiding this comment

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

We can use this in the MarshalJSON method as well, as a replacement for map[string]interface{} type, by moving basicNotification outside.

What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

A benefit of keeping basicNotification within the unmarshaling method is that it doesn't pollute the package namespace. So I think it's better to keep it where it is now

btcjson/chainsvrresults.go Outdated Show resolved Hide resolved
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.

2 participants