mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-02-09 08:43:04 +01:00
Merge branch '0.4.x' into 0.5.0.x
Conflicts: contrib/Bitcoin.app/Contents/Info.plist doc/README doc/README_windows.txt share/setup.nsi src/serialize.h
This commit is contained in:
13
src/key.h
13
src/key.h
@@ -290,13 +290,14 @@ public:
|
||||
|
||||
bool Sign(uint256 hash, std::vector<unsigned char>& vchSig)
|
||||
{
|
||||
vchSig.clear();
|
||||
unsigned char pchSig[10000];
|
||||
unsigned int nSize = 0;
|
||||
if (!ECDSA_sign(0, (unsigned char*)&hash, sizeof(hash), pchSig, &nSize, pkey))
|
||||
unsigned int nSize = ECDSA_size(pkey);
|
||||
vchSig.resize(nSize); // Make sure it is big enough
|
||||
if (!ECDSA_sign(0, (unsigned char*)&hash, sizeof(hash), &vchSig[0], &nSize, pkey))
|
||||
{
|
||||
vchSig.clear();
|
||||
return false;
|
||||
vchSig.resize(nSize);
|
||||
memcpy(&vchSig[0], pchSig, nSize);
|
||||
}
|
||||
vchSig.resize(nSize); // Shrink to fit actual size
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -1959,7 +1959,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
|
||||
}
|
||||
|
||||
// Ask the first connected node for block updates
|
||||
static int nAskedForBlocks;
|
||||
static int nAskedForBlocks = 0;
|
||||
if (!pfrom->fClient &&
|
||||
(pfrom->nVersion < 32000 || pfrom->nVersion >= 32400) &&
|
||||
(nAskedForBlocks < 1 || vNodes.size() <= 1))
|
||||
|
||||
Reference in New Issue
Block a user