mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-02 09:46:52 -05:00
Merge #20480: Replace boost::variant with std::variant
faa8f68943
Replace boost::variant with std::variant (MarcoFalke) Pull request description: Now that we can use std::variant from the vanilla standard library, drop the third-party boost variant dependency ACKs for top commit: fjahr: Code review ACKfaa8f68943
fanquake: ACKfaa8f68943
Tree-SHA512: 6e3aecd33b00c2e31a763f999247944d5b2ce5e3018f1965c516c1000cd08ff6703a8d50fb0be64883153da2925ae72986b8a6b96586db74057bd05d6f4986e6
This commit is contained in:
commit
bd6af53e1f
16 changed files with 56 additions and 66 deletions
|
@ -8,16 +8,12 @@
|
|||
#include <bech32.h>
|
||||
#include <util/strencodings.h>
|
||||
|
||||
#include <boost/variant/apply_visitor.hpp>
|
||||
#include <boost/variant/static_visitor.hpp>
|
||||
|
||||
#include <algorithm>
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
#include <algorithm>
|
||||
|
||||
namespace
|
||||
{
|
||||
class DestinationEncoder : public boost::static_visitor<std::string>
|
||||
namespace {
|
||||
class DestinationEncoder
|
||||
{
|
||||
private:
|
||||
const CChainParams& m_params;
|
||||
|
@ -209,7 +205,7 @@ std::string EncodeExtKey(const CExtKey& key)
|
|||
|
||||
std::string EncodeDestination(const CTxDestination& dest)
|
||||
{
|
||||
return boost::apply_visitor(DestinationEncoder(Params()), dest);
|
||||
return std::visit(DestinationEncoder(Params()), dest);
|
||||
}
|
||||
|
||||
CTxDestination DecodeDestination(const std::string& str)
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
#include <wallet/wallet.h>
|
||||
|
||||
#include <algorithm>
|
||||
#include <typeinfo>
|
||||
|
||||
#include <QFont>
|
||||
#include <QDebug>
|
||||
|
@ -82,8 +81,9 @@ public:
|
|||
{
|
||||
for (const auto& address : wallet.getAddresses())
|
||||
{
|
||||
if (pk_hash_only && address.dest.type() != typeid(PKHash))
|
||||
if (pk_hash_only && !std::holds_alternative<PKHash>(address.dest)) {
|
||||
continue;
|
||||
}
|
||||
AddressTableEntry::Type addressType = translateTransactionType(
|
||||
QString::fromStdString(address.purpose), address.is_mine);
|
||||
cachedAddressTable.append(AddressTableEntry(addressType,
|
||||
|
@ -261,7 +261,7 @@ bool AddressTableModel::setData(const QModelIndex &index, const QVariant &value,
|
|||
} else if(index.column() == Address) {
|
||||
CTxDestination newAddress = DecodeDestination(value.toString().toStdString());
|
||||
// Refuse to set invalid address, set error status and return false
|
||||
if(boost::get<CNoDestination>(&newAddress))
|
||||
if(std::get_if<CNoDestination>(&newAddress))
|
||||
{
|
||||
editStatus = INVALID_ADDRESS;
|
||||
return false;
|
||||
|
|
|
@ -455,7 +455,7 @@ void CoinControlDialog::updateLabels(CCoinControl& m_coin_control, WalletModel *
|
|||
else if(ExtractDestination(out.txout.scriptPubKey, address))
|
||||
{
|
||||
CPubKey pubkey;
|
||||
PKHash *pkhash = boost::get<PKHash>(&address);
|
||||
PKHash* pkhash = std::get_if<PKHash>(&address);
|
||||
if (pkhash && model->wallet().getPubKey(out.txout.scriptPubKey, ToKeyID(*pkhash), pubkey))
|
||||
{
|
||||
nBytesInputs += (pubkey.IsCompressed() ? 148 : 180);
|
||||
|
|
|
@ -120,7 +120,7 @@ void SignVerifyMessageDialog::on_signMessageButton_SM_clicked()
|
|||
ui->statusLabel_SM->setText(tr("The entered address is invalid.") + QString(" ") + tr("Please check the address and try again."));
|
||||
return;
|
||||
}
|
||||
const PKHash* pkhash = boost::get<PKHash>(&destination);
|
||||
const PKHash* pkhash = std::get_if<PKHash>(&destination);
|
||||
if (!pkhash) {
|
||||
ui->addressIn_SM->setValid(false);
|
||||
ui->statusLabel_SM->setStyleSheet("QLabel { color: red; }");
|
||||
|
|
|
@ -123,7 +123,7 @@ QList<TransactionRecord> TransactionRecord::decomposeTransaction(const interface
|
|||
continue;
|
||||
}
|
||||
|
||||
if (!boost::get<CNoDestination>(&wtx.txout_address[nOut]))
|
||||
if (!std::get_if<CNoDestination>(&wtx.txout_address[nOut]))
|
||||
{
|
||||
// Sent to Bitcoin Address
|
||||
sub.type = TransactionRecord::SendToAddress;
|
||||
|
|
|
@ -209,7 +209,7 @@ CTxDestination AddAndGetMultisigDestination(const int required, const std::vecto
|
|||
return dest;
|
||||
}
|
||||
|
||||
class DescribeAddressVisitor : public boost::static_visitor<UniValue>
|
||||
class DescribeAddressVisitor
|
||||
{
|
||||
public:
|
||||
explicit DescribeAddressVisitor() {}
|
||||
|
@ -267,7 +267,7 @@ public:
|
|||
|
||||
UniValue DescribeAddress(const CTxDestination& dest)
|
||||
{
|
||||
return boost::apply_visitor(DescribeAddressVisitor(), dest);
|
||||
return std::visit(DescribeAddressVisitor(), dest);
|
||||
}
|
||||
|
||||
unsigned int ParseConfirmTarget(const UniValue& value, unsigned int max_target)
|
||||
|
|
|
@ -565,7 +565,7 @@ public:
|
|||
|
||||
Optional<OutputType> GetOutputType() const override
|
||||
{
|
||||
switch (m_destination.which()) {
|
||||
switch (m_destination.index()) {
|
||||
case 1 /* PKHash */:
|
||||
case 2 /* ScriptHash */: return OutputType::LEGACY;
|
||||
case 3 /* WitnessV0ScriptHash */:
|
||||
|
@ -593,7 +593,7 @@ public:
|
|||
{
|
||||
CTxDestination dest;
|
||||
ExtractDestination(m_script, dest);
|
||||
switch (dest.which()) {
|
||||
switch (dest.index()) {
|
||||
case 1 /* PKHash */:
|
||||
case 2 /* ScriptHash */: return OutputType::LEGACY;
|
||||
case 3 /* WitnessV0ScriptHash */:
|
||||
|
|
|
@ -179,18 +179,18 @@ CKeyID GetKeyForDestination(const SigningProvider& store, const CTxDestination&
|
|||
{
|
||||
// Only supports destinations which map to single public keys, i.e. P2PKH,
|
||||
// P2WPKH, and P2SH-P2WPKH.
|
||||
if (auto id = boost::get<PKHash>(&dest)) {
|
||||
if (auto id = std::get_if<PKHash>(&dest)) {
|
||||
return ToKeyID(*id);
|
||||
}
|
||||
if (auto witness_id = boost::get<WitnessV0KeyHash>(&dest)) {
|
||||
if (auto witness_id = std::get_if<WitnessV0KeyHash>(&dest)) {
|
||||
return ToKeyID(*witness_id);
|
||||
}
|
||||
if (auto script_hash = boost::get<ScriptHash>(&dest)) {
|
||||
if (auto script_hash = std::get_if<ScriptHash>(&dest)) {
|
||||
CScript script;
|
||||
CScriptID script_id(*script_hash);
|
||||
CTxDestination inner_dest;
|
||||
if (store.GetCScript(script_id, script) && ExtractDestination(script, inner_dest)) {
|
||||
if (auto inner_witness_id = boost::get<WitnessV0KeyHash>(&inner_dest)) {
|
||||
if (auto inner_witness_id = std::get_if<WitnessV0KeyHash>(&inner_dest)) {
|
||||
return ToKeyID(*inner_witness_id);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -261,9 +261,8 @@ bool ExtractDestinations(const CScript& scriptPubKey, TxoutType& typeRet, std::v
|
|||
return true;
|
||||
}
|
||||
|
||||
namespace
|
||||
{
|
||||
class CScriptVisitor : public boost::static_visitor<CScript>
|
||||
namespace {
|
||||
class CScriptVisitor
|
||||
{
|
||||
public:
|
||||
CScript operator()(const CNoDestination& dest) const
|
||||
|
@ -300,7 +299,7 @@ public:
|
|||
|
||||
CScript GetScriptForDestination(const CTxDestination& dest)
|
||||
{
|
||||
return boost::apply_visitor(CScriptVisitor(), dest);
|
||||
return std::visit(CScriptVisitor(), dest);
|
||||
}
|
||||
|
||||
CScript GetScriptForRawPubKey(const CPubKey& pubKey)
|
||||
|
@ -320,5 +319,5 @@ CScript GetScriptForMultisig(int nRequired, const std::vector<CPubKey>& keys)
|
|||
}
|
||||
|
||||
bool IsValidDestination(const CTxDestination& dest) {
|
||||
return dest.which() != 0;
|
||||
return dest.index() != 0;
|
||||
}
|
||||
|
|
|
@ -9,10 +9,8 @@
|
|||
#include <script/interpreter.h>
|
||||
#include <uint256.h>
|
||||
|
||||
#include <boost/variant.hpp>
|
||||
|
||||
#include <string>
|
||||
|
||||
#include <variant>
|
||||
|
||||
static const bool DEFAULT_ACCEPT_DATACARRIER = true;
|
||||
|
||||
|
@ -211,7 +209,7 @@ struct WitnessUnknown
|
|||
* (taproot outputs do not require their own type as long as no wallet support exists)
|
||||
* A CTxDestination is the internal data type encoded in a bitcoin address
|
||||
*/
|
||||
typedef boost::variant<CNoDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessUnknown> CTxDestination;
|
||||
using CTxDestination = std::variant<CNoDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessUnknown>;
|
||||
|
||||
/** Check whether a CTxDestination is a CNoDestination. */
|
||||
bool IsValidDestination(const CTxDestination& dest);
|
||||
|
|
|
@ -183,23 +183,23 @@ BOOST_AUTO_TEST_CASE(script_standard_ExtractDestination)
|
|||
s.clear();
|
||||
s << ToByteVector(pubkey) << OP_CHECKSIG;
|
||||
BOOST_CHECK(ExtractDestination(s, address));
|
||||
BOOST_CHECK(boost::get<PKHash>(&address) &&
|
||||
*boost::get<PKHash>(&address) == PKHash(pubkey));
|
||||
BOOST_CHECK(std::get_if<PKHash>(&address) &&
|
||||
*std::get_if<PKHash>(&address) == PKHash(pubkey));
|
||||
|
||||
// TxoutType::PUBKEYHASH
|
||||
s.clear();
|
||||
s << OP_DUP << OP_HASH160 << ToByteVector(pubkey.GetID()) << OP_EQUALVERIFY << OP_CHECKSIG;
|
||||
BOOST_CHECK(ExtractDestination(s, address));
|
||||
BOOST_CHECK(boost::get<PKHash>(&address) &&
|
||||
*boost::get<PKHash>(&address) == PKHash(pubkey));
|
||||
BOOST_CHECK(std::get_if<PKHash>(&address) &&
|
||||
*std::get_if<PKHash>(&address) == PKHash(pubkey));
|
||||
|
||||
// TxoutType::SCRIPTHASH
|
||||
CScript redeemScript(s); // initialize with leftover P2PKH script
|
||||
s.clear();
|
||||
s << OP_HASH160 << ToByteVector(CScriptID(redeemScript)) << OP_EQUAL;
|
||||
BOOST_CHECK(ExtractDestination(s, address));
|
||||
BOOST_CHECK(boost::get<ScriptHash>(&address) &&
|
||||
*boost::get<ScriptHash>(&address) == ScriptHash(redeemScript));
|
||||
BOOST_CHECK(std::get_if<ScriptHash>(&address) &&
|
||||
*std::get_if<ScriptHash>(&address) == ScriptHash(redeemScript));
|
||||
|
||||
// TxoutType::MULTISIG
|
||||
s.clear();
|
||||
|
@ -217,7 +217,7 @@ BOOST_AUTO_TEST_CASE(script_standard_ExtractDestination)
|
|||
BOOST_CHECK(ExtractDestination(s, address));
|
||||
WitnessV0KeyHash keyhash;
|
||||
CHash160().Write(pubkey).Finalize(keyhash);
|
||||
BOOST_CHECK(boost::get<WitnessV0KeyHash>(&address) && *boost::get<WitnessV0KeyHash>(&address) == keyhash);
|
||||
BOOST_CHECK(std::get_if<WitnessV0KeyHash>(&address) && *std::get_if<WitnessV0KeyHash>(&address) == keyhash);
|
||||
|
||||
// TxoutType::WITNESS_V0_SCRIPTHASH
|
||||
s.clear();
|
||||
|
@ -225,7 +225,7 @@ BOOST_AUTO_TEST_CASE(script_standard_ExtractDestination)
|
|||
CSHA256().Write(redeemScript.data(), redeemScript.size()).Finalize(scripthash.begin());
|
||||
s << OP_0 << ToByteVector(scripthash);
|
||||
BOOST_CHECK(ExtractDestination(s, address));
|
||||
BOOST_CHECK(boost::get<WitnessV0ScriptHash>(&address) && *boost::get<WitnessV0ScriptHash>(&address) == scripthash);
|
||||
BOOST_CHECK(std::get_if<WitnessV0ScriptHash>(&address) && *std::get_if<WitnessV0ScriptHash>(&address) == scripthash);
|
||||
|
||||
// TxoutType::WITNESS_UNKNOWN with unknown version
|
||||
s.clear();
|
||||
|
@ -235,7 +235,7 @@ BOOST_AUTO_TEST_CASE(script_standard_ExtractDestination)
|
|||
unk.length = 33;
|
||||
unk.version = 1;
|
||||
std::copy(pubkey.begin(), pubkey.end(), unk.program);
|
||||
BOOST_CHECK(boost::get<WitnessUnknown>(&address) && *boost::get<WitnessUnknown>(&address) == unk);
|
||||
BOOST_CHECK(std::get_if<WitnessUnknown>(&address) && *std::get_if<WitnessUnknown>(&address) == unk);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(script_standard_ExtractDestinations)
|
||||
|
@ -259,8 +259,8 @@ BOOST_AUTO_TEST_CASE(script_standard_ExtractDestinations)
|
|||
BOOST_CHECK_EQUAL(whichType, TxoutType::PUBKEY);
|
||||
BOOST_CHECK_EQUAL(addresses.size(), 1U);
|
||||
BOOST_CHECK_EQUAL(nRequired, 1);
|
||||
BOOST_CHECK(boost::get<PKHash>(&addresses[0]) &&
|
||||
*boost::get<PKHash>(&addresses[0]) == PKHash(pubkeys[0]));
|
||||
BOOST_CHECK(std::get_if<PKHash>(&addresses[0]) &&
|
||||
*std::get_if<PKHash>(&addresses[0]) == PKHash(pubkeys[0]));
|
||||
|
||||
// TxoutType::PUBKEYHASH
|
||||
s.clear();
|
||||
|
@ -269,8 +269,8 @@ BOOST_AUTO_TEST_CASE(script_standard_ExtractDestinations)
|
|||
BOOST_CHECK_EQUAL(whichType, TxoutType::PUBKEYHASH);
|
||||
BOOST_CHECK_EQUAL(addresses.size(), 1U);
|
||||
BOOST_CHECK_EQUAL(nRequired, 1);
|
||||
BOOST_CHECK(boost::get<PKHash>(&addresses[0]) &&
|
||||
*boost::get<PKHash>(&addresses[0]) == PKHash(pubkeys[0]));
|
||||
BOOST_CHECK(std::get_if<PKHash>(&addresses[0]) &&
|
||||
*std::get_if<PKHash>(&addresses[0]) == PKHash(pubkeys[0]));
|
||||
|
||||
// TxoutType::SCRIPTHASH
|
||||
CScript redeemScript(s); // initialize with leftover P2PKH script
|
||||
|
@ -280,8 +280,8 @@ BOOST_AUTO_TEST_CASE(script_standard_ExtractDestinations)
|
|||
BOOST_CHECK_EQUAL(whichType, TxoutType::SCRIPTHASH);
|
||||
BOOST_CHECK_EQUAL(addresses.size(), 1U);
|
||||
BOOST_CHECK_EQUAL(nRequired, 1);
|
||||
BOOST_CHECK(boost::get<ScriptHash>(&addresses[0]) &&
|
||||
*boost::get<ScriptHash>(&addresses[0]) == ScriptHash(redeemScript));
|
||||
BOOST_CHECK(std::get_if<ScriptHash>(&addresses[0]) &&
|
||||
*std::get_if<ScriptHash>(&addresses[0]) == ScriptHash(redeemScript));
|
||||
|
||||
// TxoutType::MULTISIG
|
||||
s.clear();
|
||||
|
@ -293,10 +293,10 @@ BOOST_AUTO_TEST_CASE(script_standard_ExtractDestinations)
|
|||
BOOST_CHECK_EQUAL(whichType, TxoutType::MULTISIG);
|
||||
BOOST_CHECK_EQUAL(addresses.size(), 2U);
|
||||
BOOST_CHECK_EQUAL(nRequired, 2);
|
||||
BOOST_CHECK(boost::get<PKHash>(&addresses[0]) &&
|
||||
*boost::get<PKHash>(&addresses[0]) == PKHash(pubkeys[0]));
|
||||
BOOST_CHECK(boost::get<PKHash>(&addresses[1]) &&
|
||||
*boost::get<PKHash>(&addresses[1]) == PKHash(pubkeys[1]));
|
||||
BOOST_CHECK(std::get_if<PKHash>(&addresses[0]) &&
|
||||
*std::get_if<PKHash>(&addresses[0]) == PKHash(pubkeys[0]));
|
||||
BOOST_CHECK(std::get_if<PKHash>(&addresses[1]) &&
|
||||
*std::get_if<PKHash>(&addresses[1]) == PKHash(pubkeys[1]));
|
||||
|
||||
// TxoutType::NULL_DATA
|
||||
s.clear();
|
||||
|
|
|
@ -31,7 +31,7 @@ MessageVerificationResult MessageVerify(
|
|||
return MessageVerificationResult::ERR_INVALID_ADDRESS;
|
||||
}
|
||||
|
||||
if (boost::get<PKHash>(&destination) == nullptr) {
|
||||
if (std::get_if<PKHash>(&destination) == nullptr) {
|
||||
return MessageVerificationResult::ERR_ADDRESS_NO_KEY;
|
||||
}
|
||||
|
||||
|
|
|
@ -627,7 +627,7 @@ static RPCHelpMan signmessage()
|
|||
throw JSONRPCError(RPC_TYPE_ERROR, "Invalid address");
|
||||
}
|
||||
|
||||
const PKHash *pkhash = boost::get<PKHash>(&dest);
|
||||
const PKHash* pkhash = std::get_if<PKHash>(&dest);
|
||||
if (!pkhash) {
|
||||
throw JSONRPCError(RPC_TYPE_ERROR, "Address does not refer to key");
|
||||
}
|
||||
|
@ -3002,7 +3002,7 @@ static RPCHelpMan listunspent()
|
|||
std::unique_ptr<SigningProvider> provider = pwallet->GetSolvingProvider(scriptPubKey);
|
||||
if (provider) {
|
||||
if (scriptPubKey.IsPayToScriptHash()) {
|
||||
const CScriptID& hash = CScriptID(boost::get<ScriptHash>(address));
|
||||
const CScriptID& hash = CScriptID(std::get<ScriptHash>(address));
|
||||
CScript redeemScript;
|
||||
if (provider->GetCScript(hash, redeemScript)) {
|
||||
entry.pushKV("redeemScript", HexStr(redeemScript));
|
||||
|
@ -3012,7 +3012,7 @@ static RPCHelpMan listunspent()
|
|||
bool extracted = ExtractDestination(redeemScript, witness_destination);
|
||||
CHECK_NONFATAL(extracted);
|
||||
// Also return the witness script
|
||||
const WitnessV0ScriptHash& whash = boost::get<WitnessV0ScriptHash>(witness_destination);
|
||||
const WitnessV0ScriptHash& whash = std::get<WitnessV0ScriptHash>(witness_destination);
|
||||
CScriptID id;
|
||||
CRIPEMD160().Write(whash.begin(), whash.size()).Finalize(id.begin());
|
||||
CScript witnessScript;
|
||||
|
@ -3022,7 +3022,7 @@ static RPCHelpMan listunspent()
|
|||
}
|
||||
}
|
||||
} else if (scriptPubKey.IsPayToWitnessScriptHash()) {
|
||||
const WitnessV0ScriptHash& whash = boost::get<WitnessV0ScriptHash>(address);
|
||||
const WitnessV0ScriptHash& whash = std::get<WitnessV0ScriptHash>(address);
|
||||
CScriptID id;
|
||||
CRIPEMD160().Write(whash.begin(), whash.size()).Finalize(id.begin());
|
||||
CScript witnessScript;
|
||||
|
@ -3645,7 +3645,7 @@ static RPCHelpMan rescanblockchain()
|
|||
};
|
||||
}
|
||||
|
||||
class DescribeWalletAddressVisitor : public boost::static_visitor<UniValue>
|
||||
class DescribeWalletAddressVisitor
|
||||
{
|
||||
public:
|
||||
const SigningProvider * const provider;
|
||||
|
@ -3664,7 +3664,7 @@ public:
|
|||
UniValue subobj(UniValue::VOBJ);
|
||||
UniValue detail = DescribeAddress(embedded);
|
||||
subobj.pushKVs(detail);
|
||||
UniValue wallet_detail = boost::apply_visitor(*this, embedded);
|
||||
UniValue wallet_detail = std::visit(*this, embedded);
|
||||
subobj.pushKVs(wallet_detail);
|
||||
subobj.pushKV("address", EncodeDestination(embedded));
|
||||
subobj.pushKV("scriptPubKey", HexStr(subscript));
|
||||
|
@ -3747,7 +3747,7 @@ static UniValue DescribeWalletAddress(const CWallet* const pwallet, const CTxDes
|
|||
provider = pwallet->GetSolvingProvider(script);
|
||||
}
|
||||
ret.pushKVs(detail);
|
||||
ret.pushKVs(boost::apply_visitor(DescribeWalletAddressVisitor(provider.get()), dest));
|
||||
ret.pushKVs(std::visit(DescribeWalletAddressVisitor(provider.get()), dest));
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
@ -550,7 +550,7 @@ BOOST_FIXTURE_TEST_CASE(ListCoins, ListCoinsTestingSetup)
|
|||
list = wallet->ListCoins();
|
||||
}
|
||||
BOOST_CHECK_EQUAL(list.size(), 1U);
|
||||
BOOST_CHECK_EQUAL(boost::get<PKHash>(list.begin()->first).ToString(), coinbaseAddress);
|
||||
BOOST_CHECK_EQUAL(std::get<PKHash>(list.begin()->first).ToString(), coinbaseAddress);
|
||||
BOOST_CHECK_EQUAL(list.begin()->second.size(), 1U);
|
||||
|
||||
// Check initial balance from one mature coinbase transaction.
|
||||
|
@ -566,7 +566,7 @@ BOOST_FIXTURE_TEST_CASE(ListCoins, ListCoinsTestingSetup)
|
|||
list = wallet->ListCoins();
|
||||
}
|
||||
BOOST_CHECK_EQUAL(list.size(), 1U);
|
||||
BOOST_CHECK_EQUAL(boost::get<PKHash>(list.begin()->first).ToString(), coinbaseAddress);
|
||||
BOOST_CHECK_EQUAL(std::get<PKHash>(list.begin()->first).ToString(), coinbaseAddress);
|
||||
BOOST_CHECK_EQUAL(list.begin()->second.size(), 2U);
|
||||
|
||||
// Lock both coins. Confirm number of available coins drops to 0.
|
||||
|
@ -595,7 +595,7 @@ BOOST_FIXTURE_TEST_CASE(ListCoins, ListCoinsTestingSetup)
|
|||
list = wallet->ListCoins();
|
||||
}
|
||||
BOOST_CHECK_EQUAL(list.size(), 1U);
|
||||
BOOST_CHECK_EQUAL(boost::get<PKHash>(list.begin()->first).ToString(), coinbaseAddress);
|
||||
BOOST_CHECK_EQUAL(std::get<PKHash>(list.begin()->first).ToString(), coinbaseAddress);
|
||||
BOOST_CHECK_EQUAL(list.begin()->second.size(), 2U);
|
||||
}
|
||||
|
||||
|
|
|
@ -2789,7 +2789,7 @@ bool CWallet::CreateTransactionInternal(
|
|||
CScript scriptChange;
|
||||
|
||||
// coin control: send change to custom address
|
||||
if (!boost::get<CNoDestination>(&coin_control.destChange)) {
|
||||
if (!std::get_if<CNoDestination>(&coin_control.destChange)) {
|
||||
scriptChange = GetScriptForDestination(coin_control.destChange);
|
||||
} else { // no coin control: send change to newly generated address
|
||||
// Note: We use a new key here to keep it from being obvious which side is the change.
|
||||
|
@ -3724,7 +3724,7 @@ unsigned int CWallet::ComputeTimeSmart(const CWalletTx& wtx) const
|
|||
|
||||
bool CWallet::AddDestData(WalletBatch& batch, const CTxDestination &dest, const std::string &key, const std::string &value)
|
||||
{
|
||||
if (boost::get<CNoDestination>(&dest))
|
||||
if (std::get_if<CNoDestination>(&dest))
|
||||
return false;
|
||||
|
||||
m_address_book[dest].destdata.insert(std::make_pair(key, value));
|
||||
|
|
|
@ -71,9 +71,6 @@ EXPECTED_BOOST_INCLUDES=(
|
|||
boost/thread/mutex.hpp
|
||||
boost/thread/shared_mutex.hpp
|
||||
boost/thread/thread.hpp
|
||||
boost/variant.hpp
|
||||
boost/variant/apply_visitor.hpp
|
||||
boost/variant/static_visitor.hpp
|
||||
)
|
||||
|
||||
for BOOST_INCLUDE in $(git grep '^#include <boost/' -- "*.cpp" "*.h" | cut -f2 -d: | cut -f2 -d'<' | cut -f1 -d'>' | sort -u); do
|
||||
|
|
Loading…
Add table
Reference in a new issue