Changeset View
Changeset View
Standalone View
Standalone View
src/script/sign.cpp
Show All 22 Lines | |||||
bool TransactionSignatureCreator::CreateSig(std::vector<uint8_t> &vchSig, | 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, nHashType, amount); | uint256 hash = | ||||
SignatureHash(scriptCode, *txTo, nIn, nHashType, amount, CScript()); | |||||
if (!key.Sign(hash, vchSig)) { | if (!key.Sign(hash, vchSig)) { | ||||
return false; | return false; | ||||
} | } | ||||
vchSig.push_back(uint8_t(nHashType)); | vchSig.push_back(uint8_t(nHashType)); | ||||
return true; | return true; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 349 Lines • Show Last 20 Lines |