Reorder code

This commit is contained in:
jl777
2019-07-08 20:52:35 -11:00
parent 492dc5c2cc
commit 34878d8dbc

View File

@@ -41,21 +41,18 @@ TransactionSignatureCreator::TransactionSignatureCreator(const CKeyStore* keysto
bool TransactionSignatureCreator::CreateSig(std::vector<unsigned char>& vchSig, const CKeyID& address, const CScript& scriptCode, uint32_t consensusBranchId, CKey *pprivKey, void *extraData) const bool TransactionSignatureCreator::CreateSig(std::vector<unsigned char>& vchSig, const CKeyID& address, const CScript& scriptCode, uint32_t consensusBranchId, CKey *pprivKey, void *extraData) const
{ {
CKey key; CKey key; uint256 hash;
fprintf(stderr,"createsig\n");
if (pprivKey)
key = *pprivKey;
else if (!keystore || !keystore->GetKey(address, key))
return false;
fprintf(stderr,"createsig2\n");
uint256 hash;
try { try {
hash = SignatureHash(scriptCode, *txTo, nIn, nHashType, amount, consensusBranchId); hash = SignatureHash(scriptCode, *txTo, nIn, nHashType, amount, consensusBranchId);
} catch (logic_error ex) { } catch (logic_error ex) {
return false; return false;
} }
SIG_TXHASH = hash; SIG_TXHASH = hash;
if (pprivKey)
key = *pprivKey;
else if (!keystore || !keystore->GetKey(address, key))
return false;
if (scriptCode.IsPayToCryptoCondition()) if (scriptCode.IsPayToCryptoCondition())
{ {
CC *cc = (CC *)extraData; CC *cc = (CC *)extraData;