Skip to content

Conversation

@kristapsk
Copy link
Contributor

You can already do this using importmulti, but importaddress, importprivkey and importpubkey are more easy to use if you are a human being using CLI, not a script.

Rationale is that I usually know creation date of my private keys when importing, for example, paper wallet. And full blockchain rescans are slow and unnecessary in such cases.

for importaddress, importprivkey and importpubkey
@promag
Copy link
Contributor

promag commented Jun 14, 2018

NACK, just create a client command to help with importmulti if that is the problem.

IMO this is not a strong reason to create redundancy on the RPC server. If this is accepted, clients can import multiple addresses by calling import* multiple times, which would incur in unnecessary rescans. importmulti is tweaked to scan only once for the given the batch.

Should have tests.

@kristapsk
Copy link
Contributor Author

Yes, if decision is to not merge this, I will just create wrapper scripts for importmulti that will allow partial rescan for importing single privkey or address.

If this is accepted, clients can import multiple addresses by calling import* multiple times, which would incur in unnecessary rescans.

It is already possible with full rescans. This PR just adds option to do partial rescan instead.

Should have tests.

Will look at tests if this is accepted.

@promag
Copy link
Contributor

promag commented Jun 14, 2018

@kristapsk please see #6570.

@gmaxwell
Copy link
Contributor

It was my view that these RPCs have largely been deprecated in favor of importmulti.

@kristapsk
Copy link
Contributor Author

Ok, I didn't know about that previous discussion. If it has been once discussed to not add this functionality, then no point to do that again.

Just some additional thoughts:

  1. shouldn't importaddress, importprivkey and importpubkey output some warnings they are deprecated in favour of importmulti?
  2. shouldn't "Hint: use importmulti to import more than one private key" help message be altered to add information about additional functionality provided by importmulti in addition to importing multiple keys?

(that's anyway different PR then, so I'm closing this)

@kristapsk kristapsk closed this Jun 14, 2018
laanwj added a commit that referenced this pull request Jun 25, 2018
3f72d04 Fix parameter count check for importpubkey. (Kristaps Kaupe)

Pull request description:

  Found this while working on #13464. Parameter count check for `importpubkey` was wrong.

Tree-SHA512: aba41b666c6493379f320be5e3e438a6cad1a96429102ff4428c092c48f29c2eead2195792c0b018296f20e1c42eb091dd5b9886c42cecbb1f0d03d5def14705
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Apr 8, 2020
3f72d04 Fix parameter count check for importpubkey. (Kristaps Kaupe)

Pull request description:

  Found this while working on bitcoin#13464. Parameter count check for `importpubkey` was wrong.

Tree-SHA512: aba41b666c6493379f320be5e3e438a6cad1a96429102ff4428c092c48f29c2eead2195792c0b018296f20e1c42eb091dd5b9886c42cecbb1f0d03d5def14705
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants