MCPcopy Create free account
hub / github.com/ElementsProject/elements / GetReissuanceTokenTypes

Method GetReissuanceTokenTypes

src/wallet/wallet.cpp:4034–4060  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4032}
4033
4034std::map<uint256, std::pair<CAsset, CAsset> > CWallet::GetReissuanceTokenTypes() const {
4035 std::map<uint256, std::pair<CAsset, CAsset> > tokenMap;
4036 {
4037 LOCK(cs_wallet);
4038 for (std::map<uint256, CWalletTx>::const_iterator it = mapWallet.begin(); it != mapWallet.end(); ++it) {
4039 const CWalletTx* pcoin = &(*it).second;
4040 CAsset asset;
4041 CAsset token;
4042 uint256 entropy;
4043 for (unsigned int input_index = 0; input_index < pcoin->tx->vin.size(); input_index++) {
4044 const CAssetIssuance& issuance = pcoin->tx->vin[input_index].assetIssuance;
4045 if (issuance.IsNull()) {
4046 continue;
4047 }
4048 // Only looking at initial issuances
4049 if (issuance.assetBlindingNonce.IsNull()) {
4050 GenerateAssetEntropy(entropy, pcoin->tx->vin[input_index].prevout, issuance.assetEntropy);
4051 CalculateAsset(asset, entropy);
4052 // TODO handle the case with null nAmount (not decided yet)
4053 CalculateReissuanceToken(token, entropy, issuance.nAmount.IsCommitment());
4054 tokenMap[entropy] = std::make_pair(token, asset);
4055 }
4056 }
4057 }
4058 }
4059 return tokenMap;
4060}
4061
4062CKey CWallet::GetBlindingKey(const CScript* script) const {
4063 CKey key;

Callers 1

reissueassetFunction · 0.80

Calls 8

GenerateAssetEntropyFunction · 0.85
CalculateAssetFunction · 0.85
CalculateReissuanceTokenFunction · 0.85
IsCommitmentMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
sizeMethod · 0.45
IsNullMethod · 0.45

Tested by

no test coverage detected