| 4032 | } |
| 4033 | |
| 4034 | std::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 | |
| 4062 | CKey CWallet::GetBlindingKey(const CScript* script) const { |
| 4063 | CKey key; |
no test coverage detected