Changeset View
Changeset View
Standalone View
Standalone View
src/script/sign.cpp
Show All 24 Lines | bool TransactionSignatureCreator::CreateSig(std::vector<uint8_t> &vchSig, | ||||
const CKeyID &address, | const CKeyID &address, | ||||
const CScript &scriptCode) const { | const CScript &scriptCode) const { | ||||
CKey key; | CKey key; | ||||
if (!keystore->GetKey(address, key)) { | if (!keystore->GetKey(address, key)) { | ||||
return false; | return false; | ||||
} | } | ||||
uint256 hash = SignatureHash(scriptCode, *txTo, nIn, sigHashType, amount); | uint256 hash = SignatureHash(scriptCode, *txTo, nIn, sigHashType, amount); | ||||
if (!key.Sign(hash, vchSig)) { | if (!key.SignECDSA(hash, vchSig)) { | ||||
return false; | return false; | ||||
} | } | ||||
vchSig.push_back(uint8_t(sigHashType.getRawSigHashType())); | vchSig.push_back(uint8_t(sigHashType.getRawSigHashType())); | ||||
return true; | return true; | ||||
} | } | ||||
static bool Sign1(const CKeyID &address, const BaseSignatureCreator &creator, | static bool Sign1(const CKeyID &address, const BaseSignatureCreator &creator, | ||||
▲ Show 20 Lines • Show All 348 Lines • Show Last 20 Lines |