Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/rawtransaction.cpp
Show First 20 Lines • Show All 985 Lines • ▼ Show 20 Lines | |||||
#ifdef ENABLE_WALLET | #ifdef ENABLE_WALLET | ||||
const CKeyStore &keystore = | const CKeyStore &keystore = | ||||
((fGivenKeys || !pwallet) ? tempKeystore : *pwallet); | ((fGivenKeys || !pwallet) ? tempKeystore : *pwallet); | ||||
#else | #else | ||||
const CKeyStore &keystore = tempKeystore; | const CKeyStore &keystore = tempKeystore; | ||||
#endif | #endif | ||||
SigHashType sigHashType = SigHashType().withForkId(true); | SigHashType sigHashType = SigHashType().withForkId(); | ||||
if (request.params.size() > 3 && !request.params[3].isNull()) { | if (request.params.size() > 3 && !request.params[3].isNull()) { | ||||
static std::map<std::string, int> mapSigHashValues = { | static std::map<std::string, int> mapSigHashValues = { | ||||
{"ALL", SIGHASH_ALL}, | {"ALL", SIGHASH_ALL}, | ||||
{"ALL|ANYONECANPAY", SIGHASH_ALL | SIGHASH_ANYONECANPAY}, | {"ALL|ANYONECANPAY", SIGHASH_ALL | SIGHASH_ANYONECANPAY}, | ||||
{"ALL|FORKID", SIGHASH_ALL | SIGHASH_FORKID}, | {"ALL|FORKID", SIGHASH_ALL | SIGHASH_FORKID}, | ||||
{"ALL|FORKID|ANYONECANPAY", | {"ALL|FORKID|ANYONECANPAY", | ||||
SIGHASH_ALL | SIGHASH_FORKID | SIGHASH_ANYONECANPAY}, | SIGHASH_ALL | SIGHASH_FORKID | SIGHASH_ANYONECANPAY}, | ||||
{"NONE", SIGHASH_NONE}, | {"NONE", SIGHASH_NONE}, | ||||
Show All 34 Lines | for (size_t i = 0; i < mergedTx.vin.size(); i++) { | ||||
continue; | continue; | ||||
} | } | ||||
const CScript &prevPubKey = coin.GetTxOut().scriptPubKey; | const CScript &prevPubKey = coin.GetTxOut().scriptPubKey; | ||||
const Amount amount = coin.GetTxOut().nValue; | const Amount amount = coin.GetTxOut().nValue; | ||||
SignatureData sigdata; | SignatureData sigdata; | ||||
// Only sign SIGHASH_SINGLE if there's a corresponding output: | // Only sign SIGHASH_SINGLE if there's a corresponding output: | ||||
if ((sigHashType.getBaseSigHashType() != BaseSigHashType::SINGLE) || | if ((sigHashType.getBaseType() != BaseSigHashType::SINGLE) || | ||||
(i < mergedTx.vout.size())) { | (i < mergedTx.vout.size())) { | ||||
ProduceSignature(MutableTransactionSignatureCreator( | ProduceSignature(MutableTransactionSignatureCreator( | ||||
&keystore, &mergedTx, i, amount, sigHashType), | &keystore, &mergedTx, i, amount, sigHashType), | ||||
prevPubKey, sigdata); | prevPubKey, sigdata); | ||||
} | } | ||||
// ... and merge in other signatures: | // ... and merge in other signatures: | ||||
for (const CMutableTransaction &txv : txVariants) { | for (const CMutableTransaction &txv : txVariants) { | ||||
▲ Show 20 Lines • Show All 143 Lines • Show Last 20 Lines |