From 3911e7e2b350bbc71eea9c74bca58334d54b0b66 Mon Sep 17 00:00:00 2001 From: Byron Hambly Date: Fri, 1 Sep 2023 16:39:08 +0200 Subject: [PATCH] build: fix compilation warnings --- src/key.cpp | 2 +- src/test/fuzz/process_messages.cpp | 1 - src/test/script_standard_tests.cpp | 8 ++++---- src/txmempool.cpp | 1 - 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/key.cpp b/src/key.cpp index 15f49178be..8509071d86 100644 --- a/src/key.cpp +++ b/src/key.cpp @@ -298,7 +298,7 @@ bool CKey::SignSchnorr(const uint256& hash, Span sig, const uint2 uint256 tweak = XOnlyPubKey(pubkey_bytes).ComputeTapTweakHash(merkle_root->IsNull() ? nullptr : merkle_root); if (!secp256k1_keypair_xonly_tweak_add(GetVerifyContext(), &keypair, tweak.data())) return false; } - bool ret = secp256k1_schnorrsig_sign(secp256k1_context_sign, sig.data(), hash.data(), &keypair, aux.data()); + bool ret = secp256k1_schnorrsig_sign32(secp256k1_context_sign, sig.data(), hash.data(), &keypair, aux.data()); if (ret) { // Additional verification step to prevent using a potentially corrupted signature secp256k1_xonly_pubkey pubkey_verify; diff --git a/src/test/fuzz/process_messages.cpp b/src/test/fuzz/process_messages.cpp index 556ae8a664..6e9c3af00e 100644 --- a/src/test/fuzz/process_messages.cpp +++ b/src/test/fuzz/process_messages.cpp @@ -52,7 +52,6 @@ FUZZ_TARGET_INIT(process_messages, initialize_process_messages) connman.AddTestNode(p2p_node); } - int elements_iter_count = 0; LIMITED_WHILE(fuzzed_data_provider.ConsumeBool(), 100) { // ELEMENTS: this loop runs on a single core and achieves nothing that couldn't // be achieved by just repeating the fuzz runs. It typically takes around 11 diff --git a/src/test/script_standard_tests.cpp b/src/test/script_standard_tests.cpp index a04c30e7ec..8886dd8a9a 100644 --- a/src/test/script_standard_tests.cpp +++ b/src/test/script_standard_tests.cpp @@ -391,7 +391,7 @@ BOOST_AUTO_TEST_CASE(script_standard_taproot_builder) BOOST_AUTO_TEST_CASE(bip341_spk_test_vectors) { - using control_set = decltype(TaprootSpendData::scripts)::mapped_type; + // using control_set = decltype(TaprootSpendData::scripts)::mapped_type; UniValue tests; tests.read((const char*)json_tests::bip341_wallet_vectors, sizeof(json_tests::bip341_wallet_vectors)); @@ -426,9 +426,9 @@ BOOST_AUTO_TEST_CASE(bip341_spk_test_vectors) // BOOST_CHECK_EQUAL(vec["intermediary"]["merkleRoot"].get_str(), HexStr(spend_data.merkle_root)); } BOOST_CHECK_EQUAL(spend_data.scripts.size(), scriptposes.size()); - for (const auto& scriptpos : scriptposes) { - // BOOST_CHECK(spend_data.scripts[scriptpos.first] == control_set{ParseHex(vec["expected"]["scriptPathControlBlocks"][scriptpos.second].get_str())}); - } + // for (const auto& scriptpos : scriptposes) { + // BOOST_CHECK(spend_data.scripts[scriptpos.first] == control_set{ParseHex(vec["expected"]["scriptPathControlBlocks"][scriptpos.second].get_str())}); + // } } } diff --git a/src/txmempool.cpp b/src/txmempool.cpp index ea6a4a5c07..c46b685b08 100644 --- a/src/txmempool.cpp +++ b/src/txmempool.cpp @@ -873,7 +873,6 @@ void CTxMemPool::check(const CBlockIndex* active_chain_tip, const CCoinsViewCach assert(it->GetSizeWithDescendants() >= child_sizes + it->GetTxSize()); TxValidationState dummy_state; // Not used. CheckTxInputs() should always pass - CAmount txfee = 0; assert(!tx.IsCoinBase()); // ELEMENTS