aboutsummaryrefslogtreecommitdiff
path: root/src/key.cpp
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2014-11-28 21:16:51 +0100
committerPieter Wuille <pieter.wuille@gmail.com>2014-11-28 21:16:51 +0100
commit4cdaa95a209808276992dc1eb0ed0773f7927073 (patch)
treeee1b48af389ef3660d21cf41e684d53636983d01 /src/key.cpp
parent9d8604f36a6f94b3c065a8143952cadd7d97aef5 (diff)
downloadbitcoin-4cdaa95a209808276992dc1eb0ed0773f7927073.tar.xz
Resize after succesful result
Diffstat (limited to 'src/key.cpp')
-rw-r--r--src/key.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/key.cpp b/src/key.cpp
index 0fb7a5c7c5..07fffcb0e0 100644
--- a/src/key.cpp
+++ b/src/key.cpp
@@ -83,10 +83,11 @@ bool CKey::Sign(const uint256 &hash, std::vector<unsigned char>& vchSig, uint32_
nonce += test_case;
int nSigLen = 72;
int ret = secp256k1_ecdsa_sign((const unsigned char*)&hash, 32, (unsigned char*)&vchSig[0], &nSigLen, begin(), (unsigned char*)&nonce);
- vchSig.resize(nSigLen);
nonce = 0;
- if (ret)
+ if (ret) {
+ vchSig.resize(nSigLen);
return true;
+ }
} while(true);
}