diff --git a/.github/workflows/msvc-analysis.yml b/.github/workflows/msvc-analysis.yml index a8d0c5b..e49c7cb 100644 --- a/.github/workflows/msvc-analysis.yml +++ b/.github/workflows/msvc-analysis.yml @@ -18,9 +18,6 @@ on: pull_request: - schedule: - - cron: '40 10 * * 0' - env: # Path to the CMake build directory. build: '${{ github.workspace }}/build' diff --git a/src/params.cpp b/src/params.cpp index 7a34bc4..522f5ea 100644 --- a/src/params.cpp +++ b/src/params.cpp @@ -393,13 +393,13 @@ bool Params::valid() const } if (m_mainWallet.is_subaddress()) { - LOGERR(1, "Wallet address must be a main address (starting with 4...). Try \"p2pool --help\"."); + LOGERR(1, "Wallet address must be a main address (starting with SC1). Try \"p2pool --help\"."); return false; } if (m_subaddress.valid()) { if (!m_subaddress.is_subaddress()) { - LOGERR(1, "Subaddress must start with 8... Try \"p2pool --help\"."); + LOGERR(1, "Subaddress must start with SC1s. Try \"p2pool --help\"."); return false; } if (m_subaddress.type() != m_mainWallet.type()) { diff --git a/src/wallet.cpp b/src/wallet.cpp index a47faca..c7e73fd 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -205,11 +205,11 @@ bool Wallet::decode(const char* address) static constexpr char log_category_prefix[] = "Wallet "; char spend_hex[65] = {0}, view_hex[65] = {0}, data_hex[200] = {0}, prefix_hex[20] = {0}; for (int i = 0; i < 32; i++) { - sprintf(spend_hex + i*2, "%02x", m_spendPublicKey.h[i]); - sprintf(view_hex + i*2, "%02x", m_viewPublicKey.h[i]); + sprintf(spend_hex + static_cast(i)*2, "%02x", m_spendPublicKey.h[i]); + sprintf(view_hex + static_cast(i)*2, "%02x", m_viewPublicKey.h[i]); } for (int i = 0; i < std::min(data_index, 80); i++) { - sprintf(data_hex + i*2, "%02x", data[i]); + sprintf(data_hex + static_cast(i)*2, "%02x", data[i]); } sprintf(prefix_hex, "0x%llx", static_cast(m_prefix)); LOGINFO(6, "decode varint_len=" << varint_len << " data_index=" << data_index << " prefix=" << static_cast(prefix_hex)); @@ -222,7 +222,7 @@ bool Wallet::decode(const char* address) memcpy(&m_checksum, data + data_index - sizeof(m_checksum), sizeof(m_checksum)); uint8_t md[200]; - keccak(data, data_index - sizeof(m_checksum), md); + keccak(data, static_cast(data_index - sizeof(m_checksum)), md); uint32_t calculated_checksum; memcpy(&calculated_checksum, md, sizeof(calculated_checksum)); @@ -306,15 +306,15 @@ void Wallet::encode(char (&buf)[ADDRESS_LENGTH]) const // Calculate and write checksum uint8_t md[200]; - const int pre_checksum_size = data_index + HASH_SIZE * 2; + const int pre_checksum_size = static_cast(data_index + HASH_SIZE * 2); keccak(data, pre_checksum_size, md); memcpy(data + pre_checksum_size, md, sizeof(m_checksum)); - - const int total_data_size = pre_checksum_size + sizeof(m_checksum); - + + const int total_data_size = static_cast(pre_checksum_size + sizeof(m_checksum)); + // Encode to base58 with variable-length data - const int actual_num_full_blocks = total_data_size / sizeof(uint64_t); - const int actual_last_block_bytes = total_data_size % sizeof(uint64_t); + const int actual_num_full_blocks = static_cast(total_data_size / sizeof(uint64_t)); + const int actual_last_block_bytes = static_cast(total_data_size % sizeof(uint64_t)); const int actual_last_block_size_index = actual_last_block_bytes > 0 ? block_sizes_lookup[actual_last_block_bytes] : -1; int buf_index = 0; diff --git a/src/wallet.h b/src/wallet.h index 43c06fa..ee6c92d 100644 --- a/src/wallet.h +++ b/src/wallet.h @@ -24,7 +24,7 @@ namespace p2pool { class Wallet { public: - static constexpr int ADDRESS_LENGTH = 97; + static constexpr int ADDRESS_LENGTH = 150; explicit Wallet(const char* address);