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

listunspent and import_addresses API methods #249

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

Conversation

lawlawlaw
Copy link

Add the following API methods:

  • blockchain.scripthash.listunspent - returns unspent transaction object information for the given scripthash
  • import_addresses - imports the specified addresses and rescans from the specified block_height.

@@ -303,7 +303,6 @@ def get_scriptpubkeys_to_monitor(rpc, config):
break
spks_to_monitor.append(spks[0])
wal.rewind_one(change)

Copy link
Owner

Choose a reason for hiding this comment

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

Please remove these irrelevant line changes. Or if you want to refactor then open another PR for them.

@@ -384,6 +394,7 @@ def handle_query(self, query):
self._send_response(query, result)
elif method == "blockchain.estimatefee":
estimate = self.rpc.call("estimatesmartfee", [query["params"][0]])
self.logger.info('estimate: ' + estimate)
Copy link
Owner

Choose a reason for hiding this comment

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

Remove from this PR please, it's irrelevant. Also I think it conflicts with another edit I made recently.

@chris-belcher
Copy link
Owner

chris-belcher commented Mar 7, 2022

Thanks for the PR. Implementing listunspent has long been on the todo list like in issue #105.

Some thoughts:

  1. You implement the protocol method import_addresses but from what I see in the protocol spec it's not a method there. Are you aware of any clients that actually implement this method? I think it's best to remove it.
  2. You should reduce the number of commits. Right now you have 3 commits which edit and then revert README.me. Ideally have the PR be just one commit. If you don't know how to do this then search the web for "git squish commits"

Apart from that the PR looks good on reading. Please do the edits I ask then I will test out the PR and most likely merge it.

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.

3 participants