diff options
| author | Pieter Wuille <[email protected]> | 2011-11-21 02:46:28 +0100 |
|---|---|---|
| committer | Pieter Wuille <[email protected]> | 2012-01-09 15:18:19 +0100 |
| commit | 11529c6e4f7288d8a64c488a726ee3821c7adefe (patch) | |
| tree | 0f727a647b327687eb7894d824eb47d3578dfb92 /src/bitcoinrpc.cpp | |
| parent | Merge pull request #735 from sipa/netbase (diff) | |
| download | discoin-11529c6e4f7288d8a64c488a726ee3821c7adefe.tar.xz discoin-11529c6e4f7288d8a64c488a726ee3821c7adefe.zip | |
Compressed pubkeys
This patch enabled compressed pubkeys when -compressedpubkeys is passed.
These are 33 bytes instead of 65, and require only marginally more CPU
power when verifying. Compressed pubkeys have a different corresponding
address, so it is determined at generation. When -compressedpubkeys is
given, all newly generated addresses will use a compressed key, while
older/other addresses keep using normal keys. Unpatched clients will
relay and verify these transactions.
Diffstat (limited to 'src/bitcoinrpc.cpp')
| -rw-r--r-- | src/bitcoinrpc.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/bitcoinrpc.cpp b/src/bitcoinrpc.cpp index 09be73af3..ce2984019 100644 --- a/src/bitcoinrpc.cpp +++ b/src/bitcoinrpc.cpp @@ -1701,6 +1701,9 @@ Value validateaddress(const Array& params, bool fHelp) ret.push_back(Pair("pubkey", HexStr(vchPubKey))); std::string strPubKey(vchPubKey.begin(), vchPubKey.end()); ret.push_back(Pair("pubkey58", EncodeBase58(vchPubKey))); + CKey key; + key.SetPubKey(vchPubKey); + ret.push_back(Pair("iscompressed", key.IsCompressed())); } else if (pwalletMain->HaveCScript(address.GetHash160())) { |