├── lib ├── Global │ ├── Constants.cpp │ └── version.h.in ├── crypto │ ├── keccak.h │ ├── jh.h │ ├── random.h │ ├── hash-extra-blake.c │ ├── hash-extra-groestl.c │ ├── hash-extra-skein.c │ ├── hash-extra-jh.c │ ├── blake256.h │ └── hash.c ├── Breakpad │ └── Breakpad.h ├── Platform │ ├── mingw │ │ └── alloca.h │ ├── msc │ │ ├── alloca.h │ │ ├── stdbool.h │ │ └── sys │ │ │ └── param.h │ ├── Linux │ │ └── System │ │ │ ├── ErrorMessage.h │ │ │ ├── ErrorMessage.cpp │ │ │ ├── Future.h │ │ │ ├── Timer.h │ │ │ ├── Ipv4Resolver.h │ │ │ └── TcpConnector.h │ ├── OSX │ │ └── System │ │ │ ├── ErrorMessage.h │ │ │ ├── asm.s │ │ │ ├── ErrorMessage.cpp │ │ │ ├── Timer.h │ │ │ ├── Ipv4Resolver.h │ │ │ └── Context.c │ ├── Android │ │ └── System │ │ │ ├── ErrorMessage.h │ │ │ ├── ErrorMessage.cpp │ │ │ ├── Future.h │ │ │ ├── Context.h │ │ │ ├── Timer.h │ │ │ ├── Ipv4Resolver.h │ │ │ └── TcpConnector.h │ ├── FreeBSD │ │ └── System │ │ │ ├── ErrorMessage.h │ │ │ ├── asm.s │ │ │ ├── ErrorMessage.cpp │ │ │ ├── Timer.h │ │ │ └── Ipv4Resolver.h │ └── Windows │ │ └── System │ │ ├── ErrorMessage.h │ │ ├── Future.h │ │ ├── Timer.h │ │ └── Ipv4Resolver.h ├── Common │ ├── pod-class.h │ ├── static_assert.h │ ├── DnsTools.h │ ├── SignalHandler.h │ ├── IInputStream.h │ ├── IOutputStream.h │ ├── StdInputStream.cpp │ ├── CommandLine.cpp │ ├── StringOutputStream.cpp │ ├── StringOutputStream.h │ ├── ScopeExit.cpp │ ├── StdOutputStream.cpp │ ├── StringInputStream.h │ ├── Util.h │ ├── Base58.h │ ├── StdInputStream.h │ ├── StdOutputStream.h │ ├── VectorOutputStream.cpp │ ├── MemoryInputStream.h │ ├── VectorOutputStream.h │ ├── StringInputStream.cpp │ ├── ScopeExit.h │ ├── ConsoleTools.h │ └── PathTools.h ├── Wallet │ ├── WalletErrors.cpp │ ├── LegacyKeysImporter.h │ ├── WalletRpcServerErrorCodes.h │ ├── WalletAsyncContextCounter.h │ └── WalletAsyncContextCounter.cpp ├── NodeRpcProxy │ └── NodeErrors.cpp ├── Http │ └── HttpParserErrorCodes.cpp ├── CryptoNoteCore │ ├── ITxPoolObserver.h │ ├── IBlockchainStorageObserver.h │ ├── ICoreObserver.h │ ├── Difficulty.h │ ├── CryptoNoteBasic.cpp │ ├── IBlock.h │ ├── ITimeProvider.h │ ├── CoreConfig.h │ ├── MinerConfig.h │ ├── CryptoNoteStatInfo.h │ ├── TransactionApi.h │ └── VerificationContext.h ├── InProcessNode │ └── InProcessNodeErrors.cpp ├── PaymentGate │ ├── WalletServiceErrorCategory.cpp │ └── NodeFactory.h ├── System │ ├── InterruptedException.h │ ├── EventLock.h │ ├── RemoteEventLock.h │ ├── EventLock.cpp │ ├── ContextGroupTimeout.h │ ├── Ipv4Address.h │ ├── Event.h │ ├── ContextGroup.h │ └── ContextGroupTimeout.cpp ├── Logging │ ├── FileLogger.cpp │ ├── FileLogger.h │ ├── ConsoleLogger.h │ ├── StreamLogger.h │ ├── LoggerGroup.h │ └── LoggerManager.h ├── Serialization │ ├── IStream.h │ ├── JsonInputStreamSerializer.h │ ├── KVBinaryInputStreamSerializer.h │ └── JsonInputStreamSerializer.cpp ├── CryptoNoteProtocol │ ├── ICryptoNoteProtocolObserver.h │ ├── ICryptoNoteProtocolQuery.h │ └── CryptoNoteProtocolHandlerCommon.h ├── Rpc │ ├── CoreRpcServerErrorCodes.h │ └── RpcServerConfig.h ├── WalletLegacy │ ├── KeysStorage.h │ └── WalletLegacySerialization.h ├── Transfers │ ├── IObservableImpl.h │ └── CommonTypes.h └── P2p │ └── P2pNetworks.h ├── .github └── FUNDING.yml ├── cmake ├── hunter │ └── HunterConfig.cmake ├── external │ ├── GTest.cmake │ ├── Threads.cmake │ ├── codecov.cmake │ └── Boost.cmake └── project │ ├── GlobalOptions.cmake │ ├── CompilerSettings.cmake │ └── GlobalVariables.cmake ├── .gitattributes ├── .gitmodules ├── src ├── BinaryInfo │ ├── icons │ │ ├── miner.ico │ │ ├── wallet.ico │ │ └── qwertycoin.ico │ ├── miner.rc │ ├── walletd.rc │ ├── daemon.rc │ ├── optimizer.rc │ ├── simplewallet.rc │ └── connectivity_tool.rc ├── Miner │ ├── MinerEvent.h │ └── MiningConfig.h └── PaymentGateService │ ├── RpcNodeConfiguration.h │ └── ConfigurationManager.h ├── tests ├── Data │ ├── account-002bee2f8e16f5de4db0d3b8ce9227c8c0b7f9688348b028e022cb43f210968b40a69cdc8531fd4a2e7c9e144eec48bb477733d70ce5f9b85338a07cb10b849ad8fb │ ├── account-007af2d7c5ffd8f69005debae820207820805e28c7d7a16714591143f56fb51e2b91ad0c1a535567e6292b321773df5e5aaace00fe767c4f09de452838575357ca9f │ ├── account-009b82d66dfaaba55a581913fa09d6c5bebe179cd73731781265c96e9e630dcd27fd5d20e7f1d0fa42619de9ca8fe4c0659f6959b2bebb15079cdaed07a442a78486 │ └── account-00aff84db50d6a54dd56051379f6c336fdd330d1cb11e7523bbf71f30b1ae760fa47ace8679b6486f79429980fd2331715a631f5729db284eb1fc6f108aeb7a7f4fe ├── HashTests │ └── tests-slow.txt ├── CryptoTests │ ├── crypto-ops.c │ ├── crypto-ops-data.c │ ├── hash.c │ ├── random.c │ └── crypto-tests.h ├── CoreTests │ ├── TransactionTests.h │ ├── AccountBoostSerialization.h │ └── Chaingen001.h ├── SystemTests │ ├── main.cpp │ └── ErrorMessageTests.cpp ├── UnitTests │ ├── main.cpp │ ├── EventWaiter.h │ ├── EventWaiter.cpp │ └── UnitTestsUtils.h ├── PerformanceTests │ ├── GenerateKeyDerivation.h │ ├── IsOutToAccount.h │ └── GenerateKeyImageHelper.h └── cryptotest.pl ├── include ├── android.h ├── IObservable.h └── IStreamSerializable.h ├── SECURITY.md ├── LICENSE.txt ├── .appveyor.yml └── .gitignore /lib/Global/Constants.cpp: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | custom: https://qwertycoin.org/#development -------------------------------------------------------------------------------- /cmake/hunter/HunterConfig.cmake: -------------------------------------------------------------------------------- 1 | hunter_config(Boost VERSION 1.72.0-p1) 2 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "cmake/polly"] 2 | path = cmake/polly 3 | url = https://github.com/ruslo/polly.git 4 | -------------------------------------------------------------------------------- /cmake/external/GTest.cmake: -------------------------------------------------------------------------------- 1 | # GTest 2 | 3 | hunter_add_package(GTest) 4 | find_package(GTest CONFIG REQUIRED) 5 | -------------------------------------------------------------------------------- /src/BinaryInfo/icons/miner.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qwertycoin-org/qwertycoin/HEAD/src/BinaryInfo/icons/miner.ico -------------------------------------------------------------------------------- /src/BinaryInfo/icons/wallet.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qwertycoin-org/qwertycoin/HEAD/src/BinaryInfo/icons/wallet.ico -------------------------------------------------------------------------------- /src/BinaryInfo/icons/qwertycoin.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qwertycoin-org/qwertycoin/HEAD/src/BinaryInfo/icons/qwertycoin.ico -------------------------------------------------------------------------------- /cmake/external/Threads.cmake: -------------------------------------------------------------------------------- 1 | # Threads 2 | 3 | if(WIN32) 4 | set(CMAKE_USE_WIN32_THREADS_INIT TRUE) 5 | endif() 6 | 7 | if(UNIX AND NOT ANDROID) 8 | set(CMAKE_THREAD_PREFER_PTHREAD TRUE) 9 | set(THREADS_PREFER_PTHREAD_FLAG TRUE) 10 | endif() 11 | 12 | find_package(Threads REQUIRED) 13 | -------------------------------------------------------------------------------- /tests/Data/account-002bee2f8e16f5de4db0d3b8ce9227c8c0b7f9688348b028e022cb43f210968b40a69cdc8531fd4a2e7c9e144eec48bb477733d70ce5f9b85338a07cb10b849ad8fb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qwertycoin-org/qwertycoin/HEAD/tests/Data/account-002bee2f8e16f5de4db0d3b8ce9227c8c0b7f9688348b028e022cb43f210968b40a69cdc8531fd4a2e7c9e144eec48bb477733d70ce5f9b85338a07cb10b849ad8fb -------------------------------------------------------------------------------- /tests/Data/account-007af2d7c5ffd8f69005debae820207820805e28c7d7a16714591143f56fb51e2b91ad0c1a535567e6292b321773df5e5aaace00fe767c4f09de452838575357ca9f: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qwertycoin-org/qwertycoin/HEAD/tests/Data/account-007af2d7c5ffd8f69005debae820207820805e28c7d7a16714591143f56fb51e2b91ad0c1a535567e6292b321773df5e5aaace00fe767c4f09de452838575357ca9f -------------------------------------------------------------------------------- /tests/Data/account-009b82d66dfaaba55a581913fa09d6c5bebe179cd73731781265c96e9e630dcd27fd5d20e7f1d0fa42619de9ca8fe4c0659f6959b2bebb15079cdaed07a442a78486: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qwertycoin-org/qwertycoin/HEAD/tests/Data/account-009b82d66dfaaba55a581913fa09d6c5bebe179cd73731781265c96e9e630dcd27fd5d20e7f1d0fa42619de9ca8fe4c0659f6959b2bebb15079cdaed07a442a78486 -------------------------------------------------------------------------------- /tests/Data/account-00aff84db50d6a54dd56051379f6c336fdd330d1cb11e7523bbf71f30b1ae760fa47ace8679b6486f79429980fd2331715a631f5729db284eb1fc6f108aeb7a7f4fe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/qwertycoin-org/qwertycoin/HEAD/tests/Data/account-00aff84db50d6a54dd56051379f6c336fdd330d1cb11e7523bbf71f30b1ae760fa47ace8679b6486f79429980fd2331715a631f5729db284eb1fc6f108aeb7a7f4fe -------------------------------------------------------------------------------- /cmake/project/GlobalOptions.cmake: -------------------------------------------------------------------------------- 1 | option(DEVELOPER_BUILD "Developer build" OFF) 2 | option(BUILD_ALL "Build all available lib, executable and test targets" ${DEVELOPER_BUILD}) 3 | option(BUILD_WITH_COVERAGE "Enable coverage reporting" ${BUILD_ALL}) 4 | option(BUILD_WITH_TOOLS "Build with tools" ${BUILD_ALL}) 5 | option(BUILD_WITH_TESTS "Build with tests" ${BUILD_ALL}) 6 | option(BUILD_WITH_PACKAGE "Build with package" ${BUILD_ALL}) 7 | -------------------------------------------------------------------------------- /tests/HashTests/tests-slow.txt: -------------------------------------------------------------------------------- 1 | 2f8e3df40bd11f9ac90c743ca8e32bb391da4fb98612aa3b6cdc639ee00b31f5 6465206f6d6e69627573206475626974616e64756d 2 | 722fa8ccd594d40e4a41f3822734304c8d5eff7e1b528408e2229da38ba553c4 6162756e64616e732063617574656c61206e6f6e206e6f636574 3 | bbec2cacf69866a8e740380fe7b818fc78f8571221742d729d9d02d7f8989b87 63617665617420656d70746f72 4 | b1257de4efc5ce28c6b40ceb1c6c8f812a64634eb3e81c5220bee9b2b76a6f05 6578206e6968696c6f206e6968696c20666974 5 | -------------------------------------------------------------------------------- /lib/crypto/keccak.h: -------------------------------------------------------------------------------- 1 | // keccak.h 2 | // 19-Nov-11 Markku-Juhani O. Saarinen 3 | 4 | #ifndef KECCAK_H 5 | #define KECCAK_H 6 | 7 | #include 8 | #include 9 | 10 | #ifndef KECCAK_ROUNDS 11 | #define KECCAK_ROUNDS 24 12 | #endif 13 | 14 | #ifndef ROTL64 15 | #define ROTL64(x, y) (((x) << (y)) | ((x) >> (64 - (y)))) 16 | #endif 17 | 18 | // compute a keccak hash (md) of given byte length from "in" 19 | int keccak(const uint8_t *in, int inlen, uint8_t *md, int mdlen); 20 | 21 | // update the state 22 | void keccakf(uint64_t st[25], int norounds); 23 | 24 | void keccak1600(const uint8_t *in, int inlen, uint8_t *md); 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /lib/Global/version.h.in: -------------------------------------------------------------------------------- 1 | #define STR_HELPER(x) #x 2 | #define STR(x) STR_HELPER(x) 3 | 4 | #define PROJECT_NAME "@PROJECT_DISPLAY_NAME@" 5 | #define PROJECT_SITE "@PROJECT_VENDOR_URL@" 6 | #define PROJECT_COPYRIGHT "@PROJECT_COPYRIGHT@" 7 | #define APP_VER_MAJOR 6 8 | #define APP_VER_MINOR 0 9 | #define APP_VER_REV 10 10 | #define APP_VER_BUILD 6130 11 | 12 | #define BUILD_COMMIT_ID "@PROJECT_GIT_COMMIT_ID@" 13 | #define PROJECT_VERSION STR(APP_VER_MAJOR) "." STR(APP_VER_MINOR) "." STR(APP_VER_REV) 14 | #define PROJECT_VERSION_BUILD_NO STR(APP_VER_BUILD) 15 | #define PROJECT_VERSION_LONG PROJECT_VERSION "." PROJECT_VERSION_BUILD_NO " (" BUILD_COMMIT_ID ")" 16 | #define PROJECT_DESCRIPTION PROJECT_NAME " " PROJECT_VERSION_LONG 17 | -------------------------------------------------------------------------------- /cmake/external/codecov.cmake: -------------------------------------------------------------------------------- 1 | # codecov 2 | 3 | add_library(codecov INTERFACE) 4 | 5 | if(CMAKE_CXX_COMPILER_ID MATCHES "Clang|GNU") 6 | message(STATUS "Compiler ${CMAKE_CXX_COMPILER_ID} supports code-coverage.") 7 | 8 | target_compile_options(codecov 9 | INTERFACE 10 | -O0 # no optimization 11 | -g # generate debug info 12 | --coverage # sets all required flags 13 | ) 14 | 15 | if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.13) 16 | target_link_options(codecov INTERFACE --coverage) 17 | else() 18 | target_link_libraries(codecov INTERFACE --coverage) 19 | endif() 20 | else() 21 | message(STATUS "Compiler ${CMAKE_CXX_COMPILER_ID} doesn't support code-coverage.") 22 | endif() 23 | -------------------------------------------------------------------------------- /lib/Breakpad/Breakpad.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2018-2023, The Qwertycoin Group. 2 | // 3 | // Licensed under the GNU General Public License, Version 3. 4 | // See the file LICENSE from this package for details. 5 | 6 | #pragma once 7 | 8 | #include 9 | 10 | namespace google_breakpad { 11 | class ExceptionHandler; 12 | } // namespace google_breakpad 13 | 14 | namespace Qwertycoin { 15 | 16 | namespace Breakpad { 17 | 18 | class ExceptionHandler 19 | { 20 | public: 21 | explicit ExceptionHandler(const std::string &dumpPath = std::string()); 22 | virtual ~ExceptionHandler(); 23 | 24 | static void dummyCrash(); 25 | 26 | private: 27 | google_breakpad::ExceptionHandler *m_exceptionHandler = nullptr; 28 | }; 29 | 30 | } // namespace Breakpad 31 | 32 | } // namespace Qwertycoin 33 | -------------------------------------------------------------------------------- /lib/crypto/jh.h: -------------------------------------------------------------------------------- 1 | /*This program gives the 64-bit optimized bitslice implementation of JH using ANSI C 2 | 3 | -------------------------------- 4 | Performance 5 | 6 | Microprocessor: Intel CORE 2 processor (Core 2 Duo Mobile T6600 2.2GHz) 7 | Operating System: 64-bit Ubuntu 10.04 (Linux kernel 2.6.32-22-generic) 8 | Speed for long message: 9 | 1) 45.8 cycles/byte compiler: Intel C++ Compiler 11.1 compilation option: icc -O2 10 | 2) 56.8 cycles/byte compiler: gcc 4.4.3 compilation option: gcc -O3 11 | 12 | -------------------------------- 13 | Last Modified: January 16, 2011 14 | */ 15 | #pragma once 16 | 17 | typedef unsigned char BitSequence; 18 | typedef unsigned long long DataLength; 19 | typedef enum {SUCCESS = 0, FAIL = 1, BAD_HASHLEN = 2} HashReturn; 20 | 21 | HashReturn jh_hash(int hashbitlen, const BitSequence *data, DataLength databitlen, BitSequence *hashval); 22 | -------------------------------------------------------------------------------- /include/android.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifdef ANDROID 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | namespace std { 13 | 14 | template 15 | string to_string(T value) 16 | { 17 | std::ostringstream os; 18 | os << value; 19 | return os.str(); 20 | } 21 | 22 | /* 23 | inline unsigned long stoul (std::string const &str, size_t *idx = 0, int base = 10) 24 | { 25 | char *endp; 26 | unsigned long value = strtoul(str.c_str(), &endp, base); 27 | if (endp == str.c_str()) { 28 | throw std::invalid_argument("my_stoul"); 29 | } 30 | 31 | if (value == ULONG_MAX && errno == ERANGE) { 32 | throw std::out_of_range("my_stoul"); 33 | } 34 | 35 | if (idx) { 36 | *idx = endp - str.c_str(); 37 | } 38 | 39 | return value; 40 | } 41 | */ 42 | } // namespace std 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | ![image](https://cdn.qwertycoin.org/images/press/other/qwc-github-3.png) 2 | 3 | # Security Policy 4 | We offer binary images of the latest releases here: https://releases.qwertycoin.org 5 | More information at [qwertycoin.org](https://qwertycoin.org/) 6 | 7 | ## Supported Versions 8 | 9 | Supported Qwertycoin-Core Versions. Please do not use versions below the supported minimum versions. 10 | 11 | | Version | Supported | 12 | | ------- | ------------------ | 13 | | 5.3.1 | :white_check_mark: | 14 | | 5.2.x | :x: | 15 | | 5.1.x | :x: | 16 | | 4.4.x | :x: | 17 | | < 4.0 | :x: | 18 | 19 | ## Reporting a Vulnerability 20 | 21 | If you think you have found an issue, or a Vulnerability in our Codebase don't hesiate to contact us a.s.a.p. 22 | Please use the Github Issue function for that: https://github.com/qwertycoin-org/qwertycoin/issues/new?template=bug_report.md 23 | -------------------------------------------------------------------------------- /tests/CryptoTests/crypto-ops.c: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #include "crypto/crypto-ops.c" 20 | -------------------------------------------------------------------------------- /lib/Platform/mingw/alloca.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | -------------------------------------------------------------------------------- /tests/CryptoTests/crypto-ops-data.c: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #include "crypto/crypto-ops-data.c" 20 | -------------------------------------------------------------------------------- /tests/CryptoTests/hash.c: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #include "crypto/hash.c" 20 | #include "crypto/keccak.c" 21 | -------------------------------------------------------------------------------- /tests/CoreTests/TransactionTests.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | bool test_transactions(); 22 | bool test_block_creation(); 23 | -------------------------------------------------------------------------------- /lib/Platform/msc/alloca.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #ifndef __cplusplus 22 | #define alloca(size) _alloca(size) 23 | #endif 24 | -------------------------------------------------------------------------------- /lib/Common/pod-class.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #if defined(_MSC_VER) 22 | #define POD_CLASS struct 23 | #else 24 | #define POD_CLASS class 25 | #endif 26 | -------------------------------------------------------------------------------- /lib/Platform/msc/stdbool.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #if !defined(__cplusplus) 22 | 23 | typedef int bool; 24 | #define true 1 25 | #define false 0 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /lib/crypto/random.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #if !defined(__cplusplus) 22 | #include 23 | #endif 24 | 25 | void generate_random_bytes(size_t n, void *result); 26 | -------------------------------------------------------------------------------- /lib/Common/static_assert.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #ifndef __cplusplus 22 | #ifdef __clang__ 23 | 24 | #define static_assert _Static_assert 25 | 26 | #endif 27 | #endif 28 | -------------------------------------------------------------------------------- /lib/Platform/msc/sys/param.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #define LITTLE_ENDIAN 1234 22 | #define BIG_ENDIAN 4321 23 | #define PDP_ENDIAN 3412 24 | #define BYTE_ORDER LITTLE_ENDIAN 25 | -------------------------------------------------------------------------------- /tests/SystemTests/main.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #include 20 | 21 | int main(int argc, char** argv) { 22 | ::testing::InitGoogleTest(&argc, argv); 23 | return RUN_ALL_TESTS(); 24 | } 25 | -------------------------------------------------------------------------------- /tests/UnitTests/main.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #include "gtest/gtest.h" 20 | 21 | int main(int argc, char** argv) 22 | { 23 | ::testing::InitGoogleTest(&argc, argv); 24 | return RUN_ALL_TESTS(); 25 | } 26 | -------------------------------------------------------------------------------- /tests/CryptoTests/random.c: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #include "crypto/random.c" 20 | 21 | #include "crypto-tests.h" 22 | 23 | void setup_random(void) { 24 | memset(&state, 42, sizeof(union hash_state)); 25 | } 26 | -------------------------------------------------------------------------------- /lib/Platform/Linux/System/ErrorMessage.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | 23 | namespace System { 24 | 25 | std::string lastErrorMessage(); 26 | std::string errorMessage(int); 27 | 28 | } // namespace System 29 | -------------------------------------------------------------------------------- /lib/Platform/OSX/System/ErrorMessage.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | 23 | namespace System { 24 | 25 | std::string lastErrorMessage(); 26 | std::string errorMessage(int); 27 | 28 | } // namespace System 29 | -------------------------------------------------------------------------------- /lib/Platform/Android/System/ErrorMessage.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | 23 | namespace System { 24 | 25 | std::string lastErrorMessage(); 26 | std::string errorMessage(int); 27 | 28 | } // namespace System 29 | -------------------------------------------------------------------------------- /lib/Platform/FreeBSD/System/ErrorMessage.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | 23 | namespace System { 24 | 25 | std::string lastErrorMessage(); 26 | std::string errorMessage(int); 27 | 28 | } // namespace System 29 | -------------------------------------------------------------------------------- /lib/Platform/Windows/System/ErrorMessage.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | 23 | namespace System { 24 | 25 | std::string lastErrorMessage(); 26 | std::string errorMessage(int); 27 | 28 | } // namespace System 29 | -------------------------------------------------------------------------------- /lib/Common/DnsTools.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2017-2018, Karbo developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | #include 23 | 24 | namespace Common { 25 | 26 | #ifndef __ANDROID__ 27 | bool fetch_dns_txt(const std::string &domain, std::vector &records); 28 | #endif 29 | 30 | } // namespace Common 31 | -------------------------------------------------------------------------------- /lib/crypto/hash-extra-blake.c: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #include 20 | #include 21 | 22 | #include "blake256.h" 23 | 24 | void hash_extra_blake(const void *data, size_t length, char *hash) { 25 | blake256_hash((uint8_t*)hash, data, length); 26 | } 27 | -------------------------------------------------------------------------------- /lib/crypto/hash-extra-groestl.c: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #include 20 | #include 21 | 22 | #include "groestl.h" 23 | 24 | void hash_extra_groestl(const void *data, size_t length, char *hash) { 25 | groestl(data, length * 8, (uint8_t*)hash); 26 | } 27 | -------------------------------------------------------------------------------- /lib/Common/SignalHandler.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | 23 | namespace Tools { 24 | 25 | class SignalHandler 26 | { 27 | public: 28 | static bool install(std::function t); 29 | }; 30 | 31 | } // namespace Tools 32 | -------------------------------------------------------------------------------- /lib/Wallet/WalletErrors.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #include 20 | 21 | namespace CryptoNote { 22 | 23 | namespace error { 24 | 25 | WalletErrorCategory WalletErrorCategory::INSTANCE; 26 | 27 | } // namespace error 28 | 29 | } // namespace CryptoNote 30 | -------------------------------------------------------------------------------- /lib/NodeRpcProxy/NodeErrors.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #include 20 | 21 | namespace CryptoNote { 22 | 23 | namespace error { 24 | 25 | NodeErrorCategory NodeErrorCategory::INSTANCE; 26 | 27 | } // namespace error 28 | 29 | } // namespace CryptoNote 30 | -------------------------------------------------------------------------------- /lib/Platform/OSX/System/asm.s: -------------------------------------------------------------------------------- 1 | .globl _setmcontext 2 | _setmcontext: 3 | movq 16(%rdi), %rsi 4 | movq 24(%rdi), %rdx 5 | movq 32(%rdi), %rcx 6 | movq 40(%rdi), %r8 7 | movq 48(%rdi), %r9 8 | movq 56(%rdi), %rax 9 | movq 64(%rdi), %rbx 10 | movq 72(%rdi), %rbp 11 | movq 80(%rdi), %r10 12 | movq 88(%rdi), %r11 13 | movq 96(%rdi), %r12 14 | movq 104(%rdi), %r13 15 | movq 112(%rdi), %r14 16 | movq 120(%rdi), %r15 17 | movq 184(%rdi), %rsp 18 | pushq 160(%rdi) /* new %eip */ 19 | movq 8(%rdi), %rdi 20 | ret 21 | 22 | .globl _getmcontext 23 | _getmcontext: 24 | movq %rdi, 8(%rdi) 25 | movq %rsi, 16(%rdi) 26 | movq %rdx, 24(%rdi) 27 | movq %rcx, 32(%rdi) 28 | movq %r8, 40(%rdi) 29 | movq %r9, 48(%rdi) 30 | movq $1, 56(%rdi) /* %rax */ 31 | movq %rbx, 64(%rdi) 32 | movq %rbp, 72(%rdi) 33 | movq %r10, 80(%rdi) 34 | movq %r11, 88(%rdi) 35 | movq %r12, 96(%rdi) 36 | movq %r13, 104(%rdi) 37 | movq %r14, 112(%rdi) 38 | movq %r15, 120(%rdi) 39 | 40 | movq (%rsp), %rcx /* %rip */ 41 | movq %rcx, 160(%rdi) 42 | leaq 8(%rsp), %rcx /* %rsp */ 43 | movq %rcx, 184(%rdi) 44 | 45 | movq 32(%rdi), %rcx /* restore %rcx */ 46 | movq $0, %rax 47 | ret -------------------------------------------------------------------------------- /src/BinaryInfo/miner.rc: -------------------------------------------------------------------------------- 1 | #include 2 | #include "version.h" 3 | 4 | IDI_ICON1 ICON DISCARDABLE "./icons/miner.ico" 5 | 6 | VS_VERSION_INFO VERSIONINFO 7 | FILEVERSION APP_VER_MAJOR,APP_VER_MINOR,APP_VER_REV,APP_VER_BUILD 8 | PRODUCTVERSION APP_VER_MAJOR,APP_VER_MINOR,APP_VER_REV,APP_VER_BUILD 9 | FILEFLAGSMASK 0x3fL 10 | #ifdef _DEBUG 11 | FILEFLAGS VS_FF_DEBUG 12 | #else 13 | FILEFLAGS 0x0L 14 | #endif 15 | FILEOS VOS__WINDOWS32 16 | FILETYPE VFT_APP 17 | FILESUBTYPE 0x0L 18 | BEGIN 19 | BLOCK "StringFileInfo" 20 | BEGIN 21 | BLOCK "000004b0" 22 | BEGIN 23 | VALUE "CompanyName", PROJECT_SITE 24 | VALUE "FileDescription", PROJECT_NAME " Miner " PROJECT_VERSION_LONG 25 | VALUE "FileVersion", PROJECT_VERSION_BUILD_NO 26 | VALUE "LegalCopyright", PROJECT_COPYRIGHT 27 | VALUE "OriginalFilename", "miner.exe" 28 | VALUE "ProductName", PROJECT_NAME 29 | VALUE "ProductVersion", PROJECT_VERSION 30 | END 31 | END 32 | BLOCK "VarFileInfo" 33 | BEGIN 34 | VALUE "Translation", 0x0, 1200 35 | END 36 | END 37 | 38 | -------------------------------------------------------------------------------- /lib/Platform/FreeBSD/System/asm.s: -------------------------------------------------------------------------------- 1 | .globl _setmcontext 2 | _setmcontext: 3 | movq 16(%rdi), %rsi 4 | movq 24(%rdi), %rdx 5 | movq 32(%rdi), %rcx 6 | movq 40(%rdi), %r8 7 | movq 48(%rdi), %r9 8 | movq 56(%rdi), %rax 9 | movq 64(%rdi), %rbx 10 | movq 72(%rdi), %rbp 11 | movq 80(%rdi), %r10 12 | movq 88(%rdi), %r11 13 | movq 96(%rdi), %r12 14 | movq 104(%rdi), %r13 15 | movq 112(%rdi), %r14 16 | movq 120(%rdi), %r15 17 | movq 184(%rdi), %rsp 18 | pushq 160(%rdi) /* new %eip */ 19 | movq 8(%rdi), %rdi 20 | ret 21 | 22 | .globl _getmcontext 23 | _getmcontext: 24 | movq %rdi, 8(%rdi) 25 | movq %rsi, 16(%rdi) 26 | movq %rdx, 24(%rdi) 27 | movq %rcx, 32(%rdi) 28 | movq %r8, 40(%rdi) 29 | movq %r9, 48(%rdi) 30 | movq $1, 56(%rdi) /* %rax */ 31 | movq %rbx, 64(%rdi) 32 | movq %rbp, 72(%rdi) 33 | movq %r10, 80(%rdi) 34 | movq %r11, 88(%rdi) 35 | movq %r12, 96(%rdi) 36 | movq %r13, 104(%rdi) 37 | movq %r14, 112(%rdi) 38 | movq %r15, 120(%rdi) 39 | 40 | movq (%rsp), %rcx /* %rip */ 41 | movq %rcx, 160(%rdi) 42 | leaq 8(%rsp), %rcx /* %rsp */ 43 | movq %rcx, 184(%rdi) 44 | 45 | movq 32(%rdi), %rcx /* restore %rcx */ 46 | movq $0, %rax 47 | ret -------------------------------------------------------------------------------- /src/BinaryInfo/walletd.rc: -------------------------------------------------------------------------------- 1 | #include 2 | #include "version.h" 3 | 4 | IDI_ICON1 ICON DISCARDABLE "./icons/wallet.ico" 5 | 6 | VS_VERSION_INFO VERSIONINFO 7 | FILEVERSION APP_VER_MAJOR,APP_VER_MINOR,APP_VER_REV,APP_VER_BUILD 8 | PRODUCTVERSION APP_VER_MAJOR,APP_VER_MINOR,APP_VER_REV,APP_VER_BUILD 9 | FILEFLAGSMASK 0x3fL 10 | #ifdef _DEBUG 11 | FILEFLAGS VS_FF_DEBUG 12 | #else 13 | FILEFLAGS 0x0L 14 | #endif 15 | FILEOS VOS__WINDOWS32 16 | FILETYPE VFT_APP 17 | FILESUBTYPE 0x0L 18 | BEGIN 19 | BLOCK "StringFileInfo" 20 | BEGIN 21 | BLOCK "000004b0" 22 | BEGIN 23 | VALUE "CompanyName", PROJECT_SITE 24 | VALUE "FileDescription", PROJECT_NAME " Walletd " PROJECT_VERSION_LONG 25 | VALUE "FileVersion", PROJECT_VERSION_BUILD_NO 26 | VALUE "LegalCopyright", PROJECT_COPYRIGHT 27 | VALUE "OriginalFilename", "walletd.exe" 28 | VALUE "ProductName", PROJECT_NAME 29 | VALUE "ProductVersion", PROJECT_VERSION 30 | END 31 | END 32 | BLOCK "VarFileInfo" 33 | BEGIN 34 | VALUE "Translation", 0x0, 1200 35 | END 36 | END 37 | 38 | -------------------------------------------------------------------------------- /lib/Http/HttpParserErrorCodes.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #include 20 | 21 | namespace CryptoNote { 22 | 23 | namespace error { 24 | 25 | HttpParserErrorCategory HttpParserErrorCategory::INSTANCE; 26 | 27 | } // namespace error 28 | 29 | } // namespace CryptoNote 30 | -------------------------------------------------------------------------------- /src/BinaryInfo/daemon.rc: -------------------------------------------------------------------------------- 1 | #include 2 | #include "version.h" 3 | 4 | IDI_ICON1 ICON DISCARDABLE "./icons/qwertycoin.ico" 5 | 6 | VS_VERSION_INFO VERSIONINFO 7 | FILEVERSION APP_VER_MAJOR,APP_VER_MINOR,APP_VER_REV,APP_VER_BUILD 8 | PRODUCTVERSION APP_VER_MAJOR,APP_VER_MINOR,APP_VER_REV,APP_VER_BUILD 9 | FILEFLAGSMASK 0x3fL 10 | #ifdef _DEBUG 11 | FILEFLAGS VS_FF_DEBUG 12 | #else 13 | FILEFLAGS 0x0L 14 | #endif 15 | FILEOS VOS__WINDOWS32 16 | FILETYPE VFT_APP 17 | FILESUBTYPE 0x0L 18 | BEGIN 19 | BLOCK "StringFileInfo" 20 | BEGIN 21 | BLOCK "000004b0" 22 | BEGIN 23 | VALUE "CompanyName", PROJECT_SITE 24 | VALUE "FileDescription", PROJECT_NAME " Daemon " PROJECT_VERSION_LONG 25 | VALUE "FileVersion", PROJECT_VERSION_BUILD_NO 26 | VALUE "LegalCopyright", PROJECT_COPYRIGHT 27 | VALUE "OriginalFilename", "qwertycoind.exe" 28 | VALUE "ProductName", PROJECT_NAME 29 | VALUE "ProductVersion", PROJECT_VERSION 30 | END 31 | END 32 | BLOCK "VarFileInfo" 33 | BEGIN 34 | VALUE "Translation", 0x0, 1200 35 | END 36 | END 37 | 38 | -------------------------------------------------------------------------------- /lib/CryptoNoteCore/ITxPoolObserver.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | namespace CryptoNote { 22 | 23 | class ITxPoolObserver 24 | { 25 | public: 26 | virtual ~ITxPoolObserver() = default; 27 | 28 | virtual void txDeletedFromPool() = 0; 29 | }; 30 | 31 | } // namespace CryptoNote 32 | -------------------------------------------------------------------------------- /src/BinaryInfo/optimizer.rc: -------------------------------------------------------------------------------- 1 | #include 2 | #include "version.h" 3 | 4 | IDI_ICON1 ICON DISCARDABLE "./icons/wallet.ico" 5 | 6 | VS_VERSION_INFO VERSIONINFO 7 | FILEVERSION APP_VER_MAJOR,APP_VER_MINOR,APP_VER_REV,APP_VER_BUILD 8 | PRODUCTVERSION APP_VER_MAJOR,APP_VER_MINOR,APP_VER_REV,APP_VER_BUILD 9 | FILEFLAGSMASK 0x3fL 10 | #ifdef _DEBUG 11 | FILEFLAGS VS_FF_DEBUG 12 | #else 13 | FILEFLAGS 0x0L 14 | #endif 15 | FILEOS VOS__WINDOWS32 16 | FILETYPE VFT_APP 17 | FILESUBTYPE 0x0L 18 | BEGIN 19 | BLOCK "StringFileInfo" 20 | BEGIN 21 | BLOCK "000004b0" 22 | BEGIN 23 | VALUE "CompanyName", PROJECT_SITE 24 | VALUE "FileDescription", PROJECT_NAME " Walletd Optimizer " PROJECT_VERSION_LONG 25 | VALUE "FileVersion", PROJECT_VERSION_BUILD_NO 26 | VALUE "LegalCopyright", PROJECT_COPYRIGHT 27 | VALUE "OriginalFilename", "optimizer.exe" 28 | VALUE "ProductName", PROJECT_NAME 29 | VALUE "ProductVersion", PROJECT_VERSION 30 | END 31 | END 32 | BLOCK "VarFileInfo" 33 | BEGIN 34 | VALUE "Translation", 0x0, 1200 35 | END 36 | END 37 | 38 | -------------------------------------------------------------------------------- /src/BinaryInfo/simplewallet.rc: -------------------------------------------------------------------------------- 1 | #include 2 | #include "version.h" 3 | 4 | IDI_ICON1 ICON DISCARDABLE "./icons/wallet.ico" 5 | 6 | VS_VERSION_INFO VERSIONINFO 7 | FILEVERSION APP_VER_MAJOR,APP_VER_MINOR,APP_VER_REV,APP_VER_BUILD 8 | PRODUCTVERSION APP_VER_MAJOR,APP_VER_MINOR,APP_VER_REV,APP_VER_BUILD 9 | FILEFLAGSMASK 0x3fL 10 | #ifdef _DEBUG 11 | FILEFLAGS VS_FF_DEBUG 12 | #else 13 | FILEFLAGS 0x0L 14 | #endif 15 | FILEOS VOS__WINDOWS32 16 | FILETYPE VFT_APP 17 | FILESUBTYPE 0x0L 18 | BEGIN 19 | BLOCK "StringFileInfo" 20 | BEGIN 21 | BLOCK "000004b0" 22 | BEGIN 23 | VALUE "CompanyName", PROJECT_SITE 24 | VALUE "FileDescription", PROJECT_NAME " SimpleWallet " PROJECT_VERSION_LONG 25 | VALUE "FileVersion", PROJECT_VERSION_BUILD_NO 26 | VALUE "LegalCopyright", PROJECT_COPYRIGHT 27 | VALUE "OriginalFilename", "simplewallet.exe" 28 | VALUE "ProductName", PROJECT_NAME 29 | VALUE "ProductVersion", PROJECT_VERSION 30 | END 31 | END 32 | BLOCK "VarFileInfo" 33 | BEGIN 34 | VALUE "Translation", 0x0, 1200 35 | END 36 | END 37 | 38 | -------------------------------------------------------------------------------- /src/Miner/MinerEvent.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | namespace Miner { 22 | 23 | enum class MinerEventType: uint8_t 24 | { 25 | BLOCK_MINED, 26 | BLOCKCHAIN_UPDATED 27 | }; 28 | 29 | struct MinerEvent 30 | { 31 | MinerEventType type; 32 | }; 33 | 34 | } // namespace Miner 35 | -------------------------------------------------------------------------------- /tests/SystemTests/ErrorMessageTests.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #include 20 | #include 21 | 22 | using namespace System; 23 | 24 | TEST(ErrorMessageTests, testErrorMessage) { 25 | auto msg = errorMessage(100); 26 | ASSERT_EQ(msg.substr(0, 12), "result=100, "); 27 | } 28 | -------------------------------------------------------------------------------- /include/IObservable.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | namespace CryptoNote { 22 | 23 | template 24 | class IObservable 25 | { 26 | public: 27 | virtual void addObserver(T *observer) = 0; 28 | virtual void removeObserver(T *observer) = 0; 29 | }; 30 | 31 | } // namespace CryptoNote 32 | -------------------------------------------------------------------------------- /lib/InProcessNode/InProcessNodeErrors.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #include 20 | 21 | namespace CryptoNote { 22 | 23 | namespace error { 24 | 25 | InProcessNodeErrorCategory InProcessNodeErrorCategory::INSTANCE; 26 | 27 | } // namespace error 28 | 29 | } // namespace CryptoNote 30 | -------------------------------------------------------------------------------- /include/IStreamSerializable.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | 23 | namespace CryptoNote { 24 | 25 | class IStreamSerializable { 26 | public: 27 | virtual void save(std::ostream &os) = 0; 28 | virtual void load(std::istream &in) = 0; 29 | }; 30 | 31 | } // namespace CryptoNote 32 | -------------------------------------------------------------------------------- /lib/Common/IInputStream.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | 23 | namespace Common { 24 | 25 | class IInputStream 26 | { 27 | public: 28 | virtual ~IInputStream() = default; 29 | 30 | virtual size_t readSome(void *data, size_t size) = 0; 31 | }; 32 | 33 | } // namespace Common 34 | -------------------------------------------------------------------------------- /src/BinaryInfo/connectivity_tool.rc: -------------------------------------------------------------------------------- 1 | #include 2 | #include "version.h" 3 | 4 | IDI_ICON1 ICON DISCARDABLE "./icons/qwertycoin.ico" 5 | 6 | VS_VERSION_INFO VERSIONINFO 7 | FILEVERSION APP_VER_MAJOR,APP_VER_MINOR,APP_VER_REV,APP_VER_BUILD 8 | PRODUCTVERSION APP_VER_MAJOR,APP_VER_MINOR,APP_VER_REV,APP_VER_BUILD 9 | FILEFLAGSMASK 0x3fL 10 | #ifdef _DEBUG 11 | FILEFLAGS VS_FF_DEBUG 12 | #else 13 | FILEFLAGS 0x0L 14 | #endif 15 | FILEOS VOS__WINDOWS32 16 | FILETYPE VFT_APP 17 | FILESUBTYPE 0x0L 18 | BEGIN 19 | BLOCK "StringFileInfo" 20 | BEGIN 21 | BLOCK "000004b0" 22 | BEGIN 23 | VALUE "CompanyName", PROJECT_SITE 24 | VALUE "FileDescription", PROJECT_NAME " Connectivity_Tool " PROJECT_VERSION_LONG 25 | VALUE "FileVersion", PROJECT_VERSION_BUILD_NO 26 | VALUE "LegalCopyright", PROJECT_COPYRIGHT 27 | VALUE "OriginalFilename", "connectivity_tool.exe" 28 | VALUE "ProductName", PROJECT_NAME 29 | VALUE "ProductVersion", PROJECT_VERSION 30 | END 31 | END 32 | BLOCK "VarFileInfo" 33 | BEGIN 34 | VALUE "Translation", 0x0, 1200 35 | END 36 | END 37 | 38 | -------------------------------------------------------------------------------- /lib/PaymentGate/WalletServiceErrorCategory.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #include 20 | 21 | namespace CryptoNote { 22 | 23 | namespace error { 24 | 25 | WalletServiceErrorCategory WalletServiceErrorCategory::INSTANCE; 26 | 27 | } // namespace error 28 | 29 | } // namespace CryptoNote 30 | -------------------------------------------------------------------------------- /lib/Common/IOutputStream.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | 23 | namespace Common { 24 | 25 | class IOutputStream 26 | { 27 | public: 28 | virtual ~IOutputStream() = default; 29 | 30 | virtual size_t writeSome(const void *data, size_t size) = 0; 31 | }; 32 | 33 | } // namespace Common 34 | -------------------------------------------------------------------------------- /lib/CryptoNoteCore/IBlockchainStorageObserver.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | namespace CryptoNote { 22 | 23 | class IBlockchainStorageObserver 24 | { 25 | public: 26 | virtual ~IBlockchainStorageObserver() = default; 27 | 28 | virtual void blockchainUpdated() = 0; 29 | }; 30 | 31 | } // namespace CryptoNote 32 | -------------------------------------------------------------------------------- /lib/CryptoNoteCore/ICoreObserver.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | namespace CryptoNote { 22 | 23 | class ICoreObserver 24 | { 25 | public: 26 | virtual ~ICoreObserver() = default; 27 | 28 | virtual void blockchainUpdated() {}; 29 | virtual void poolUpdated() {}; 30 | }; 31 | 32 | } // namespace CryptoNote 33 | -------------------------------------------------------------------------------- /lib/crypto/hash-extra-skein.c: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #include 20 | #include 21 | 22 | #include "hash-ops.h" 23 | #include "skein.h" 24 | 25 | void hash_extra_skein(const void *data, size_t length, char *hash) { 26 | int r = skein_hash(8 * HASH_SIZE, data, 8 * length, (uint8_t*)hash); 27 | assert(SKEIN_SUCCESS == r); 28 | } 29 | -------------------------------------------------------------------------------- /lib/CryptoNoteCore/Difficulty.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | #include 23 | #include 24 | 25 | namespace CryptoNote { 26 | 27 | typedef std::uint64_t difficulty_type; 28 | 29 | bool check_hash(const Crypto::Hash &hash, difficulty_type difficulty); 30 | 31 | } // namespace CryptoNote 32 | -------------------------------------------------------------------------------- /lib/System/InterruptedException.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | 23 | namespace System { 24 | 25 | class InterruptedException : public std::exception 26 | { 27 | public: 28 | const char *what() const noexcept override 29 | { 30 | return "interrupted"; 31 | } 32 | }; 33 | 34 | } // namespace System 35 | -------------------------------------------------------------------------------- /lib/CryptoNoteCore/CryptoNoteBasic.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #include 20 | #include 21 | 22 | namespace CryptoNote { 23 | 24 | KeyPair generateKeyPair() 25 | { 26 | KeyPair k; 27 | 28 | Crypto::generate_keys(k.publicKey, k.secretKey); 29 | 30 | return k; 31 | } 32 | 33 | } // namespace CryptoNote 34 | -------------------------------------------------------------------------------- /lib/System/EventLock.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | namespace System { 22 | 23 | class Event; 24 | 25 | class EventLock 26 | { 27 | public: 28 | explicit EventLock(Event &event); 29 | ~EventLock(); 30 | 31 | EventLock &operator=(const EventLock &) = delete; 32 | 33 | private: 34 | Event &m_event; 35 | }; 36 | 37 | } // namespace System 38 | -------------------------------------------------------------------------------- /lib/Wallet/LegacyKeysImporter.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | #include 23 | 24 | namespace CryptoNote { 25 | 26 | void importLegacyKeys(const std::string &legacyKeysFilename, 27 | const std::string &password, 28 | std::ostream &destination); 29 | 30 | } // namespace CryptoNote 31 | -------------------------------------------------------------------------------- /lib/crypto/hash-extra-jh.c: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #include 20 | #include 21 | #include 22 | #include 23 | 24 | #include "jh.h" 25 | #include "hash-ops.h" 26 | 27 | void hash_extra_jh(const void *data, size_t length, char *hash) { 28 | int r = jh_hash(HASH_SIZE * 8, data, 8 * length, (uint8_t*)hash); 29 | assert(SUCCESS == r); 30 | } 31 | -------------------------------------------------------------------------------- /cmake/project/CompilerSettings.cmake: -------------------------------------------------------------------------------- 1 | if(NOT CMAKE_C_STANDARD) 2 | set(CMAKE_C_STANDARD 11) 3 | set(CMAKE_C_STANDARD_REQUIRED ON) 4 | endif() 5 | 6 | if(NOT CMAKE_CXX_STANDARD) 7 | set(CMAKE_CXX_STANDARD 14) 8 | set(CMAKE_CXX_STANDARD_REQUIRED ON) 9 | endif() 10 | 11 | # Don't use e.g. GNU extension (like -std=gnu++11) for portability 12 | set(CMAKE_CXX_EXTENSIONS OFF) 13 | 14 | if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") 15 | # Clang and AppleClang 16 | elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") 17 | # GCC 18 | 19 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_GNU_SOURCE") 20 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_GNU_SOURCE") 21 | 22 | # With GCC 6.1.1 the compiled binary malfunctions due to aliasing. 23 | # Until that is fixed in the code (Issue #847), force compiler to be conservative. 24 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-strict-aliasing") 25 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-strict-aliasing") 26 | elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel") 27 | # Intel C++ 28 | elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") 29 | # Visual Studio C++ 30 | 31 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /bigobj") 32 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj") 33 | endif() 34 | -------------------------------------------------------------------------------- /lib/System/RemoteEventLock.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | namespace System { 22 | 23 | class Dispatcher; 24 | class Event; 25 | 26 | class RemoteEventLock 27 | { 28 | public: 29 | RemoteEventLock(Dispatcher &dispatcher, Event &event); 30 | ~RemoteEventLock(); 31 | 32 | private: 33 | Dispatcher &dispatcher; 34 | Event &event; 35 | }; 36 | 37 | } // namespace System 38 | -------------------------------------------------------------------------------- /lib/Common/StdInputStream.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #include 20 | 21 | namespace Common { 22 | 23 | StdInputStream::StdInputStream(std::istream &in) 24 | : in(in) 25 | { 26 | } 27 | 28 | size_t StdInputStream::readSome(void *data, size_t size) 29 | { 30 | in.read(static_cast(data), size); 31 | 32 | return in.gcount(); 33 | } 34 | 35 | } // namespace Common 36 | -------------------------------------------------------------------------------- /lib/Common/CommandLine.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #include "CommandLine.h" 20 | 21 | namespace command_line { 22 | 23 | const arg_descriptor arg_help = { "help", "Produce help message" }; 24 | const arg_descriptor arg_version = { "version", "Output version information" }; 25 | const arg_descriptor arg_data_dir = { "data-dir", "Specify data directory" }; 26 | 27 | } // namespace command_line 28 | -------------------------------------------------------------------------------- /lib/Logging/FileLogger.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #include 20 | 21 | namespace Logging { 22 | 23 | FileLogger::FileLogger(Level level) 24 | : StreamLogger(level) 25 | { 26 | } 27 | 28 | void FileLogger::init(const std::string &fileName) 29 | { 30 | m_fileStream.open(fileName, std::ios::app); 31 | StreamLogger::attachToStream(m_fileStream); 32 | } 33 | 34 | } // namespace Logging 35 | -------------------------------------------------------------------------------- /lib/Serialization/IStream.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | #include 23 | 24 | namespace CryptoNote { 25 | 26 | class IInputStream 27 | { 28 | public: 29 | virtual size_t read(char *data, size_t size) = 0; 30 | }; 31 | 32 | class IOutputStream 33 | { 34 | public: 35 | virtual void write(const char *data, size_t size) = 0; 36 | }; 37 | 38 | } // namespace CryptoNote 39 | -------------------------------------------------------------------------------- /lib/Platform/Android/System/ErrorMessage.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #include 20 | #include 21 | #include "ErrorMessage.h" 22 | 23 | namespace System { 24 | 25 | std::string lastErrorMessage() 26 | { 27 | return errorMessage(errno); 28 | } 29 | 30 | std::string errorMessage(int err) 31 | { 32 | return "result=" + std::to_string(err) + ", " + std::strerror(err); 33 | } 34 | 35 | } // namespace System 36 | -------------------------------------------------------------------------------- /lib/Platform/FreeBSD/System/ErrorMessage.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #include 20 | #include 21 | #include "ErrorMessage.h" 22 | 23 | namespace System { 24 | 25 | std::string lastErrorMessage() 26 | { 27 | return errorMessage(errno); 28 | } 29 | 30 | std::string errorMessage(int err) 31 | { 32 | return "result=" + std::to_string(err) + ", " + std::strerror(err); 33 | } 34 | 35 | } // namespace System 36 | -------------------------------------------------------------------------------- /lib/Platform/Linux/System/ErrorMessage.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #include 20 | #include 21 | #include "ErrorMessage.h" 22 | 23 | namespace System { 24 | 25 | std::string lastErrorMessage() 26 | { 27 | return errorMessage(errno); 28 | } 29 | 30 | std::string errorMessage(int err) 31 | { 32 | return "result=" + std::to_string(err) + ", " + std::strerror(err); 33 | } 34 | 35 | } // namespace System 36 | -------------------------------------------------------------------------------- /lib/Platform/OSX/System/ErrorMessage.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #include 20 | #include 21 | #include "ErrorMessage.h" 22 | 23 | namespace System { 24 | 25 | std::string lastErrorMessage() 26 | { 27 | return errorMessage(errno); 28 | } 29 | 30 | std::string errorMessage(int err) 31 | { 32 | return "result=" + std::to_string(err) + ", " + std::strerror(err); 33 | } 34 | 35 | } // namespace System 36 | -------------------------------------------------------------------------------- /lib/System/EventLock.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #include 20 | #include 21 | 22 | namespace System { 23 | 24 | EventLock::EventLock(Event &event) 25 | : m_event(event) 26 | { 27 | while (!m_event.get()) { 28 | m_event.wait(); 29 | } 30 | m_event.clear(); 31 | } 32 | 33 | EventLock::~EventLock() 34 | { 35 | m_event.set(); 36 | } 37 | 38 | } // namespace System 39 | -------------------------------------------------------------------------------- /lib/Logging/FileLogger.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | #include 23 | 24 | namespace Logging { 25 | 26 | class FileLogger : public StreamLogger 27 | { 28 | public: 29 | explicit FileLogger(Level level = DEBUGGING); 30 | 31 | void init(const std::string &filename); 32 | 33 | private: 34 | std::ofstream m_fileStream; 35 | }; 36 | 37 | } // namespace Logging 38 | -------------------------------------------------------------------------------- /tests/UnitTests/EventWaiter.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #include 20 | #include 21 | 22 | #pragma once 23 | 24 | class EventWaiter { 25 | private: 26 | std::mutex mtx; 27 | std::condition_variable cv; 28 | bool available; 29 | 30 | public: 31 | EventWaiter() : available(false) {} 32 | 33 | void notify(); 34 | void wait(); 35 | bool wait_for(const std::chrono::milliseconds& rel_time); 36 | }; 37 | -------------------------------------------------------------------------------- /lib/Common/StringOutputStream.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #include 20 | 21 | namespace Common { 22 | 23 | StringOutputStream::StringOutputStream(std::string &out) 24 | : out(out) 25 | { 26 | } 27 | 28 | size_t StringOutputStream::writeSome(const void *data, size_t size) 29 | { 30 | out.append(static_cast(data), size); 31 | 32 | return size; 33 | } 34 | 35 | } // namespace Common 36 | -------------------------------------------------------------------------------- /lib/Platform/Linux/System/Future.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | 23 | namespace System { 24 | 25 | namespace Detail { 26 | 27 | template using Future = std::future; 28 | 29 | template Future async(std::function &&operation) 30 | { 31 | return std::async(std::launch::async, std::move(operation)); 32 | } 33 | 34 | } // namespace Detail 35 | 36 | } // namespace System 37 | -------------------------------------------------------------------------------- /lib/CryptoNoteCore/IBlock.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | 23 | namespace CryptoNote { 24 | 25 | class IBlock 26 | { 27 | public: 28 | virtual ~IBlock() = default; 29 | 30 | virtual const Block &getBlock() const = 0; 31 | virtual size_t getTransactionCount() const = 0; 32 | virtual const Transaction &getTransaction(size_t index) const = 0; 33 | }; 34 | 35 | } // namespace CryptoNote 36 | -------------------------------------------------------------------------------- /lib/Platform/Android/System/Future.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | 23 | namespace System { 24 | 25 | namespace Detail { 26 | 27 | template using Future = std::future; 28 | 29 | template Future async(std::function &&operation) 30 | { 31 | return std::async(std::launch::async, std::move(operation)); 32 | } 33 | 34 | } // namespace Detail 35 | 36 | } // namespace System 37 | -------------------------------------------------------------------------------- /lib/Platform/Windows/System/Future.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | 23 | namespace System { 24 | 25 | namespace Detail { 26 | 27 | template using Future = std::future; 28 | 29 | template Future async(std::function &&operation) 30 | { 31 | return std::async(std::launch::async, std::move(operation)); 32 | } 33 | 34 | } // namespace Detail 35 | 36 | } // namespace System 37 | 38 | -------------------------------------------------------------------------------- /lib/Common/StringOutputStream.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | #include 23 | 24 | namespace Common { 25 | 26 | class StringOutputStream : public IOutputStream 27 | { 28 | public: 29 | explicit StringOutputStream(std::string &out); 30 | 31 | size_t writeSome(const void *data, size_t size) override; 32 | 33 | private: 34 | std::string &out; 35 | }; 36 | 37 | } // namespace Common 38 | -------------------------------------------------------------------------------- /lib/CryptoNoteCore/ITimeProvider.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | 23 | namespace CryptoNote { 24 | 25 | struct ITimeProvider 26 | { 27 | virtual ~ITimeProvider() = default; 28 | 29 | virtual time_t now() = 0; 30 | }; 31 | 32 | struct RealTimeProvider : public ITimeProvider 33 | { 34 | time_t now() override 35 | { 36 | return time(nullptr); 37 | } 38 | }; 39 | 40 | } // namespace CryptoNote 41 | -------------------------------------------------------------------------------- /lib/Logging/ConsoleLogger.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | #include 23 | 24 | namespace Logging { 25 | 26 | class ConsoleLogger : public CommonLogger 27 | { 28 | public: 29 | explicit ConsoleLogger(Level level = DEBUGGING); 30 | 31 | protected: 32 | void doLogString(const std::string &message) override; 33 | 34 | private: 35 | std::mutex mutex; 36 | }; 37 | 38 | } // namespace Logging 39 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011-2015 The Cryptonote developers 2 | Copyright (c) 2012-2016 Bytecoin developers 3 | Copyright (c) 2014-2015 XDN developers 4 | Copyright (c) 2016-2018 The Karbo developers 5 | Copyright (c) 2018-2020 The Qwertycoin Group. 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining 8 | a copy of this software and associated documentation files (the 9 | "Software"), to deal in the Software without restriction, including 10 | without limitation the rights to use, copy, modify, merge, publish, 11 | distribute, sublicense, and/or sell copies of the Software, and to 12 | permit persons to whom the Software is furnished to do so, subject to 13 | the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be 16 | included in all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 20 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 21 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 22 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 23 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 24 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 25 | -------------------------------------------------------------------------------- /lib/System/ContextGroupTimeout.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | #include 23 | #include 24 | 25 | namespace System { 26 | 27 | class ContextGroupTimeout 28 | { 29 | public: 30 | ContextGroupTimeout(Dispatcher &, ContextGroup &, std::chrono::nanoseconds); 31 | 32 | private: 33 | Timer m_timeoutTimer; 34 | ContextGroup m_workingContextGroup; 35 | }; 36 | 37 | } // namespace System 38 | -------------------------------------------------------------------------------- /lib/Common/ScopeExit.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #include 20 | 21 | namespace Tools { 22 | 23 | ScopeExit::ScopeExit(std::function &&handler) 24 | : m_handler(std::move(handler)), 25 | m_cancelled(false) 26 | { 27 | } 28 | 29 | ScopeExit::~ScopeExit() 30 | { 31 | if (!m_cancelled) { 32 | m_handler(); 33 | } 34 | } 35 | 36 | void ScopeExit::cancel() 37 | { 38 | m_cancelled = true; 39 | } 40 | 41 | } // namespace Tools 42 | -------------------------------------------------------------------------------- /lib/Common/StdOutputStream.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #include 20 | 21 | namespace Common { 22 | 23 | StdOutputStream::StdOutputStream(std::ostream &out) 24 | : out(out) 25 | { 26 | } 27 | 28 | size_t StdOutputStream::writeSome(const void *data, size_t size) 29 | { 30 | out.write(static_cast(data), size); 31 | if (out.bad()) { 32 | return 0; 33 | } 34 | 35 | return size; 36 | } 37 | 38 | } // namespace Common 39 | -------------------------------------------------------------------------------- /lib/Common/StringInputStream.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | #include 23 | 24 | namespace Common { 25 | 26 | class StringInputStream : public IInputStream 27 | { 28 | public: 29 | explicit StringInputStream(const std::string &in); 30 | 31 | size_t readSome(void *data, size_t size) override; 32 | 33 | private: 34 | const std::string ∈ 35 | size_t offset; 36 | }; 37 | 38 | } // namespace Common 39 | -------------------------------------------------------------------------------- /lib/Common/Util.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | #include 23 | 24 | namespace Tools { 25 | 26 | std::string getDefaultDataDirectory(); 27 | std::string get_os_version_string(); 28 | bool create_directories_if_necessary(const std::string &path); 29 | std::error_code replace_file(const std::string &replacement_name, const std::string &replaced_name); 30 | bool directoryExists(const std::string &path); 31 | 32 | } // namespace Tools 33 | -------------------------------------------------------------------------------- /lib/Common/Base58.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | #include 23 | 24 | namespace Tools { 25 | 26 | namespace Base58 { 27 | 28 | std::string encode(const std::string &data); 29 | bool decode(const std::string &enc, std::string &data); 30 | 31 | std::string encode_addr(uint64_t tag, const std::string &data); 32 | bool decode_addr(std::string addr, uint64_t &tag, std::string &data); 33 | 34 | } // namespace Base58 35 | 36 | } // namespace Tools 37 | -------------------------------------------------------------------------------- /lib/CryptoNoteProtocol/ICryptoNoteProtocolObserver.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | #include 23 | #include 24 | 25 | namespace CryptoNote { 26 | 27 | class ICryptoNoteProtocolObserver 28 | { 29 | public: 30 | virtual void peerCountUpdated(size_t count) {} 31 | virtual void lastKnownBlockHeightUpdated(uint32_t height) {} 32 | virtual void blockchainSynchronized(uint32_t topHeight) {} 33 | }; 34 | 35 | } // namespace CryptoNote 36 | -------------------------------------------------------------------------------- /lib/Wallet/WalletRpcServerErrorCodes.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #define WALLET_RPC_ERROR_CODE_UNKNOWN_ERROR -1 22 | #define WALLET_RPC_ERROR_CODE_WRONG_ADDRESS -2 23 | #define WALLET_RPC_ERROR_CODE_DAEMON_IS_BUSY -3 24 | #define WALLET_RPC_ERROR_CODE_GENERIC_TRANSFER_ERROR -4 25 | #define WALLET_RPC_ERROR_CODE_WRONG_PAYMENT_ID -5 26 | #define WALLET_RPC_ERROR_CODE_WRONG_MIXIN -6 27 | #define WALLET_RPC_ERROR_CODE_WRONG_FEE -7 28 | #define WALLET_RPC_ERROR_CODE_WRONG_SIGNATURE -9 29 | -------------------------------------------------------------------------------- /lib/Common/StdInputStream.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | #include 23 | 24 | namespace Common { 25 | 26 | class StdInputStream : public IInputStream 27 | { 28 | public: 29 | explicit StdInputStream(std::istream &in); 30 | 31 | size_t readSome(void *data, size_t size) override; 32 | 33 | StdInputStream &operator=(const StdInputStream &) = delete; 34 | 35 | private: 36 | std::istream ∈ 37 | }; 38 | 39 | } // namespace Common 40 | -------------------------------------------------------------------------------- /lib/Platform/Android/System/Context.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #ifdef __cplusplus 22 | extern "C" { 23 | #endif 24 | 25 | #include 26 | #include 27 | 28 | int getcontext(ucontext_t *) { return 0; } 29 | void makecontext(ucontext_t *, void (*)(), int, ...) {} 30 | int setcontext(const ucontext_t *) { return 0; } 31 | int swapcontext(ucontext_t * __restrict, const ucontext_t * __restrict) { return 0; } 32 | 33 | #ifdef __cplusplus 34 | } // extern "C" 35 | #endif 36 | -------------------------------------------------------------------------------- /lib/Common/StdOutputStream.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | #include 23 | 24 | namespace Common { 25 | 26 | class StdOutputStream : public IOutputStream 27 | { 28 | public: 29 | explicit StdOutputStream(std::ostream &out); 30 | 31 | size_t writeSome(const void *data, size_t size) override; 32 | 33 | StdOutputStream &operator=(const StdOutputStream &) = delete; 34 | 35 | private: 36 | std::ostream &out; 37 | }; 38 | 39 | } // namespace Common 40 | -------------------------------------------------------------------------------- /lib/Rpc/CoreRpcServerErrorCodes.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #define CORE_RPC_ERROR_CODE_WRONG_PARAM -1 22 | #define CORE_RPC_ERROR_CODE_TOO_BIG_HEIGHT -2 23 | #define CORE_RPC_ERROR_CODE_TOO_BIG_RESERVE_SIZE -3 24 | #define CORE_RPC_ERROR_CODE_WRONG_WALLET_ADDRESS -4 25 | #define CORE_RPC_ERROR_CODE_INTERNAL_ERROR -5 26 | #define CORE_RPC_ERROR_CODE_WRONG_BLOCKBLOB -6 27 | #define CORE_RPC_ERROR_CODE_BLOCK_NOT_ACCEPTED -7 28 | #define CORE_RPC_ERROR_CODE_CORE_BUSY -9 29 | -------------------------------------------------------------------------------- /lib/crypto/blake256.h: -------------------------------------------------------------------------------- 1 | #ifndef _BLAKE256_H_ 2 | #define _BLAKE256_H_ 3 | 4 | #include 5 | 6 | typedef struct { 7 | uint32_t h[8], s[4], t[2]; 8 | int buflen, nullt; 9 | uint8_t buf[64]; 10 | } state; 11 | 12 | typedef struct { 13 | state inner; 14 | state outer; 15 | } hmac_state; 16 | 17 | void blake256_init(state *); 18 | void blake224_init(state *); 19 | 20 | void blake256_update(state *, const uint8_t *, uint64_t); 21 | void blake224_update(state *, const uint8_t *, uint64_t); 22 | 23 | void blake256_final(state *, uint8_t *); 24 | void blake224_final(state *, uint8_t *); 25 | 26 | void blake256_hash(uint8_t *, const uint8_t *, uint64_t); 27 | void blake224_hash(uint8_t *, const uint8_t *, uint64_t); 28 | 29 | /* HMAC functions: */ 30 | 31 | void hmac_blake256_init(hmac_state *, const uint8_t *, uint64_t); 32 | void hmac_blake224_init(hmac_state *, const uint8_t *, uint64_t); 33 | 34 | void hmac_blake256_update(hmac_state *, const uint8_t *, uint64_t); 35 | void hmac_blake224_update(hmac_state *, const uint8_t *, uint64_t); 36 | 37 | void hmac_blake256_final(hmac_state *, uint8_t *); 38 | void hmac_blake224_final(hmac_state *, uint8_t *); 39 | 40 | void hmac_blake256_hash(uint8_t *, const uint8_t *, uint64_t, const uint8_t *, uint64_t); 41 | void hmac_blake224_hash(uint8_t *, const uint8_t *, uint64_t, const uint8_t *, uint64_t); 42 | 43 | #endif /* _BLAKE256_H_ */ 44 | -------------------------------------------------------------------------------- /lib/Common/VectorOutputStream.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #include 20 | 21 | namespace Common { 22 | 23 | VectorOutputStream::VectorOutputStream(std::vector &out) 24 | : out(out) 25 | { 26 | } 27 | 28 | size_t VectorOutputStream::writeSome(const void *data, size_t size) 29 | { 30 | out.insert(out.end(), 31 | static_cast(data), 32 | static_cast(data) + size); 33 | 34 | return size; 35 | } 36 | 37 | } // namespace Common 38 | -------------------------------------------------------------------------------- /lib/CryptoNoteCore/CoreConfig.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | #include 23 | 24 | namespace CryptoNote { 25 | 26 | class CoreConfig 27 | { 28 | public: 29 | CoreConfig(); 30 | 31 | static void initOptions(boost::program_options::options_description &desc); 32 | void init(const boost::program_options::variables_map &options); 33 | 34 | std::string configFolder; 35 | bool configFolderDefaulted = true; 36 | }; 37 | 38 | } // namespace CryptoNote 39 | -------------------------------------------------------------------------------- /lib/PaymentGate/NodeFactory.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | #include 23 | 24 | namespace PaymentService { 25 | 26 | class NodeFactory 27 | { 28 | public: 29 | static CryptoNote::INode *createNode(const std::string &daemonAddress, uint16_t daemonPort); 30 | static CryptoNote::INode *createNodeStub(); 31 | 32 | private: 33 | NodeFactory() = default; 34 | ~NodeFactory() = default; 35 | 36 | static NodeFactory factory; 37 | }; 38 | 39 | } // namespace PaymentService 40 | -------------------------------------------------------------------------------- /lib/Rpc/RpcServerConfig.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | 23 | namespace CryptoNote { 24 | 25 | class RpcServerConfig 26 | { 27 | public: 28 | RpcServerConfig(); 29 | 30 | void init(const boost::program_options::variables_map &options); 31 | static void initOptions(boost::program_options::options_description &desc); 32 | std::string getBindAddress() const; 33 | 34 | std::string bindIp; 35 | uint16_t bindPort; 36 | }; 37 | 38 | } // namespace CryptoNote 39 | -------------------------------------------------------------------------------- /lib/Serialization/JsonInputStreamSerializer.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | 27 | namespace CryptoNote { 28 | 29 | class JsonInputStreamSerializer : public JsonInputValueSerializer 30 | { 31 | public: 32 | explicit JsonInputStreamSerializer(std::istream &stream); 33 | ~JsonInputStreamSerializer() override = default; 34 | }; 35 | 36 | } // namespace CryptoNote 37 | -------------------------------------------------------------------------------- /cmake/project/GlobalVariables.cmake: -------------------------------------------------------------------------------- 1 | # Detect OS targeted by the build 2 | message(STATUS "CMAKE_HOST_SYSTEM_NAME: ${CMAKE_HOST_SYSTEM_NAME}") # system hosting the build 3 | message(STATUS "CMAKE_SYSTEM_NAME: ${CMAKE_SYSTEM_NAME}") # system targeted by the build 4 | message(STATUS "CMAKE_SYSTEM_VERSION: ${CMAKE_SYSTEM_VERSION}") 5 | if(UNIX) 6 | if(${CMAKE_SYSTEM_NAME} MATCHES "Android") 7 | set(PROJECT_OS_NAME "android") 8 | set(PROJECT_OS_ANDROID ON) 9 | set(ANDROID TRUE) 10 | elseif(${CMAKE_SYSTEM_NAME} MATCHES "kFreeBSD.*|FreeBSD") 11 | set(PROJECT_OS_NAME "freebsd") 12 | set(PROJECT_OS_FREEBSD ON) 13 | set(FREEBSD TRUE) 14 | elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux") 15 | set(PROJECT_OS_NAME "linux") 16 | set(PROJECT_OS_LINUX ON) 17 | elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") 18 | set(PROJECT_OS_NAME "macos") 19 | set(PROJECT_OS_MACOS ON) 20 | else() 21 | set(PROJECT_OS_NAME "posix") 22 | set(PROJECT_OS_POSIX ON) 23 | endif() 24 | elseif(WIN32) 25 | set(PROJECT_OS_NAME "windows") 26 | set(PROJECT_OS_WINDOWS ON) 27 | else() 28 | set(PROJECT_OS_NAME "unknown") 29 | set(PROJECT_OS_UNKNOWN ON) 30 | endif() 31 | if (PROJECT_OS_UNKNOWN) 32 | message(WARNING "Unable to detect OS!") 33 | else() 34 | message(STATUS "Detect OS targeted by the build: ${PROJECT_OS_NAME}") 35 | endif() 36 | -------------------------------------------------------------------------------- /src/PaymentGateService/RpcNodeConfiguration.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | #include 23 | 24 | namespace PaymentService { 25 | 26 | class RpcNodeConfiguration 27 | { 28 | public: 29 | RpcNodeConfiguration(); 30 | 31 | static void initOptions(boost::program_options::options_description &desc); 32 | void init(const boost::program_options::variables_map &options); 33 | 34 | std::string daemonHost; 35 | uint16_t daemonPort; 36 | }; 37 | 38 | } // namespace PaymentService 39 | -------------------------------------------------------------------------------- /lib/Common/MemoryInputStream.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | 23 | namespace Common { 24 | 25 | class MemoryInputStream : public IInputStream 26 | { 27 | public: 28 | MemoryInputStream(const void *buffer, size_t bufferSize); 29 | 30 | size_t getPosition() const; 31 | 32 | bool endOfStream() const; 33 | 34 | size_t readSome(void* data, size_t size) override; 35 | 36 | private: 37 | const char *buffer; 38 | size_t bufferSize; 39 | size_t position; 40 | }; 41 | 42 | } // namespace Common 43 | -------------------------------------------------------------------------------- /lib/Common/VectorOutputStream.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | #include 23 | #include 24 | 25 | namespace Common { 26 | 27 | class VectorOutputStream : public IOutputStream 28 | { 29 | public: 30 | explicit VectorOutputStream(std::vector &out); 31 | 32 | size_t writeSome(const void *data, size_t size) override; 33 | 34 | VectorOutputStream &operator=(const VectorOutputStream &) = delete; 35 | 36 | private: 37 | std::vector &out; 38 | }; 39 | 40 | } // namespace Common 41 | -------------------------------------------------------------------------------- /lib/CryptoNoteCore/MinerConfig.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | #include 23 | #include 24 | 25 | namespace CryptoNote { 26 | 27 | class MinerConfig 28 | { 29 | public: 30 | MinerConfig(); 31 | 32 | static void initOptions(boost::program_options::options_description &desc); 33 | void init(const boost::program_options::variables_map &options); 34 | 35 | std::string extraMessages; 36 | std::string startMining; 37 | uint32_t miningThreads; 38 | }; 39 | 40 | } // namespace CryptoNote 41 | -------------------------------------------------------------------------------- /tests/PerformanceTests/GenerateKeyDerivation.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include "crypto/crypto.h" 22 | #include "CryptoNoteCore/CryptoNoteBasic.h" 23 | 24 | #include "SingleTransactionTestBase.h" 25 | 26 | class test_generate_key_derivation : public single_tx_test_base 27 | { 28 | public: 29 | static const size_t loop_count = 1000; 30 | 31 | bool test() 32 | { 33 | Crypto::KeyDerivation recv_derivation; 34 | Crypto::generate_key_derivation(m_tx_pub_key, m_bob.getAccountKeys().viewSecretKey, recv_derivation); 35 | return true; 36 | } 37 | }; 38 | -------------------------------------------------------------------------------- /lib/Common/StringInputStream.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #include 20 | #include 21 | 22 | namespace Common { 23 | 24 | StringInputStream::StringInputStream(const std::string &in) 25 | : in(in), 26 | offset(0) 27 | { 28 | } 29 | 30 | size_t StringInputStream::readSome(void *data, size_t size) 31 | { 32 | if (size > in.size() - offset) { 33 | size = in.size() - offset; 34 | } 35 | 36 | memcpy(data, in.data() + offset, size); 37 | 38 | offset += size; 39 | 40 | return size; 41 | } 42 | 43 | } // namespace Common 44 | -------------------------------------------------------------------------------- /tests/PerformanceTests/IsOutToAccount.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include "CryptoNoteCore/CryptoNoteBasic.h" 22 | #include "CryptoNoteCore/CryptoNoteFormatUtils.h" 23 | 24 | #include "SingleTransactionTestBase.h" 25 | 26 | class test_is_out_to_acc : public single_tx_test_base 27 | { 28 | public: 29 | static const size_t loop_count = 1000; 30 | 31 | bool test() 32 | { 33 | const CryptoNote::KeyOutput& tx_out = boost::get(m_tx.outputs[0].target); 34 | return CryptoNote::is_out_to_acc(m_bob.getAccountKeys(), tx_out, m_tx_pub_key, 0); 35 | } 36 | }; 37 | -------------------------------------------------------------------------------- /lib/Common/ScopeExit.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | 23 | namespace Tools { 24 | 25 | class ScopeExit 26 | { 27 | public: 28 | explicit ScopeExit(std::function &&handler); 29 | ScopeExit(const ScopeExit &) = delete; 30 | ScopeExit(ScopeExit &&) = delete; 31 | ~ScopeExit(); 32 | 33 | ScopeExit &operator=(const ScopeExit &) = delete; 34 | ScopeExit &operator=(ScopeExit &&) = delete; 35 | 36 | void cancel(); 37 | 38 | private: 39 | std::function m_handler; 40 | bool m_cancelled; 41 | }; 42 | 43 | } // namespace Tools 44 | -------------------------------------------------------------------------------- /lib/WalletLegacy/KeysStorage.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | #include 23 | 24 | namespace CryptoNote { 25 | 26 | class ISerializer; 27 | 28 | // This is DTO structure. Do not change it. 29 | struct KeysStorage { 30 | void serialize(ISerializer &serializer, const std::string &name); 31 | 32 | uint64_t creationTimestamp; 33 | 34 | Crypto::PublicKey spendPublicKey; 35 | Crypto::SecretKey spendSecretKey; 36 | 37 | Crypto::PublicKey viewPublicKey; 38 | Crypto::SecretKey viewSecretKey; 39 | }; 40 | 41 | } // namespace CryptoNote 42 | -------------------------------------------------------------------------------- /lib/crypto/hash.c: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #include 20 | #include 21 | #include 22 | 23 | #include "hash-ops.h" 24 | #include "keccak.h" 25 | 26 | void hash_permutation(union hash_state *state) { 27 | keccakf((uint64_t*)state, 24); 28 | } 29 | 30 | void hash_process(union hash_state *state, const uint8_t *buf, size_t count) { 31 | keccak1600(buf, (int)count, (uint8_t*)state); 32 | } 33 | 34 | void cn_fast_hash(const void *data, size_t length, char *hash) { 35 | union hash_state state; 36 | hash_process(&state, data, length); 37 | memcpy(hash, &state, HASH_SIZE); 38 | } 39 | -------------------------------------------------------------------------------- /tests/PerformanceTests/GenerateKeyImageHelper.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include "CryptoNoteCore/CryptoNoteBasic.h" 22 | #include "CryptoNoteCore/CryptoNoteFormatUtils.h" 23 | 24 | #include "SingleTransactionTestBase.h" 25 | 26 | class test_generate_key_image_helper : public single_tx_test_base 27 | { 28 | public: 29 | static const size_t loop_count = 500; 30 | 31 | bool test() 32 | { 33 | CryptoNote::KeyPair in_ephemeral; 34 | Crypto::KeyImage ki; 35 | return CryptoNote::generate_key_image_helper(m_bob.getAccountKeys(), m_tx_pub_key, 0, in_ephemeral, ki); 36 | } 37 | }; 38 | -------------------------------------------------------------------------------- /lib/Platform/Windows/System/Timer.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | 23 | namespace System { 24 | 25 | class Dispatcher; 26 | 27 | class Timer 28 | { 29 | public: 30 | Timer(); 31 | explicit Timer(Dispatcher &dispatcher); 32 | Timer(const Timer &) = delete; 33 | Timer(Timer &&other); 34 | ~Timer(); 35 | 36 | void sleep(std::chrono::nanoseconds duration); 37 | 38 | Timer &operator=(const Timer &) = delete; 39 | Timer &operator=(Timer &&other); 40 | 41 | private: 42 | Dispatcher *dispatcher; 43 | void *context; 44 | }; 45 | 46 | } // namespace System 47 | -------------------------------------------------------------------------------- /lib/CryptoNoteProtocol/ICryptoNoteProtocolQuery.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | #include 23 | 24 | namespace CryptoNote { 25 | 26 | class ICryptoNoteProtocolObserver; 27 | 28 | class ICryptoNoteProtocolQuery 29 | { 30 | public: 31 | virtual bool addObserver(ICryptoNoteProtocolObserver *observer) = 0; 32 | virtual bool removeObserver(ICryptoNoteProtocolObserver *observer) = 0; 33 | 34 | virtual uint32_t getObservedHeight() const = 0; 35 | virtual size_t getPeerCount() const = 0; 36 | virtual bool isSynchronized() const = 0; 37 | }; 38 | 39 | } // namespace CryptoNote 40 | -------------------------------------------------------------------------------- /lib/Serialization/KVBinaryInputStreamSerializer.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | #include 23 | #include 24 | 25 | namespace CryptoNote { 26 | 27 | class KVBinaryInputStreamSerializer : public JsonInputValueSerializer 28 | { 29 | public: 30 | explicit KVBinaryInputStreamSerializer(Common::IInputStream &strm); 31 | 32 | bool binary(void *value, size_t size, Common::StringView name) override; 33 | bool binary(std::string &value, Common::StringView name) override; 34 | }; 35 | 36 | } // namespace CryptoNote 37 | -------------------------------------------------------------------------------- /lib/Transfers/IObservableImpl.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | 23 | namespace CryptoNote { 24 | 25 | template 26 | class IObservableImpl : public Base 27 | { 28 | public: 29 | void addObserver(Observer *observer) override 30 | { 31 | m_observerManager.add(observer); 32 | } 33 | 34 | void removeObserver(Observer *observer) override 35 | { 36 | m_observerManager.remove(observer); 37 | } 38 | 39 | protected: 40 | Tools::ObserverManager m_observerManager; 41 | }; 42 | 43 | } // namespace CryptoNote 44 | -------------------------------------------------------------------------------- /src/Miner/MiningConfig.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | #include 23 | 24 | namespace CryptoNote { 25 | 26 | struct MiningConfig 27 | { 28 | MiningConfig(); 29 | 30 | void parse(int argc, char **argv); 31 | void printHelp(); 32 | 33 | std::string miningAddress; 34 | std::string daemonHost; 35 | uint16_t daemonPort; 36 | size_t threadCount; 37 | size_t scanPeriod; 38 | uint8_t logLevel; 39 | size_t blocksLimit; 40 | uint64_t firstBlockTimestamp; 41 | int64_t blockTimestampInterval; 42 | bool help; 43 | }; 44 | 45 | } // namespace CryptoNote 46 | -------------------------------------------------------------------------------- /lib/Platform/Linux/System/Timer.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | 23 | namespace System { 24 | 25 | class Dispatcher; 26 | 27 | class Timer 28 | { 29 | public: 30 | Timer(); 31 | explicit Timer(Dispatcher &dispatcher); 32 | Timer(const Timer &) = delete; 33 | Timer(Timer &&other); 34 | ~Timer(); 35 | 36 | void sleep(std::chrono::nanoseconds duration); 37 | 38 | Timer &operator=(const Timer &) = delete; 39 | Timer &operator=(Timer &&other); 40 | 41 | private: 42 | Dispatcher *dispatcher; 43 | void *context; 44 | int timer; 45 | }; 46 | 47 | } // namespace System 48 | -------------------------------------------------------------------------------- /lib/Serialization/JsonInputStreamSerializer.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #include 20 | #include 21 | #include 22 | 23 | namespace CryptoNote { 24 | 25 | namespace { 26 | 27 | Common::JsonValue getJsonValueFromStreamHelper(std::istream &stream) 28 | { 29 | Common::JsonValue value; 30 | 31 | stream >> value; 32 | 33 | return value; 34 | } 35 | 36 | } // namespace 37 | 38 | JsonInputStreamSerializer::JsonInputStreamSerializer(std::istream &stream) 39 | : JsonInputValueSerializer(getJsonValueFromStreamHelper(stream)) 40 | { 41 | } 42 | 43 | } // namespace CryptoNote 44 | -------------------------------------------------------------------------------- /lib/WalletLegacy/WalletLegacySerialization.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | #include 23 | #include 24 | #include 25 | 26 | namespace CryptoNote { 27 | 28 | class ISerializer; 29 | 30 | struct UnconfirmedTransferDetails; 31 | struct WalletLegacyTransaction; 32 | struct WalletLegacyTransfer; 33 | 34 | void serialize(UnconfirmedTransferDetails &utd, ISerializer &serializer); 35 | void serialize(WalletLegacyTransaction &txi, ISerializer &serializer); 36 | void serialize(WalletLegacyTransfer &tr, ISerializer &serializer); 37 | 38 | } // namespace CryptoNote 39 | -------------------------------------------------------------------------------- /tests/CryptoTests/crypto-tests.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #if defined(__cplusplus) 22 | #include "crypto/crypto.h" 23 | 24 | extern "C" { 25 | #endif 26 | 27 | void setup_random(void); 28 | 29 | #if defined(__cplusplus) 30 | } 31 | 32 | bool check_scalar(const Crypto::EllipticCurveScalar &scalar); 33 | void random_scalar(Crypto::EllipticCurveScalar &res); 34 | void hash_to_scalar(const void *data, size_t length, Crypto::EllipticCurveScalar &res); 35 | void hash_to_point(const Crypto::Hash &h, Crypto::EllipticCurvePoint &res); 36 | void hash_to_ec(const Crypto::PublicKey &key, Crypto::EllipticCurvePoint &res); 37 | #endif 38 | -------------------------------------------------------------------------------- /tests/UnitTests/EventWaiter.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #include "EventWaiter.h" 20 | 21 | void EventWaiter::notify() { 22 | std::unique_lock lck(mtx); 23 | available = true; 24 | cv.notify_all(); 25 | } 26 | 27 | void EventWaiter::wait() { 28 | std::unique_lock lck(mtx); 29 | cv.wait(lck, [this]() { return available; }); 30 | available = false; 31 | } 32 | 33 | bool EventWaiter::wait_for(const std::chrono::milliseconds& rel_time) { 34 | std::unique_lock lck(mtx); 35 | auto result = cv.wait_for(lck, rel_time, [this]() { return available; }); 36 | available = false; 37 | return result; 38 | } 39 | -------------------------------------------------------------------------------- /lib/Logging/StreamLogger.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | #include 23 | 24 | namespace Logging { 25 | 26 | class StreamLogger : public CommonLogger 27 | { 28 | public: 29 | explicit StreamLogger(Level level = DEBUGGING); 30 | explicit StreamLogger(std::ostream &stream, Level level = DEBUGGING); 31 | 32 | void attachToStream(std::ostream& stream); 33 | 34 | protected: 35 | void doLogString(const std::string &message) override; 36 | 37 | protected: 38 | std::ostream *m_stream; 39 | 40 | private: 41 | std::mutex m_mutex; 42 | }; 43 | 44 | } // namespace Logging 45 | -------------------------------------------------------------------------------- /lib/Platform/Android/System/Timer.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | 23 | namespace System { 24 | 25 | class Dispatcher; 26 | 27 | class Timer 28 | { 29 | public: 30 | Timer(); 31 | explicit Timer(Dispatcher &dispatcher); 32 | Timer(const Timer &) = delete; 33 | Timer(Timer &&other); 34 | ~Timer(); 35 | 36 | void sleep(std::chrono::nanoseconds duration); 37 | 38 | Timer &operator=(const Timer &) = delete; 39 | Timer &operator=(Timer &&other); 40 | 41 | private: 42 | Dispatcher *dispatcher; 43 | void *context; 44 | int timer; 45 | }; 46 | 47 | } // namespace System 48 | -------------------------------------------------------------------------------- /lib/System/Ipv4Address.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | #include 23 | 24 | namespace System { 25 | 26 | class Ipv4Address 27 | { 28 | public: 29 | explicit Ipv4Address(uint32_t value); 30 | explicit Ipv4Address(const std::string &dottedDecimal); 31 | 32 | uint32_t getValue() const; 33 | bool isLoopback() const; 34 | bool isPrivate() const; 35 | std::string toDottedDecimal() const; 36 | 37 | bool operator!=(const Ipv4Address &other) const; 38 | bool operator==(const Ipv4Address &other) const; 39 | 40 | private: 41 | uint32_t value; 42 | }; 43 | 44 | } // namespace System 45 | -------------------------------------------------------------------------------- /lib/Platform/OSX/System/Timer.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | 23 | namespace System { 24 | 25 | class Dispatcher; 26 | 27 | class Timer 28 | { 29 | public: 30 | Timer(); 31 | explicit Timer(Dispatcher &dispatcher); 32 | Timer(const Timer &) = delete; 33 | Timer(Timer &&other) noexcept; 34 | ~Timer(); 35 | 36 | void sleep(std::chrono::nanoseconds duration); 37 | 38 | Timer &operator=(const Timer &) = delete; 39 | Timer &operator=(Timer &&other) noexcept; 40 | 41 | private: 42 | Dispatcher *dispatcher; 43 | int timer; 44 | void *context; 45 | }; 46 | 47 | } // namespace System 48 | -------------------------------------------------------------------------------- /lib/Platform/FreeBSD/System/Timer.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | 23 | namespace System { 24 | 25 | class Dispatcher; 26 | 27 | class Timer 28 | { 29 | public: 30 | Timer(); 31 | explicit Timer(Dispatcher &dispatcher); 32 | Timer(const Timer &) = delete; 33 | Timer(Timer &&other) noexcept; 34 | ~Timer(); 35 | 36 | void sleep(std::chrono::nanoseconds duration); 37 | 38 | Timer &operator=(const Timer &) = delete; 39 | Timer &operator=(Timer &&other) noexcept; 40 | 41 | private: 42 | Dispatcher *dispatcher; 43 | int timer; 44 | void *context; 45 | }; 46 | 47 | } // namespace System 48 | -------------------------------------------------------------------------------- /lib/Common/ConsoleTools.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | 23 | namespace Common { 24 | 25 | namespace Console { 26 | 27 | enum class Color : uint8_t 28 | { 29 | // default 30 | Default, 31 | // main 32 | Blue, 33 | Green, 34 | Red, 35 | Yellow, 36 | White, 37 | Cyan, 38 | Magenta, 39 | // bright 40 | BrightBlue, 41 | BrightGreen, 42 | BrightRed, 43 | BrightYellow, 44 | BrightWhite, 45 | BrightCyan, 46 | BrightMagenta 47 | }; 48 | 49 | void setTextColor(Color color); 50 | 51 | bool isConsoleTty(); 52 | 53 | } // namespace Console 54 | 55 | } // namespace Common 56 | -------------------------------------------------------------------------------- /lib/System/Event.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | namespace System { 22 | 23 | class Dispatcher; 24 | 25 | class Event 26 | { 27 | public: 28 | Event(); 29 | explicit Event(Dispatcher &dispatcher); 30 | Event(const Event &) = delete; 31 | Event(Event &&other) noexcept; 32 | ~Event(); 33 | 34 | bool get() const; 35 | void clear(); 36 | void set(); 37 | void wait(); 38 | 39 | Event &operator=(const Event &) = delete; 40 | Event &operator=(Event &&other) noexcept; 41 | 42 | private: 43 | Dispatcher *dispatcher; 44 | bool state; 45 | void *first; 46 | void *last; 47 | }; 48 | 49 | } // namespace System 50 | -------------------------------------------------------------------------------- /cmake/external/Boost.cmake: -------------------------------------------------------------------------------- 1 | # Boost 2 | 3 | set(Boost_COMPONENTS chrono date_time filesystem program_options serialization) 4 | 5 | if(MSVC) 6 | add_definitions(-DBOOST_ALL_NO_LIB) 7 | add_definitions(-DBOOST_CONFIG_SUPPRESS_OUTDATED_MESSAGE) 8 | endif() 9 | 10 | # If Boost_DIR is not set, look for BOOST_ROOT and BOOSTROOT as alternatives, 11 | # since these are more conventional for Boost. 12 | if("$ENV{Boost_DIR}" STREQUAL "") 13 | if(EXISTS "$ENV{BOOST_ROOT}" AND IS_DIRECTORY "$ENV{BOOST_ROOT}") 14 | set(ENV{Boost_DIR} $ENV{BOOST_ROOT}) 15 | elseif(EXISTS "$ENV{BOOSTROOT}" AND IS_DIRECTORY "$ENV{BOOSTROOT}") 16 | set(ENV{Boost_DIR} $ENV{BOOSTROOT}) 17 | endif() 18 | # NOTE: Don't forget to set BOOST_LIBRARYDIR if you are using Visual Studio! 19 | endif() 20 | 21 | if(EXISTS "$ENV{Boost_DIR}" AND IS_DIRECTORY "$ENV{Boost_DIR}") 22 | message(STATUS "Boost_DIR is set. Using precompiled Boost.") 23 | message(STATUS "Boost path: $ENV{Boost_DIR}") 24 | set(Boost_USE_STATIC_LIBS ON) 25 | set(Boost_USE_STATIC_RUNTIME OFF) 26 | set(Boost_USE_MULTITHREADED ON) 27 | set(Boost_NO_SYSTEM_PATHS ON) 28 | find_package(Boost REQUIRED COMPONENTS ${Boost_COMPONENTS}) 29 | else() 30 | message(STATUS "Boost_DIR is not set. Using Hunter (package manager) to install Boost.") 31 | set(Boost_USE_STATIC_LIBS ON) 32 | set(Boost_USE_MULTITHREADED ON) 33 | hunter_add_package(Boost COMPONENTS ${Boost_COMPONENTS}) 34 | find_package(Boost QUIET REQUIRED COMPONENTS ${Boost_COMPONENTS}) 35 | endif() 36 | -------------------------------------------------------------------------------- /lib/CryptoNoteCore/CryptoNoteStatInfo.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | 23 | namespace CryptoNote { 24 | 25 | struct core_stat_info 26 | { 27 | void serialize(ISerializer &s) 28 | { 29 | KV_MEMBER(tx_pool_size) 30 | KV_MEMBER(blockchain_height) 31 | KV_MEMBER(mining_speed) 32 | KV_MEMBER(alternative_blocks) 33 | KV_MEMBER(top_block_id_str) 34 | } 35 | 36 | uint64_t tx_pool_size; 37 | uint64_t blockchain_height; 38 | uint64_t mining_speed; 39 | uint64_t alternative_blocks; 40 | std::string top_block_id_str; 41 | }; 42 | 43 | } // namespace CryptoNote 44 | -------------------------------------------------------------------------------- /lib/Transfers/CommonTypes.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | 28 | namespace CryptoNote { 29 | 30 | struct BlockchainInterval 31 | { 32 | uint32_t startHeight; 33 | std::vector blocks; 34 | }; 35 | 36 | struct CompleteBlock 37 | { 38 | Crypto::Hash blockHash; 39 | boost::optional block; 40 | // first transaction is always coinbase 41 | std::list> transactions; 42 | }; 43 | 44 | } // namespace CryptoNote 45 | -------------------------------------------------------------------------------- /.appveyor.yml: -------------------------------------------------------------------------------- 1 | os: Visual Studio 2019 2 | 3 | clone_depth: 100 4 | 5 | cache: 6 | - C:\.hunter -> .appveyor.yml 7 | 8 | environment: 9 | global: 10 | BOOST_ROOT: "C:/Libraries/boost_1_70_0" 11 | BOOST_LIBRARYDIR: "C:/Libraries/boost_1_70_0/lib64-msvc-14.1" 12 | matrix: 13 | - Purpose: "WindowsReleaseBuild" 14 | QWC_GENERATOR_NAME: "Visual Studio 16 2019" 15 | QWC_BUILD_TYPE: "Release" 16 | QWC_TOOLCHAIN_FILE_NAME: "cmake/polly/vs-16-2019-win64.cmake" 17 | QWC_TESTS_REGEXP: "NONE" 18 | 19 | install: 20 | - git submodule update --init --recursive 21 | 22 | build_script: 23 | - md build 24 | - cd build 25 | - > 26 | cmake -G "%QWC_GENERATOR_NAME%" 27 | -DCMAKE_SYSTEM_VERSION="10.0.18362.0" 28 | -DCMAKE_BUILD_TYPE=%QWC_BUILD_TYPE% 29 | -DCMAKE_TOOLCHAIN_FILE=%QWC_TOOLCHAIN_FILE_NAME% 30 | -DBUILD_ALL:BOOL=TRUE 31 | .. 32 | - cmake --build . --config %QWC_BUILD_TYPE% 33 | - ctest -C %QWC_BUILD_TYPE% -R "%QWC_TESTS_REGEXP%" -V -j 2 34 | - cpack -C %QWC_BUILD_TYPE% 35 | 36 | artifacts: 37 | - path: build\*\qwertycoin-*.exe 38 | name: Releases 39 | 40 | deploy: 41 | description: "Qwertycoin CLI release" 42 | provider: GitHub 43 | auth_token: 44 | secure: "2+Ji3AkIi/6n3bNzeQNvr7ZKetnvNC/K5czk1iDU5OQHiozVan1ksMw3Nk1GTssO" 45 | artifact: /qwertycoin-.*\.exe/ 46 | draft: true 47 | prerelease: true 48 | on: 49 | APPVEYOR_REPO_TAG: true 50 | QWC_BUILD_TYPE: "Release" -------------------------------------------------------------------------------- /lib/CryptoNoteProtocol/CryptoNoteProtocolHandlerCommon.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | namespace CryptoNote { 22 | 23 | struct NOTIFY_NEW_BLOCK_request; 24 | struct NOTIFY_NEW_TRANSACTIONS_request; 25 | 26 | struct i_cryptonote_protocol 27 | { 28 | virtual void relay_block(NOTIFY_NEW_BLOCK_request &arg) = 0; 29 | virtual void relay_transactions(NOTIFY_NEW_TRANSACTIONS_request &arg) = 0; 30 | }; 31 | 32 | struct cryptonote_protocol_stub : public i_cryptonote_protocol 33 | { 34 | void relay_block(NOTIFY_NEW_BLOCK_request &arg) override {} 35 | void relay_transactions(NOTIFY_NEW_TRANSACTIONS_request &arg) override {} 36 | }; 37 | 38 | } // namespace CryptoNote 39 | -------------------------------------------------------------------------------- /src/PaymentGateService/ConfigurationManager.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | #include 23 | #include "PaymentServiceConfiguration.h" 24 | #include "RpcNodeConfiguration.h" 25 | 26 | namespace PaymentService { 27 | 28 | class ConfigurationManager 29 | { 30 | public: 31 | ConfigurationManager(); 32 | 33 | bool init(int argc, char **argv); 34 | 35 | bool startInprocess; 36 | Configuration gateConfiguration; 37 | CryptoNote::NetNodeConfig netNodeConfig; 38 | CryptoNote::CoreConfig coreConfig; 39 | RpcNodeConfiguration remoteNodeConfig; 40 | }; 41 | 42 | } // namespace PaymentService 43 | -------------------------------------------------------------------------------- /lib/Wallet/WalletAsyncContextCounter.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | #include 23 | #include 24 | 25 | namespace CryptoNote { 26 | 27 | class WalletAsyncContextCounter 28 | { 29 | public: 30 | WalletAsyncContextCounter() 31 | : m_asyncContexts(0) 32 | { 33 | } 34 | 35 | void addAsyncContext(); 36 | void delAsyncContext(); 37 | 38 | // returns true if contexts are finished before timeout 39 | void waitAsyncContextsFinish(); 40 | 41 | private: 42 | uint32_t m_asyncContexts; 43 | std::condition_variable m_cv; 44 | std::mutex m_mutex; 45 | }; 46 | 47 | } // namespace CryptoNote 48 | -------------------------------------------------------------------------------- /tests/cryptotest.pl: -------------------------------------------------------------------------------- 1 | require 'cryptolib.pl'; 2 | 3 | $key = 'fc7557a2595788aea7205ffd801b8a157dc9c698adb2c598ba543eaa67cb700e'; 4 | $pt = '664422cf6f4100dc6b3298e41ca53b173a98918fc9cb50fc2d590b7d1285f4ab'; 5 | $m = keccak_256(pack 'H*', 'c8fedd380dbae40ffb52'); 6 | 7 | 8 | $s = '26a9589121e569ee0ac2e8ac7a7ea331d348f9a0fa8d28926d27c7506759e406'; 9 | $e = '780be966ad89ba526cc7adf4b771adbdaa0568038e6a30e776839a81e57dee0c'; 10 | 11 | print " self SIG -- OK\n" if check_s($m,$pt,sign($m,$key)); 12 | print " test SIG -- OK\n" if check_s($m,$pt,$s,$e); 13 | 14 | @aa = r_sign($m,im_gen($pt,$key),$key,1,ec_pack(ec_mul(111,$x0,$y0)),$pt,ec_pack(ec_mul(47,$x0,$y0))); 15 | print " self RSIG -- OK\n" if r_check_s($m,im_gen($pt,$key),ec_pack(ec_mul(111,$x0,$y0)),$pt,ec_pack(ec_mul(47,$x0,$y0)),@aa); 16 | 17 | $k1 = '6a7a81a52ba91b9785b484d761bfb3ad9a473c147e17b7fbbc3992e8c97108d7'; 18 | $sk1 = '3ce3eb784016a53fa915053d24f55dc8fbc7af3fabc915701adb67e61a25f50f'; 19 | $k2 = '0f3fe9c20b24a11bf4d6d1acd335c6a80543f1f0380590d7323caf1390c78e88'; 20 | $sk2 = '4967a2bfa0c8a0afc0df238d068b6c7182577afd0781c9d3720bb7a6cf71630c'; #main key 21 | $m = keccak_256(pack 'H*', '5020c4d530b6ec6cb4d9'); 22 | @sig = ('b7903a4a3aca7253bb98be335014bebb33683aedca0bc46e288e229ecfccbe0e', 23 | '2c15e4de88ff38d655e2deef0e06a7ca4541a7754c37e7b20875cce791754508', 24 | '6acae497177b2eeaf658b813eaf50e1e06f3d1107694beff9b520c65ee624f05', 25 | '026c8d9801f7330aa82426adf5bacf4546d83df0cc12321ede90df8c0d9aa800'); 26 | 27 | 28 | print " test RSIG -- OK" if r_check_s($m,im_gen($k2,$sk2),$k1, $k2, @sig); 29 | -------------------------------------------------------------------------------- /lib/CryptoNoteCore/TransactionApi.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | #include 23 | 24 | namespace CryptoNote { 25 | 26 | std::unique_ptr createTransaction(); 27 | std::unique_ptr createTransaction(const BinaryArray &transactionBlob); 28 | std::unique_ptr createTransaction(const Transaction &tx); 29 | 30 | std::unique_ptr createTransactionPrefix(const Transaction &fullTransaction); 31 | std::unique_ptr createTransactionPrefix( 32 | const TransactionPrefix &prefix, 33 | const Crypto::Hash &transactionHash); 34 | 35 | } // namespace CryptoNote 36 | -------------------------------------------------------------------------------- /lib/Platform/Linux/System/Ipv4Resolver.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | 23 | namespace System { 24 | 25 | class Dispatcher; 26 | class Ipv4Address; 27 | 28 | class Ipv4Resolver 29 | { 30 | public: 31 | Ipv4Resolver(); 32 | explicit Ipv4Resolver(Dispatcher &dispatcher); 33 | Ipv4Resolver(const Ipv4Resolver &) = delete; 34 | Ipv4Resolver(Ipv4Resolver &&other); 35 | ~Ipv4Resolver(); 36 | 37 | Ipv4Address resolve(const std::string &host); 38 | 39 | Ipv4Resolver &operator=(const Ipv4Resolver &) = delete; 40 | Ipv4Resolver &operator=(Ipv4Resolver &&other); 41 | 42 | private: 43 | Dispatcher *dispatcher; 44 | }; 45 | 46 | } // namespace System 47 | -------------------------------------------------------------------------------- /lib/Platform/Android/System/Ipv4Resolver.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | 23 | namespace System { 24 | 25 | class Dispatcher; 26 | class Ipv4Address; 27 | 28 | class Ipv4Resolver 29 | { 30 | public: 31 | Ipv4Resolver(); 32 | explicit Ipv4Resolver(Dispatcher &dispatcher); 33 | Ipv4Resolver(const Ipv4Resolver &) = delete; 34 | Ipv4Resolver(Ipv4Resolver &&other); 35 | ~Ipv4Resolver(); 36 | 37 | Ipv4Address resolve(const std::string &host); 38 | 39 | Ipv4Resolver &operator=(const Ipv4Resolver &) = delete; 40 | Ipv4Resolver &operator=(Ipv4Resolver &&other); 41 | 42 | private: 43 | Dispatcher *dispatcher; 44 | }; 45 | 46 | } // namespace System 47 | -------------------------------------------------------------------------------- /lib/Platform/Windows/System/Ipv4Resolver.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | 23 | namespace System { 24 | 25 | class Dispatcher; 26 | class Ipv4Address; 27 | 28 | class Ipv4Resolver 29 | { 30 | public: 31 | Ipv4Resolver(); 32 | explicit Ipv4Resolver(Dispatcher &dispatcher); 33 | Ipv4Resolver(const Ipv4Resolver &) = delete; 34 | Ipv4Resolver(Ipv4Resolver &&other); 35 | ~Ipv4Resolver(); 36 | 37 | Ipv4Address resolve(const std::string &host); 38 | 39 | Ipv4Resolver &operator=(const Ipv4Resolver &) = delete; 40 | Ipv4Resolver &operator=(Ipv4Resolver &&other); 41 | 42 | private: 43 | Dispatcher *dispatcher; 44 | }; 45 | 46 | } // namespace System 47 | -------------------------------------------------------------------------------- /lib/Logging/LoggerGroup.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | #include 23 | 24 | namespace Logging { 25 | 26 | class LoggerGroup : public CommonLogger 27 | { 28 | public: 29 | explicit LoggerGroup(Level level = DEBUGGING); 30 | 31 | void addLogger(ILogger &logger); 32 | void removeLogger(ILogger &logger); 33 | 34 | virtual void operator()(const std::string &category, 35 | Level level, 36 | boost::posix_time::ptime time, 37 | const std::string &body) override; 38 | 39 | protected: 40 | std::vector m_loggers; 41 | }; 42 | 43 | } // namespace Logging 44 | -------------------------------------------------------------------------------- /lib/P2p/P2pNetworks.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2019, The Karbowanec developers 3 | // Copyright (c) 2018-2023, The Qwertycoin Group. 4 | // 5 | // This file is part of Qwertycoin. 6 | // 7 | // Qwertycoin is free software: you can redistribute it and/or modify 8 | // it under the terms of the GNU Lesser General Public License as published by 9 | // the Free Software Foundation, either version 3 of the License, or 10 | // (at your option) any later version. 11 | // 12 | // Qwertycoin is distributed in the hope that it will be useful, 13 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | // GNU Lesser General Public License for more details. 16 | // 17 | // You should have received a copy of the GNU Lesser General Public License 18 | // along with Qwertycoin. If not, see . 19 | 20 | #include 21 | #include 22 | #include 23 | #include 24 | 25 | #pragma once 26 | 27 | namespace CryptoNote { 28 | 29 | namespace { 30 | 31 | boost::uuids::uuid name; 32 | boost::uuids::name_generator gen(name); 33 | boost::uuids::uuid u = gen("013c01ff0001ffffffffffff07029b2e4c0281c0b02e7c53291a94d1d0cbff8883f8024f5142ee494ffbbd0880712101eddf1e272c1ffa70f49ca4eaad918578bc3b59689e53e48a1bc670fbdea08478.5.1.2"); 34 | } // namespace 35 | 36 | const static boost::uuids::uuid QWERTYCOIN_NETWORK = u; 37 | 38 | } // namespace CryptoNote 39 | -------------------------------------------------------------------------------- /lib/Platform/OSX/System/Ipv4Resolver.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | 23 | namespace System { 24 | 25 | class Dispatcher; 26 | class Ipv4Address; 27 | 28 | class Ipv4Resolver 29 | { 30 | public: 31 | Ipv4Resolver(); 32 | explicit Ipv4Resolver(Dispatcher &dispatcher); 33 | Ipv4Resolver(const Ipv4Resolver &) = delete; 34 | Ipv4Resolver(Ipv4Resolver &&other) noexcept; 35 | ~Ipv4Resolver() = default; 36 | 37 | Ipv4Address resolve(const std::string &host); 38 | 39 | Ipv4Resolver &operator=(const Ipv4Resolver &) = delete; 40 | Ipv4Resolver &operator=(Ipv4Resolver &&other) noexcept; 41 | 42 | private: 43 | Dispatcher *dispatcher; 44 | }; 45 | 46 | } // namespace System 47 | -------------------------------------------------------------------------------- /lib/CryptoNoteCore/VerificationContext.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | namespace CryptoNote { 22 | 23 | struct tx_verification_context 24 | { 25 | bool m_should_be_relayed; 26 | bool m_verification_failed; // bad tx, should drop connection 27 | bool m_verifivation_impossible; // the transaction is related with an alternative blockchain 28 | bool m_added_to_pool; 29 | bool m_tx_fee_too_small; 30 | }; 31 | 32 | struct block_verification_context 33 | { 34 | bool m_added_to_main_chain; 35 | bool m_verification_failed; // bad block, should drop connection 36 | bool m_marked_as_orphaned; 37 | bool m_already_exists; 38 | bool m_switched_to_alt_chain; 39 | }; 40 | 41 | } // namespace CryptoNote 42 | -------------------------------------------------------------------------------- /lib/Platform/FreeBSD/System/Ipv4Resolver.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | 23 | namespace System { 24 | 25 | class Dispatcher; 26 | class Ipv4Address; 27 | 28 | class Ipv4Resolver 29 | { 30 | public: 31 | Ipv4Resolver(); 32 | explicit Ipv4Resolver(Dispatcher &dispatcher); 33 | Ipv4Resolver(const Ipv4Resolver &) = delete; 34 | Ipv4Resolver(Ipv4Resolver &&other) noexcept; 35 | ~Ipv4Resolver() = default; 36 | 37 | Ipv4Address resolve(const std::string &host); 38 | 39 | Ipv4Resolver &operator=(const Ipv4Resolver &) = delete; 40 | Ipv4Resolver &operator=(Ipv4Resolver &&other) noexcept; 41 | 42 | private: 43 | Dispatcher *dispatcher; 44 | }; 45 | 46 | } // namespace System 47 | -------------------------------------------------------------------------------- /lib/System/ContextGroup.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | 23 | namespace System { 24 | 25 | class ContextGroup 26 | { 27 | public: 28 | explicit ContextGroup(Dispatcher &dispatcher); 29 | ContextGroup(const ContextGroup &) = delete; 30 | ContextGroup(ContextGroup &&other) noexcept; 31 | ~ContextGroup(); 32 | 33 | void interrupt(); 34 | void spawn(std::function &&procedure); 35 | void wait(); 36 | 37 | ContextGroup &operator=(const ContextGroup &) = delete; 38 | ContextGroup &operator=(ContextGroup &&other) noexcept; 39 | 40 | private: 41 | Dispatcher *dispatcher; 42 | NativeContextGroup contextGroup; 43 | }; 44 | 45 | } // namespace System 46 | -------------------------------------------------------------------------------- /tests/UnitTests/UnitTestsUtils.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | 23 | namespace unit_test 24 | { 25 | class call_counter 26 | { 27 | public: 28 | call_counter() 29 | : m_counter(0) 30 | { 31 | } 32 | 33 | void inc() volatile 34 | { 35 | // memory_order_relaxed is enough for call counter 36 | m_counter.fetch_add(1, std::memory_order_relaxed); 37 | } 38 | 39 | size_t get() volatile const 40 | { 41 | return m_counter.load(std::memory_order_relaxed); 42 | } 43 | 44 | void reset() volatile 45 | { 46 | m_counter.store(0, std::memory_order_relaxed); 47 | } 48 | 49 | private: 50 | std::atomic m_counter; 51 | }; 52 | } 53 | -------------------------------------------------------------------------------- /lib/System/ContextGroupTimeout.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #include 20 | #include 21 | 22 | using namespace System; 23 | 24 | ContextGroupTimeout::ContextGroupTimeout(Dispatcher &dispatcher, 25 | ContextGroup &contextGroup, 26 | std::chrono::nanoseconds timeout) 27 | : m_workingContextGroup(dispatcher), 28 | m_timeoutTimer(dispatcher) 29 | { 30 | m_workingContextGroup.spawn([&, timeout] { 31 | try { 32 | m_timeoutTimer.sleep(timeout); 33 | contextGroup.interrupt(); 34 | } catch (InterruptedException &) { 35 | // do nothing 36 | } 37 | }); 38 | } 39 | -------------------------------------------------------------------------------- /lib/Logging/LoggerManager.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | 27 | namespace Logging { 28 | 29 | class LoggerManager : public LoggerGroup 30 | { 31 | public: 32 | LoggerManager() = default; 33 | 34 | void configure(const Common::JsonValue &val); 35 | 36 | void operator()(const std::string &category, 37 | Level level, 38 | boost::posix_time::ptime time, 39 | const std::string &body) override; 40 | 41 | private: 42 | std::vector> loggers; 43 | std::mutex reconfigureLock; 44 | }; 45 | 46 | } // namespace Logging 47 | -------------------------------------------------------------------------------- /lib/Wallet/WalletAsyncContextCounter.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #include 20 | 21 | namespace CryptoNote { 22 | 23 | void WalletAsyncContextCounter::addAsyncContext() 24 | { 25 | std::unique_lock lock(m_mutex); 26 | m_asyncContexts++; 27 | } 28 | 29 | void WalletAsyncContextCounter::delAsyncContext() 30 | { 31 | std::unique_lock lock(m_mutex); 32 | m_asyncContexts--; 33 | if (!m_asyncContexts) { 34 | m_cv.notify_one(); 35 | } 36 | } 37 | 38 | void WalletAsyncContextCounter::waitAsyncContextsFinish() 39 | { 40 | std::unique_lock lock(m_mutex); 41 | while (m_asyncContexts > 0) { 42 | m_cv.wait(lock); 43 | } 44 | } 45 | 46 | } // namespace CryptoNote 47 | -------------------------------------------------------------------------------- /lib/Common/PathTools.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | 23 | namespace Common { 24 | 25 | std::string NativePathToGeneric(const std::string &nativePath); 26 | 27 | std::string GetPathDirectory(const std::string &path); 28 | std::string GetPathFilename(const std::string &path); 29 | void SplitPath(const std::string &path, std::string &directory, std::string &filename); 30 | 31 | std::string CombinePath(const std::string &path1, const std::string &path2); 32 | std::string GetExtension(const std::string &path); 33 | std::string RemoveExtension(const std::string &path); 34 | std::string ReplaceExtenstion(const std::string &path, const std::string &extension); 35 | bool HasParentPath(const std::string &path); 36 | 37 | } // namespace Common 38 | -------------------------------------------------------------------------------- /lib/Platform/OSX/System/Context.c: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #include 20 | #include "Context.h" 21 | 22 | void makecontext(uctx *ucp, void (*func)(void), intptr_t arg) 23 | { 24 | long *sp; 25 | 26 | memset(&ucp->uc_mcontext, 0, sizeof ucp->uc_mcontext); 27 | ucp->uc_mcontext.mc_rdi = (long)arg; 28 | sp = (long *)ucp->uc_stack.ss_sp+ucp->uc_stack.ss_size/sizeof(long); 29 | sp -= 1; 30 | sp = (void *)((uintptr_t)sp - (uintptr_t)sp%16); // 16-align for OS X 31 | *--sp = 0; // return address 32 | ucp->uc_mcontext.mc_rip = (long)func; 33 | ucp->uc_mcontext.mc_rsp = (long)sp; 34 | } 35 | 36 | int swapcontext(uctx *oucp, const uctx *ucp) 37 | { 38 | if(getcontext(oucp) == 0) { 39 | setcontext(ucp); 40 | } 41 | 42 | return 0; 43 | } 44 | -------------------------------------------------------------------------------- /lib/Platform/Linux/System/TcpConnector.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | #include 23 | 24 | namespace System { 25 | 26 | class Dispatcher; 27 | class Ipv4Address; 28 | class TcpConnection; 29 | 30 | class TcpConnector 31 | { 32 | public: 33 | TcpConnector(); 34 | TcpConnector(Dispatcher &dispatcher); 35 | TcpConnector(const TcpConnector &) = delete; 36 | TcpConnector(TcpConnector &&other); 37 | ~TcpConnector(); 38 | 39 | TcpConnection connect(const Ipv4Address& address, uint16_t port); 40 | 41 | TcpConnector &operator=(const TcpConnector &) = delete; 42 | TcpConnector &operator=(TcpConnector &&other); 43 | 44 | private: 45 | void *context; 46 | Dispatcher *dispatcher; 47 | }; 48 | 49 | } // namespace System 50 | -------------------------------------------------------------------------------- /lib/Platform/Android/System/TcpConnector.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | #include 23 | 24 | namespace System { 25 | 26 | class Dispatcher; 27 | class Ipv4Address; 28 | class TcpConnection; 29 | 30 | class TcpConnector 31 | { 32 | public: 33 | TcpConnector(); 34 | TcpConnector(Dispatcher &dispatcher); 35 | TcpConnector(const TcpConnector &) = delete; 36 | TcpConnector(TcpConnector &&other); 37 | ~TcpConnector(); 38 | 39 | TcpConnection connect(const Ipv4Address& address, uint16_t port); 40 | 41 | TcpConnector &operator=(const TcpConnector &) = delete; 42 | TcpConnector &operator=(TcpConnector &&other); 43 | 44 | private: 45 | void *context; 46 | Dispatcher *dispatcher; 47 | }; 48 | 49 | } // namespace System 50 | -------------------------------------------------------------------------------- /tests/CoreTests/AccountBoostSerialization.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | 21 | #include "CryptoNoteCore/Account.h" 22 | #include "CryptoNoteBoostSerialization.h" 23 | 24 | //namespace CryptoNote { 25 | namespace boost 26 | { 27 | namespace serialization 28 | { 29 | template 30 | inline void serialize(Archive &a, CryptoNote::AccountKeys &x, const boost::serialization::version_type ver) 31 | { 32 | a & x.address; 33 | a & x.spendSecretKey; 34 | a & x.viewSecretKey; 35 | } 36 | 37 | template 38 | inline void serialize(Archive &a, CryptoNote::AccountPublicAddress &x, const boost::serialization::version_type ver) 39 | { 40 | a & x.spendPublicKey; 41 | a & x.viewPublicKey; 42 | } 43 | 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /tests/CoreTests/Chaingen001.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2018-2023, The Qwertycoin Group. 3 | // 4 | // This file is part of Qwertycoin. 5 | // 6 | // Qwertycoin is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU Lesser General Public License as published by 8 | // the Free Software Foundation, either version 3 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // Qwertycoin is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU Lesser General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU Lesser General Public License 17 | // along with Qwertycoin. If not, see . 18 | 19 | #pragma once 20 | #include "Chaingen.h" 21 | 22 | class gen_simple_chain_001: public test_chain_unit_base 23 | { 24 | public: 25 | gen_simple_chain_001(); 26 | bool generate(std::vector &events); 27 | bool verify_callback_1(CryptoNote::core& c, size_t ev_index, const std::vector &events); 28 | bool verify_callback_2(CryptoNote::core& c, size_t ev_index, const std::vector &events); 29 | }; 30 | 31 | class one_block: public test_chain_unit_base 32 | { 33 | CryptoNote::AccountBase alice; 34 | public: 35 | one_block(); 36 | bool generate(std::vector &events); 37 | bool verify_1(CryptoNote::core& c, size_t ev_index, const std::vector &events); 38 | }; 39 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | **/bui* 2 | 3 | .DS_Store 4 | /build 5 | /build32 6 | /build64 7 | /cmake-build-debug 8 | /tags 9 | .idea 10 | .ycm_extra_conf.py 11 | .ycm_extra_conf.pyc 12 | Release 13 | Debug 14 | src/CMakeCache.txt 15 | src/CMakeFiles/ 16 | src/Makefile 17 | src/build/ 18 | src/cmake_install.cmake 19 | .codelite/ 20 | 21 | ### mac 22 | # General 23 | .DS_Store 24 | .AppleDouble 25 | .LSOverride 26 | 27 | # Icon must end with two \r 28 | Icon 29 | 30 | 31 | # Thumbnails 32 | ._* 33 | 34 | # Files that might appear in the root of a volume 35 | .DocumentRevisions-V100 36 | .fseventsd 37 | .Spotlight-V100 38 | .TemporaryItems 39 | .Trashes 40 | .VolumeIcon.icns 41 | .com.apple.timemachine.donotpresent 42 | 43 | # Directories potentially created on remote AFP share 44 | .AppleDB 45 | .AppleDesktop 46 | Network Trash Folder 47 | Temporary Items 48 | .apdisk 49 | 50 | 51 | ### linux 52 | *~ 53 | 54 | # temporary files which can be created if a process still has a handle open of a deleted file 55 | .fuse_hidden* 56 | 57 | # KDE directory preferences 58 | .directory 59 | 60 | # Linux trash folder which might appear on any partition or disk 61 | .Trash-* 62 | 63 | # .nfs files are created when an open file is removed but is still being accessed 64 | .nfs* 65 | 66 | 67 | ### win 68 | # Windows thumbnail cache files 69 | Thumbs.db 70 | ehthumbs.db 71 | ehthumbs_vista.db 72 | 73 | # Dump file 74 | *.stackdump 75 | 76 | # Folder config file 77 | [Dd]esktop.ini 78 | 79 | # Recycle Bin used on file shares 80 | $RECYCLE.BIN/ 81 | 82 | # Windows Installer files 83 | *.cab 84 | *.msi 85 | *.msm 86 | *.msp 87 | 88 | # Windows shortcuts 89 | *.lnk 90 | 91 | .vscode 92 | .vs 93 | cmake-* 94 | --------------------------------------------------------------------------------