Skip to content

Commit 4cdaa95

Browse files
committed
Resize after succesful result
1 parent 9d8604f commit 4cdaa95

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/key.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,11 @@ bool CKey::Sign(const uint256 &hash, std::vector<unsigned char>& vchSig, uint32_
8383
nonce += test_case;
8484
int nSigLen = 72;
8585
int ret = secp256k1_ecdsa_sign((const unsigned char*)&hash, 32, (unsigned char*)&vchSig[0], &nSigLen, begin(), (unsigned char*)&nonce);
86-
vchSig.resize(nSigLen);
8786
nonce = 0;
88-
if (ret)
87+
if (ret) {
88+
vchSig.resize(nSigLen);
8989
return true;
90+
}
9091
} while(true);
9192
}
9293

0 commit comments

Comments
 (0)