Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

komodo_interest_validate tests #130

Merged
merged 7 commits into from
Dec 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ libbitcoin_common_a_SOURCES = \
komodo_interest.cpp \
komodo_kv.cpp \
komodo_notary.cpp \
komodo_utils.cpp \
komodo_utils.cpp \
netbase.cpp \
metrics.cpp \
primitives/block.cpp \
Expand Down
3 changes: 2 additions & 1 deletion src/Makefile.ktest.include
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ bin_PROGRAMS += komodo-test
test-komodo/test_coins.cpp \
test-komodo/test_haraka_removal.cpp \
test-komodo/test_miner.cpp \
test-komodo/test_oldhash_removal.cpp
test-komodo/test_oldhash_removal.cpp \
test-komodo/test_kmd_feat.cpp

komodo_test_CPPFLAGS = $(komodod_CPPFLAGS)

Expand Down
6 changes: 3 additions & 3 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1798,7 +1798,7 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa
if (chainName.isKMD() && chainActive.Tip() != nullptr
&& !komodo_validate_interest(tx, chainActive.Tip()->nHeight + 1, chainActive.Tip()->GetMedianTimePast() + 777))
{
return error("%s: komodo_validate_interest failed txid.%s", __func__, tx.GetHash().ToString());
return state.DoS(0, error("%s: komodo_validate_interest failed txid.%s", __func__, tx.GetHash().ToString()), REJECT_INVALID, "komodo-interest-invalid");
}

if (!CheckTransaction(tiptime,tx, state, verifier, 0, 0))
Expand Down Expand Up @@ -5333,8 +5333,8 @@ bool ContextualCheckBlock(int32_t slowflag,const CBlock& block, CValidationState
// Interest validation
if (!komodo_validate_interest(tx, txheight, cmptime))
{
fprintf(stderr, "validate intrest failed for txnum.%i tx.%s\n", i, tx.ToString().c_str());
return error("%s: komodo_validate_interest failed", __func__);
fprintf(stderr, "validate interest failed for txnum.%i tx.%s\n", i, tx.ToString().c_str());
return state.DoS(0, error("%s: komodo_validate_interest failed", __func__), REJECT_INVALID, "komodo-interest-invalid");
}

// Check transaction contextually against consensus rules at block height
Expand Down
Loading