MCPcopy Create free account
hub / github.com/bitcoinxt/bitcoinxt / ExtractDestination

Function ExtractDestination

src/script/standard.cpp:203–231  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

201}
202
203bool ExtractDestination(const CScript& scriptPubKey, CTxDestination& addressRet)
204{
205 vector<valtype> vSolutions;
206 txnouttype whichType;
207 if (!Solver(scriptPubKey, whichType, vSolutions))
208 return false;
209
210 if (whichType == TX_PUBKEY)
211 {
212 CPubKey pubKey(vSolutions[0]);
213 if (!pubKey.IsValid())
214 return false;
215
216 addressRet = pubKey.GetID();
217 return true;
218 }
219 else if (whichType == TX_PUBKEYHASH)
220 {
221 addressRet = CKeyID(uint160(vSolutions[0]));
222 return true;
223 }
224 else if (whichType == TX_SCRIPTHASH)
225 {
226 addressRet = CScriptID(uint160(vSolutions[0]));
227 return true;
228 }
229 // Multisig txns have more than one address...
230 return false;
231}
232
233bool ExtractDestinations(const CScript& scriptPubKey, txnouttype& typeRet, vector<CTxDestination>& addressRet, int& nRequiredRet)
234{

Callers 15

BOOST_FOREACHFunction · 0.85
IsChangeMethod · 0.85
GetAmountsMethod · 0.85
GetAddressBalancesMethod · 0.85
BOOST_FOREACHFunction · 0.85
GetAddressGroupingsMethod · 0.85
ExtractDestinationsFunction · 0.85
BOOST_AUTO_TEST_CASEFunction · 0.85
BOOST_FOREACHFunction · 0.85
BOOST_FOREACHFunction · 0.85
Q_FOREACHFunction · 0.85

Calls 6

SolverFunction · 0.85
GetIDMethod · 0.80
CKeyIDClass · 0.70
CScriptIDClass · 0.70
uint160Class · 0.50
IsValidMethod · 0.45

Tested by 2

BOOST_AUTO_TEST_CASEFunction · 0.68
Q_FOREACHFunction · 0.68