mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-15 12:51:00 +02:00
Merge d6492d4ed0 into merged_master (Bitcoin PR bitcoin/bitcoin#22650)
This commit is contained in:
commit
ff57e1e65f
14 changed files with 53 additions and 263 deletions
|
|
@ -291,47 +291,6 @@ bool ExtractDestination(const CScript& scriptPubKey, CTxDestination& addressRet)
|
|||
assert(false);
|
||||
}
|
||||
|
||||
// TODO: from v23 ("addresses" and "reqSigs" deprecated) "ExtractDestinations" should be removed
|
||||
bool ExtractDestinations(const CScript& scriptPubKey, TxoutType& typeRet, std::vector<CTxDestination>& addressRet, int& nRequiredRet)
|
||||
{
|
||||
addressRet.clear();
|
||||
std::vector<valtype> vSolutions;
|
||||
typeRet = Solver(scriptPubKey, vSolutions);
|
||||
if (typeRet == TxoutType::NONSTANDARD) {
|
||||
return false;
|
||||
} else if (typeRet == TxoutType::NULL_DATA) {
|
||||
// This is data, not addresses
|
||||
return false;
|
||||
}
|
||||
|
||||
if (typeRet == TxoutType::MULTISIG)
|
||||
{
|
||||
nRequiredRet = vSolutions.front()[0];
|
||||
for (unsigned int i = 1; i < vSolutions.size()-1; i++)
|
||||
{
|
||||
CPubKey pubKey(vSolutions[i]);
|
||||
if (!pubKey.IsValid())
|
||||
continue;
|
||||
|
||||
CTxDestination address = PKHash(pubKey);
|
||||
addressRet.push_back(address);
|
||||
}
|
||||
|
||||
if (addressRet.empty())
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
nRequiredRet = 1;
|
||||
CTxDestination address;
|
||||
if (!ExtractDestination(scriptPubKey, address))
|
||||
return false;
|
||||
addressRet.push_back(address);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
namespace {
|
||||
class CScriptVisitor
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue