#include "wallet.h"
using namespace std;
-using namespace boost;
using namespace json_spirit;
void ScriptPubKeyToJSON(const CScript& scriptPubKey, Object& out, bool fIncludeHex)
if (hashBlock != 0)
{
entry.push_back(Pair("blockhash", hashBlock.GetHex()));
- map<uint256, CBlockIndex*>::iterator mi = mapBlockIndex.find(hashBlock);
+ auto mi = mapBlockIndex.find(hashBlock);
if (mi != mapBlockIndex.end() && (*mi).second)
{
- CBlockIndex* pindex = (*mi).second;
+ auto pindex = (*mi).second;
if (pindex->IsInMainChain())
{
entry.push_back(Pair("confirmations", 1 + nBestHeight - pindex->nHeight));
try {
ssData >> tx;
}
- catch (const std::exception&) {
+ catch (const exception&) {
throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "TX decode failed");
}
ssData >> tx;
txVariants.push_back(tx);
}
- catch (const std::exception&) {
+ catch (const exception&) {
throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "TX decode failed");
}
}
{
static map<string, int> mapSigHashValues =
{
- {"ALL", int(SIGHASH_ALL)},
- {"ALL|ANYONECANPAY", int(SIGHASH_ALL|SIGHASH_ANYONECANPAY)},
- {"NONE", int(SIGHASH_NONE)},
- {"NONE|ANYONECANPAY", int(SIGHASH_NONE|SIGHASH_ANYONECANPAY)},
- {"SINGLE", int(SIGHASH_SINGLE)},
- {"SINGLE|ANYONECANPAY", int(SIGHASH_SINGLE|SIGHASH_ANYONECANPAY)}
+ {"ALL", SIGHASH_ALL},
+ {"ALL|ANYONECANPAY", SIGHASH_ALL|SIGHASH_ANYONECANPAY},
+ {"NONE", SIGHASH_NONE},
+ {"NONE|ANYONECANPAY", SIGHASH_NONE|SIGHASH_ANYONECANPAY},
+ {"SINGLE", SIGHASH_SINGLE},
+ {"SINGLE|ANYONECANPAY", SIGHASH_SINGLE|SIGHASH_ANYONECANPAY}
};
auto strHashType = params[3].get_str();
if (mapSigHashValues.count(strHashType))
try {
ssData >> tx;
}
- catch (const std::exception&) {
+ catch (const exception&) {
throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "TX decode failed");
}
auto hashTx = tx.GetHash();
"(got %" PRIszu " keys, but need at least %d to redeem)", keys.size(), nRequired));
if (keys.size() > 16)
throw runtime_error("Number of addresses involved in the multisignature address creation > 16\nReduce the number");
- std::vector<CPubKey> pubkeys;
+ vector<CPubKey> pubkeys;
pubkeys.resize(keys.size());
for (unsigned int i = 0; i < keys.size(); i++)
{