Changeset View
Changeset View
Standalone View
Standalone View
src/bitcoin-tx.cpp
Show First 20 Lines • Show All 567 Lines • ▼ Show 20 Lines | static void MutateTxSign(CMutableTransaction &tx, const std::string &flagStr) { | ||||
CBasicKeyStore tempKeystore; | CBasicKeyStore tempKeystore; | ||||
UniValue keysObj = registers["privatekeys"]; | UniValue keysObj = registers["privatekeys"]; | ||||
for (unsigned int kidx = 0; kidx < keysObj.size(); kidx++) { | for (unsigned int kidx = 0; kidx < keysObj.size(); kidx++) { | ||||
if (!keysObj[kidx].isStr()) { | if (!keysObj[kidx].isStr()) { | ||||
throw std::runtime_error("privatekey not a std::string"); | throw std::runtime_error("privatekey not a std::string"); | ||||
} | } | ||||
CBitcoinSecret vchSecret; | CKey key = DecodeSecret(keysObj[kidx].getValStr()); | ||||
bool fGood = vchSecret.SetString(keysObj[kidx].getValStr()); | if (!key.IsValid()) { | ||||
if (!fGood) { | |||||
throw std::runtime_error("privatekey not valid"); | throw std::runtime_error("privatekey not valid"); | ||||
} | } | ||||
CKey key = vchSecret.GetKey(); | |||||
tempKeystore.AddKey(key); | tempKeystore.AddKey(key); | ||||
} | } | ||||
// Add previous txouts given in the RPC call: | // Add previous txouts given in the RPC call: | ||||
if (!registers.count("prevtxs")) { | if (!registers.count("prevtxs")) { | ||||
throw std::runtime_error("prevtxs register variable must be set."); | throw std::runtime_error("prevtxs register variable must be set."); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 287 Lines • Show Last 20 Lines |