Validateaddress update

This commit is contained in:
Michael Rotarius 2017-01-07 12:51:08 +01:00
parent 10b8a96d6e
commit ee9e14c784
2 changed files with 29 additions and 13 deletions

View file

@ -158,7 +158,7 @@ Use v0.n.n in abbreviation title to prevent autocrossrefing.
* [CreateMultiSig][rpc createmultisig]: {{summary_createMultiSig}} * [CreateMultiSig][rpc createmultisig]: {{summary_createMultiSig}}
* [EstimateFee][rpc estimatefee]: {{summary_estimateFee}} {{NEW0_10_0}} * [EstimateFee][rpc estimatefee]: {{summary_estimateFee}} {{NEW0_10_0}}
* [EstimatePriority][rpc estimatepriority]: {{summary_estimatePriority}} {{NEW0_10_0}}, {{DEPRECATED}} * [EstimatePriority][rpc estimatepriority]: {{summary_estimatePriority}} {{NEW0_10_0}}, {{DEPRECATED}}
* [ValidateAddress][rpc validateaddress]: {{summary_validateAddress}} * [ValidateAddress][rpc validateaddress]: {{summary_validateAddress}} {{UPDATED0_13_0}}
* [VerifyMessage][rpc verifymessage]: {{summary_verifyMessage}} * [VerifyMessage][rpc verifymessage]: {{summary_verifyMessage}}
{% endautocrossref %} {% endautocrossref %}

View file

@ -39,7 +39,12 @@ The `validateaddress` RPC {{summary_validateAddress}}
- n: "→<br>`address`" - n: "→<br>`address`"
t: "string (base58)" t: "string (base58)"
p: "Optional<br>(0 or 1)" p: "Optional<br>(0 or 1)"
d: "If the address is valid, this is the address <!--TODO: figure out in what cases this might be different from the address provided in the parameter -->" d: "The bitcoin address given as parameter"
- n: "→<br>`scriptPubKey`"
t: "string (hex)"
p: "Optional<br>(0 or 1)"
d: "The hex encoded scriptPubKey generated by the address"
- n: "→<br>`ismine`" - n: "→<br>`ismine`"
t: "bool" t: "bool"
@ -94,16 +99,26 @@ The `validateaddress` RPC {{summary_validateAddress}}
- n: "→<br>`account`" - n: "→<br>`account`"
t: "string" t: "string"
p: "Optional<br>(0 or 1)" p: "Optional<br>(0 or 1)"
d: "The account this address belong to. May be an empty string for the default account. Only returned if the address belongs to the wallet" d: "*Deprecated: will be removed in a later version of Bitcoin Core*<br><br>The account this address belong to. May be an empty string for the default account. Only returned if the address belongs to the wallet"
- n: "→<br>`hdkeypath`"
t: "string"
p: "Optional<br>(0 or 1)"
d: "*Added in Bitcoin Core 0.13.0*<br><br>The HD keypath if the key is HD and available"
- n: "→<br>`hdmasterkeyid`"
t: "string (hash160)"
p: "Optional<br>(0 or 1)"
d: "*Added in Bitcoin Core 0.13.0*<br><br>The Hash160 of the HD master public key"
{% enditemplate %} {% enditemplate %}
*Example from Bitcoin Core 0.10.0* *Example from Bitcoin Core 0.13.1*
Validate the following P2PKH address from the wallet: Validate the following P2PKH address from the wallet:
{% highlight bash %} {% highlight bash %}
bitcoin-cli -testnet validateaddress mgnucj8nYqdrPFh2JfZSB1NmUThUGnmsqe bitcoin-cli validateaddress 17fshh33qUze2yifiJ2sXgijSMzJ2KNEwu
{% endhighlight %} {% endhighlight %}
Result: Result:
@ -111,13 +126,14 @@ Result:
{% highlight json %} {% highlight json %}
{ {
"isvalid": true, "isvalid": true,
"address" : "mgnucj8nYqdrPFh2JfZSB1NmUThUGnmsqe", "address": "17fshh33qUze2yifiJ2sXgijSMzJ2KNEwu",
"scriptPubKey": "76a914492ae280d70af33acf0ae7cd329b961e65e9cbd888ac",
"ismine": true, "ismine": true,
"iswatchonly": false, "iswatchonly": false,
"isscript": false, "isscript": false,
"pubkey" : "03bacb84c6464a58b3e0a53cc0ba4cb3b82848cd7bed25a7724b3cc75d76c9c1ba", "pubkey": "0312eeb9ae5f14c3cf43cece11134af860c2ef7d775060e3a578ceec888acada31",
"iscompressed": true, "iscompressed": true,
"account" : "test label" "account": "Test"
} }
{% endhighlight %} {% endhighlight %}