Skip to content

Implement importpubkey RPC and watchonly flag for gettransaction#236

Merged
fassadlr merged 1 commit intostratisproject:masterfrom
zeptin:rpc-20201129
Nov 30, 2020
Merged

Implement importpubkey RPC and watchonly flag for gettransaction#236
fassadlr merged 1 commit intostratisproject:masterfrom
zeptin:rpc-20201129

Conversation

@zeptin
Copy link
Collaborator

@zeptin zeptin commented Nov 30, 2020

Adds support for the importpubkey RPC call (this can later be extended into the full importaddress). Pubkeys that are imported in this way are added to a special-purpose watch only account for later lookup.

Also adds the include_watchonly flag to the gettransaction RPC call. If this is set the watch only account is included in the search locations for the requested transaction ID.

if (!addressDict.TryGetValue(addressIdentifier, out HdAddress hdAddress))
{
ExtPubKey extPubKey = ExtPubKey.Parse(hdAccount.ExtendedPubKey, this.Network);
string pubKeyHex = null;
Copy link
Contributor

@quantumagi quantumagi Nov 30, 2020

Choose a reason for hiding this comment

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

Looks good. In fact, the code added for watch-only-accounts may work equally well for the general case.

@fassadlr
Copy link
Contributor

I will fx the failing test in another PR.

@fassadlr fassadlr merged commit 3940ff5 into stratisproject:master Nov 30, 2020
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