mirror of
https://github.com/dashpay/dash.git
synced 2024-12-26 20:42:59 +01:00
Don't return an address for invalid pubkeys
This commit is contained in:
parent
25308337d6
commit
9d7cd4c598
@ -203,7 +203,11 @@ bool ExtractDestination(const CScript& scriptPubKey, CTxDestination& addressRet)
|
|||||||
|
|
||||||
if (whichType == TX_PUBKEY)
|
if (whichType == TX_PUBKEY)
|
||||||
{
|
{
|
||||||
addressRet = CPubKey(vSolutions[0]).GetID();
|
CPubKey pubKey(vSolutions[0]);
|
||||||
|
if (!pubKey.IsValid())
|
||||||
|
return false;
|
||||||
|
|
||||||
|
addressRet = pubKey.GetID();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else if (whichType == TX_PUBKEYHASH)
|
else if (whichType == TX_PUBKEYHASH)
|
||||||
@ -237,9 +241,16 @@ bool ExtractDestinations(const CScript& scriptPubKey, txnouttype& typeRet, vecto
|
|||||||
nRequiredRet = vSolutions.front()[0];
|
nRequiredRet = vSolutions.front()[0];
|
||||||
for (unsigned int i = 1; i < vSolutions.size()-1; i++)
|
for (unsigned int i = 1; i < vSolutions.size()-1; i++)
|
||||||
{
|
{
|
||||||
CTxDestination address = CPubKey(vSolutions[i]).GetID();
|
CPubKey pubKey(vSolutions[i]);
|
||||||
|
if (!pubKey.IsValid())
|
||||||
|
continue;
|
||||||
|
|
||||||
|
CTxDestination address = pubKey.GetID();
|
||||||
addressRet.push_back(address);
|
addressRet.push_back(address);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (addressRet.empty())
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user