Skip to content

Commit

Permalink
fix: fixing typos and improving comments. Fixing error message for v2…
Browse files Browse the repository at this point in the history
…0 non-active
  • Loading branch information
knst committed Jul 14, 2023
1 parent 95b8d19 commit 5d29b06
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
18 changes: 9 additions & 9 deletions src/evo/assetlocktx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@

#include <algorithm>

/*
Common code for Asset Lock and Asset Unlock
*/
/**
* Common code for Asset Lock and Asset Unlock
*/
bool CheckAssetLockUnlockTx(const CTransaction& tx, const CBlockIndex* pindexPrev, const CCreditPool& creditPool, TxValidationState& state)
{
switch (tx.nType) {
Expand All @@ -34,9 +34,9 @@ bool CheckAssetLockUnlockTx(const CTransaction& tx, const CBlockIndex* pindexPre
}
}

/*
Asset Lock Transaction
*/
/**
* Asset Lock Transaction
*/
bool CheckAssetLockTx(const CTransaction& tx, TxValidationState& state)
{
if (tx.nType != TRANSACTION_ASSET_LOCK) {
Expand Down Expand Up @@ -101,9 +101,9 @@ std::string CAssetLockPayload::ToString() const
return strprintf("CAssetLockPayload(nVersion=%d,creditOutputs=%s)", nVersion, outputs.c_str());
}

/*
Asset Unlock Transaction (withdrawals)
*/
/**
* Asset Unlock Transaction (withdrawals)
*/

const std::string ASSETUNLOCK_REQUESTID_PREFIX = "plwdtx";

Expand Down
4 changes: 2 additions & 2 deletions src/evo/creditpool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ static std::optional<CBlock> GetBlockForCreditPool(const CBlockIndex* const bloc
if (!ReadBlockFromDisk(block, block_index, consensusParams)) {
throw std::runtime_error("failed-getcbforblock-read");
}
// Should not fail if V20 (DIP0027) are active but it happens for Unit Tests
// Should not fail if V20 (DIP0027) is active but it happens for RegChain (unit tests)
if (block.vtx[0]->nVersion != 3) return std::nullopt;

assert(!block.vtx.empty());
Expand All @@ -126,7 +126,7 @@ CCreditPool CCreditPoolManager::ConstructCreditPool(const CBlockIndex* const blo
{
std::optional<CBlock> block = GetBlockForCreditPool(block_index, consensusParams);
if (!block) {
// If reading of previous block is not read successfully, but
// If reading of previous block is not successfully, but
// prev contains credit pool related data, something strange happened
assert(prev.locked == 0);
assert(prev.indexes.Size() == 0);
Expand Down
2 changes: 1 addition & 1 deletion src/evo/specialtxman.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ bool CheckSpecialTx(const CTransaction& tx, const CBlockIndex* pindexPrev, const
case TRANSACTION_ASSET_LOCK:
case TRANSACTION_ASSET_UNLOCK:
if (!llmq::utils::IsV20Active(pindexPrev)) {
return state.Invalid(TxValidationResult::TX_CONSENSUS, "v20-not-active");
return state.Invalid(TxValidationResult::TX_CONSENSUS, "assetlocks-before-v20");
}
return CheckAssetLockUnlockTx(tx, pindexPrev, creditPool, state);
}
Expand Down

0 comments on commit 5d29b06

Please sign in to comment.