Skip to content

Commit 595a7c2

Browse files
committed
Add KEYIMAGE_SIZE constant
This is pretty universal and may be helpful in other areas of the code.
1 parent 480aa78 commit 595a7c2

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

src/core_write.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ void TxToUniv(const CTransaction& tx, const uint256& hashBlock, UniValue& entry,
285285
UniValue arrKeyImages(UniValue::VARR);
286286
for (unsigned int k = 0; k < nSigInputs; k++) {
287287
UniValue objKeyImage(UniValue::VOBJ);
288-
objKeyImage.pushKV(std::to_string(k), HexStr(&vKeyImages[k*33], &vKeyImages[(k*33)+33])); // TODO: add in constant
288+
objKeyImage.pushKV(std::to_string(k), HexStr(&vKeyImages[k*KEYIMAGE_SIZE], &vKeyImages[(k*KEYIMAGE_SIZE)+KEYIMAGE_SIZE])); // TODO: add in constant
289289
arrKeyImages.push_back(objKeyImage);
290290
}
291291
in.pushKV("key_images", arrKeyImages);
@@ -378,7 +378,7 @@ void TxToUniv(const CTransaction& tx, const uint256& hashBlock, UniValue& entry,
378378
UniValue arrKeyImages(UniValue::VARR);
379379
for (unsigned int k = 0; k < nSigInputs; k++) {
380380
UniValue objKeyImage(UniValue::VOBJ);
381-
objKeyImage.pushKV(std::to_string(k), HexStr(&vKeyImages[k*33], &vKeyImages[(k*33)+33])); // TODO: add in constant
381+
objKeyImage.pushKV(std::to_string(k), HexStr(&vKeyImages[k*KEYIMAGE_SIZE], &vKeyImages[(k*KEYIMAGE_SIZE)+KEYIMAGE_SIZE])); // TODO: add in constant
382382
arrKeyImages.push_back(objKeyImage);
383383
}
384384
in.pushKV("key_images", arrKeyImages);

src/veil/ringct/anon.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,12 @@
1010
class CTxMemPool;
1111
class CValidationState;
1212

13+
const size_t KEYIMAGE_SIZE = 33;
1314
const size_t MIN_RINGSIZE = 3;
1415
const size_t MAX_RINGSIZE = 32;
15-
1616
const size_t MAX_ANON_INPUTS = 32; // To raise see MLSAG_MAX_ROWS also
17-
1817
const size_t ANON_FEE_MULTIPLIER = 2;
1918

20-
2119
bool VerifyMLSAG(const CTransaction &tx, CValidationState &state);
2220

2321
bool AddKeyImagesToMempool(const CTransaction &tx, CTxMemPool &pool);

0 commit comments

Comments
 (0)