Changeset View
Changeset View
Standalone View
Standalone View
src/bitcoin-tx.cpp
Show All 12 Lines | |||||
#include <core_io.h> | #include <core_io.h> | ||||
#include <key_io.h> | #include <key_io.h> | ||||
#include <primitives/transaction.h> | #include <primitives/transaction.h> | ||||
#include <script/script.h> | #include <script/script.h> | ||||
#include <script/sign.h> | #include <script/sign.h> | ||||
#include <script/signingprovider.h> | #include <script/signingprovider.h> | ||||
#include <util/moneystr.h> | #include <util/moneystr.h> | ||||
#include <util/strencodings.h> | #include <util/strencodings.h> | ||||
#include <util/string.h> | |||||
#include <util/system.h> | #include <util/system.h> | ||||
#include <util/translation.h> | #include <util/translation.h> | ||||
#include <univalue.h> | #include <univalue.h> | ||||
#include <boost/algorithm/string.hpp> | #include <boost/algorithm/string.hpp> | ||||
#include <cstdio> | #include <cstdio> | ||||
▲ Show 20 Lines • Show All 347 Lines • ▼ Show 20 Lines | static void MutateTxAddOutMultiSig(CMutableTransaction &tx, | ||||
// Validate there are the correct number of pubkeys | // Validate there are the correct number of pubkeys | ||||
if (vStrInputParts.size() < numkeys + 3) { | if (vStrInputParts.size() < numkeys + 3) { | ||||
throw std::runtime_error("incorrect number of multisig pubkeys"); | throw std::runtime_error("incorrect number of multisig pubkeys"); | ||||
} | } | ||||
if (required < 1 || required > MAX_PUBKEYS_PER_MULTISIG || numkeys < 1 || | if (required < 1 || required > MAX_PUBKEYS_PER_MULTISIG || numkeys < 1 || | ||||
numkeys > MAX_PUBKEYS_PER_MULTISIG || numkeys < required) { | numkeys > MAX_PUBKEYS_PER_MULTISIG || numkeys < required) { | ||||
throw std::runtime_error("multisig parameter mismatch. Required " + | throw std::runtime_error("multisig parameter mismatch. Required " + | ||||
std::to_string(required) + " of " + | ToString(required) + " of " + | ||||
std::to_string(numkeys) + "signatures."); | ToString(numkeys) + "signatures."); | ||||
} | } | ||||
// extract and validate PUBKEYs | // extract and validate PUBKEYs | ||||
std::vector<CPubKey> pubkeys; | std::vector<CPubKey> pubkeys; | ||||
for (int pos = 1; pos <= int(numkeys); pos++) { | for (int pos = 1; pos <= int(numkeys); pos++) { | ||||
CPubKey pubkey(ParseHex(vStrInputParts[pos + 2])); | CPubKey pubkey(ParseHex(vStrInputParts[pos + 2])); | ||||
if (!pubkey.IsFullyValid()) { | if (!pubkey.IsFullyValid()) { | ||||
throw std::runtime_error("invalid TX output pubkey"); | throw std::runtime_error("invalid TX output pubkey"); | ||||
▲ Show 20 Lines • Show All 512 Lines • Show Last 20 Lines |