aboutsummaryrefslogtreecommitdiff
path: root/src/script.cpp
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2013-04-30 21:56:04 +0200
committerPieter Wuille <sipa@ulyssis.org>2013-05-30 05:18:42 +0200
commit5d891489ab7828ad8db15e85bb63e2f13f021a6a (patch)
tree24cd213e276977570de5b299872368bdf70ac929 /src/script.cpp
parentec0004aca0a2bf11f99c9587ddb2bf8ea818d3bb (diff)
Make CPubKey statically allocated
Diffstat (limited to 'src/script.cpp')
-rw-r--r--src/script.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/script.cpp b/src/script.cpp
index 90066efd33..7e1d5785e8 100644
--- a/src/script.cpp
+++ b/src/script.cpp
@@ -1895,10 +1895,11 @@ bool CScriptCompressor::Decompress(unsigned int nSize, const std::vector<unsigne
if (!key.SetPubKey(CPubKey(vch)))
return false;
key.SetCompressedPubKey(false); // Decompress public key
- CPubKey pubkey = key.GetPubKey();
+ const CPubKey pubkey = key.GetPubKey();
+ assert(pubkey.size() == 65);
script.resize(67);
script[0] = 65;
- memcpy(&script[1], &pubkey.Raw()[0], 65);
+ memcpy(&script[1], pubkey.begin(), 65);
script[66] = OP_CHECKSIG;
return true;
}