├── CMakeLists.txt ├── CTestCustom.cmake ├── Dockerfile ├── LICENSE ├── Makefile ├── README.md ├── cmake ├── 32-bit-toolchain.cmake ├── 64-bit-toolchain.cmake ├── Doxyfile.in ├── Doxygen.extra.css.in ├── FindMiniupnpc.cmake ├── test-static-assert.c └── test-static-assert.cpp ├── external ├── CMakeLists.txt ├── boost1_65_1 │ └── libs │ │ └── filesystem │ │ └── src │ │ └── operations.patch ├── gtest │ ├── CHANGES │ ├── CMakeLists.txt │ ├── CONTRIBUTORS │ ├── LICENSE │ ├── Makefile.am │ ├── README.md │ ├── cmake │ │ ├── gtest.pc.in │ │ ├── gtest_main.pc.in │ │ └── internal_utils.cmake │ ├── codegear │ │ ├── gtest.cbproj │ │ ├── gtest.groupproj │ │ ├── gtest_all.cc │ │ ├── gtest_link.cc │ │ ├── gtest_main.cbproj │ │ └── gtest_unittest.cbproj │ ├── configure.ac │ ├── docs │ │ ├── Pkgconfig.md │ │ ├── PumpManual.md │ │ ├── XcodeGuide.md │ │ ├── advanced.md │ │ ├── faq.md │ │ ├── primer.md │ │ └── samples.md │ ├── include │ │ └── gtest │ │ │ ├── gtest-death-test.h │ │ │ ├── gtest-message.h │ │ │ ├── gtest-param-test.h │ │ │ ├── gtest-param-test.h.pump │ │ │ ├── gtest-printers.h │ │ │ ├── gtest-spi.h │ │ │ ├── gtest-test-part.h │ │ │ ├── gtest-typed-test.h │ │ │ ├── gtest.h │ │ │ ├── gtest_pred_impl.h │ │ │ ├── gtest_prod.h │ │ │ └── internal │ │ │ ├── custom │ │ │ ├── gtest-port.h │ │ │ ├── gtest-printers.h │ │ │ └── gtest.h │ │ │ ├── gtest-death-test-internal.h │ │ │ ├── gtest-filepath.h │ │ │ ├── gtest-internal.h │ │ │ ├── gtest-linked_ptr.h │ │ │ ├── gtest-param-util-generated.h │ │ │ ├── gtest-param-util-generated.h.pump │ │ │ ├── gtest-param-util.h │ │ │ ├── gtest-port-arch.h │ │ │ ├── gtest-port.h │ │ │ ├── gtest-string.h │ │ │ ├── gtest-tuple.h │ │ │ ├── gtest-tuple.h.pump │ │ │ ├── gtest-type-util.h │ │ │ └── gtest-type-util.h.pump │ ├── m4 │ │ ├── acx_pthread.m4 │ │ └── gtest.m4 │ ├── make │ │ └── Makefile │ ├── msvc │ │ └── 2010 │ │ │ ├── gtest-md.sln │ │ │ ├── gtest-md.vcxproj │ │ │ ├── gtest-md.vcxproj.filters │ │ │ ├── gtest.sln │ │ │ ├── gtest.vcxproj │ │ │ ├── gtest.vcxproj.filters │ │ │ ├── gtest_main-md.vcxproj │ │ │ ├── gtest_main-md.vcxproj.filters │ │ │ ├── gtest_main.vcxproj │ │ │ ├── gtest_main.vcxproj.filters │ │ │ ├── gtest_prod_test-md.vcxproj │ │ │ ├── gtest_prod_test-md.vcxproj.filters │ │ │ ├── gtest_prod_test.vcxproj │ │ │ ├── gtest_prod_test.vcxproj.filters │ │ │ ├── gtest_unittest-md.vcxproj │ │ │ ├── gtest_unittest-md.vcxproj.filters │ │ │ ├── gtest_unittest.vcxproj │ │ │ └── gtest_unittest.vcxproj.filters │ ├── samples │ │ ├── prime_tables.h │ │ ├── sample1.cc │ │ ├── sample1.h │ │ ├── sample10_unittest.cc │ │ ├── sample1_unittest.cc │ │ ├── sample2.cc │ │ ├── sample2.h │ │ ├── sample2_unittest.cc │ │ ├── sample3-inl.h │ │ ├── sample3_unittest.cc │ │ ├── sample4.cc │ │ ├── sample4.h │ │ ├── sample4_unittest.cc │ │ ├── sample5_unittest.cc │ │ ├── sample6_unittest.cc │ │ ├── sample7_unittest.cc │ │ ├── sample8_unittest.cc │ │ └── sample9_unittest.cc │ ├── scripts │ │ ├── common.py │ │ ├── fuse_gtest_files.py │ │ ├── gen_gtest_pred_impl.py │ │ ├── gtest-config.in │ │ ├── pump.py │ │ ├── release_docs.py │ │ ├── test │ │ │ └── Makefile │ │ ├── upload.py │ │ └── upload_gtest.py │ ├── src │ │ ├── gtest-all.cc │ │ ├── gtest-death-test.cc │ │ ├── gtest-filepath.cc │ │ ├── gtest-internal-inl.h │ │ ├── gtest-port.cc │ │ ├── gtest-printers.cc │ │ ├── gtest-test-part.cc │ │ ├── gtest-typed-test.cc │ │ ├── gtest.cc │ │ └── gtest_main.cc │ ├── test │ │ ├── BUILD.bazel │ │ ├── gtest-death-test_ex_test.cc │ │ ├── gtest-death-test_test.cc │ │ ├── gtest-filepath_test.cc │ │ ├── gtest-linked_ptr_test.cc │ │ ├── gtest-listener_test.cc │ │ ├── gtest-message_test.cc │ │ ├── gtest-options_test.cc │ │ ├── gtest-param-test2_test.cc │ │ ├── gtest-param-test_test.cc │ │ ├── gtest-param-test_test.h │ │ ├── gtest-port_test.cc │ │ ├── gtest-printers_test.cc │ │ ├── gtest-test-part_test.cc │ │ ├── gtest-tuple_test.cc │ │ ├── gtest-typed-test2_test.cc │ │ ├── gtest-typed-test_test.cc │ │ ├── gtest-typed-test_test.h │ │ ├── gtest-unittest-api_test.cc │ │ ├── gtest_all_test.cc │ │ ├── gtest_assert_by_exception_test.cc │ │ ├── gtest_break_on_failure_unittest.py │ │ ├── gtest_break_on_failure_unittest_.cc │ │ ├── gtest_catch_exceptions_test.py │ │ ├── gtest_catch_exceptions_test_.cc │ │ ├── gtest_color_test.py │ │ ├── gtest_color_test_.cc │ │ ├── gtest_env_var_test.py │ │ ├── gtest_env_var_test_.cc │ │ ├── gtest_environment_test.cc │ │ ├── gtest_filter_unittest.py │ │ ├── gtest_filter_unittest_.cc │ │ ├── gtest_help_test.py │ │ ├── gtest_help_test_.cc │ │ ├── gtest_json_outfiles_test.py │ │ ├── gtest_json_output_unittest.py │ │ ├── gtest_json_test_utils.py │ │ ├── gtest_list_tests_unittest.py │ │ ├── gtest_list_tests_unittest_.cc │ │ ├── gtest_main_unittest.cc │ │ ├── gtest_no_test_unittest.cc │ │ ├── gtest_output_test.py │ │ ├── gtest_output_test_.cc │ │ ├── gtest_output_test_golden_lin.txt │ │ ├── gtest_pred_impl_unittest.cc │ │ ├── gtest_premature_exit_test.cc │ │ ├── gtest_prod_test.cc │ │ ├── gtest_repeat_test.cc │ │ ├── gtest_shuffle_test.py │ │ ├── gtest_shuffle_test_.cc │ │ ├── gtest_sole_header_test.cc │ │ ├── gtest_stress_test.cc │ │ ├── gtest_test_utils.py │ │ ├── gtest_testbridge_test.py │ │ ├── gtest_testbridge_test_.cc │ │ ├── gtest_throw_on_failure_ex_test.cc │ │ ├── gtest_throw_on_failure_test.py │ │ ├── gtest_throw_on_failure_test_.cc │ │ ├── gtest_uninitialized_test.py │ │ ├── gtest_uninitialized_test_.cc │ │ ├── gtest_unittest.cc │ │ ├── gtest_xml_outfile1_test_.cc │ │ ├── gtest_xml_outfile2_test_.cc │ │ ├── gtest_xml_outfiles_test.py │ │ ├── gtest_xml_output_unittest.py │ │ ├── gtest_xml_output_unittest_.cc │ │ ├── gtest_xml_test_utils.py │ │ ├── production.cc │ │ └── production.h │ └── xcode │ │ ├── Config │ │ ├── DebugProject.xcconfig │ │ ├── FrameworkTarget.xcconfig │ │ ├── General.xcconfig │ │ ├── ReleaseProject.xcconfig │ │ ├── StaticLibraryTarget.xcconfig │ │ └── TestTarget.xcconfig │ │ ├── Resources │ │ └── Info.plist │ │ ├── Samples │ │ └── FrameworkSample │ │ │ ├── Info.plist │ │ │ ├── WidgetFramework.xcodeproj │ │ │ └── project.pbxproj │ │ │ ├── runtests.sh │ │ │ ├── widget.cc │ │ │ ├── widget.h │ │ │ └── widget_test.cc │ │ ├── Scripts │ │ ├── runtests.sh │ │ └── versiongenerate.py │ │ └── gtest.xcodeproj │ │ └── project.pbxproj ├── linenoise │ └── linenoise.hpp ├── miniupnpc │ ├── CMakeLists.txt │ ├── Changelog.txt │ ├── LICENSE │ ├── MANIFEST.in │ ├── Makefile │ ├── Makefile.mingw │ ├── README │ ├── VERSION │ ├── apiversions.txt │ ├── codelength.h │ ├── connecthostport.c │ ├── connecthostport.h │ ├── external-ip.sh │ ├── igd_desc_parse.c │ ├── igd_desc_parse.h │ ├── java │ │ ├── JavaBridgeTest.java │ │ ├── testjava.bat │ │ └── testjava.sh │ ├── listdevices.c │ ├── man3 │ │ └── miniupnpc.3 │ ├── mingw32make.bat │ ├── minihttptestserver.c │ ├── minisoap.c │ ├── minisoap.h │ ├── minissdpc.c │ ├── minissdpc.h │ ├── miniupnpc.c │ ├── miniupnpc.def │ ├── miniupnpc.h │ ├── miniupnpc_declspec.h │ ├── miniupnpc_socketdef.h │ ├── miniupnpcmodule.c │ ├── miniupnpcstrings.h.cmake │ ├── miniupnpcstrings.h.in │ ├── miniupnpctypes.h │ ├── miniwget.c │ ├── miniwget.h │ ├── miniwget_private.h │ ├── minixml.c │ ├── minixml.h │ ├── minixmlvalid.c │ ├── msvc │ │ ├── genminiupnpcstrings.vbs │ │ ├── miniupnpc.sln │ │ ├── miniupnpc.vcproj │ │ ├── miniupnpc.vcxproj │ │ ├── miniupnpc.vcxproj.filters │ │ ├── miniupnpc_vs2010.sln │ │ ├── miniupnpc_vs2010.vcxproj │ │ ├── miniupnpc_vs2010.vcxproj.filters │ │ ├── miniupnpc_vs2015.sln │ │ ├── upnpc-static.vcproj │ │ ├── upnpc-static.vcxproj │ │ ├── upnpc-static.vcxproj.filters │ │ └── upnpc-static_vs2010.vcxproj │ ├── portlistingparse.c │ ├── portlistingparse.h │ ├── pymoduletest.py │ ├── pymoduletest3.py │ ├── receivedata.c │ ├── receivedata.h │ ├── setup.py │ ├── setupmingw32.py │ ├── testdesc │ │ ├── linksys_WAG200G_desc.values │ │ ├── linksys_WAG200G_desc.xml │ │ ├── new_LiveBox_desc.values │ │ └── new_LiveBox_desc.xml │ ├── testigddescparse.c │ ├── testminiwget.c │ ├── testminiwget.sh │ ├── testminixml.c │ ├── testportlistingparse.c │ ├── testreplyparse │ │ ├── DeletePortMapping.namevalue │ │ ├── DeletePortMapping.xml │ │ ├── GetExternalIPAddress.namevalue │ │ ├── GetExternalIPAddress.xml │ │ ├── GetSpecificPortMappingEntryReq.namevalue │ │ ├── GetSpecificPortMappingEntryReq.xml │ │ ├── GetSpecificPortMappingEntryResp.namevalue │ │ ├── GetSpecificPortMappingEntryResp.xml │ │ ├── SetDefaultConnectionService.namevalue │ │ ├── SetDefaultConnectionService.xml │ │ └── readme.txt │ ├── testupnpigd.py │ ├── testupnpreplyparse.c │ ├── testupnpreplyparse.sh │ ├── updateminiupnpcstrings.sh │ ├── upnpc.c │ ├── upnpcommands.c │ ├── upnpcommands.h │ ├── upnpdev.c │ ├── upnpdev.h │ ├── upnperrors.c │ ├── upnperrors.h │ ├── upnpreplyparse.c │ ├── upnpreplyparse.h │ └── wingenminiupnpcstrings.c └── parallel_hashmap │ ├── btree.h │ ├── conanfile.py │ ├── meminfo.h │ ├── phmap.h │ ├── phmap_base.h │ ├── phmap_bits.h │ ├── phmap_config.h │ ├── phmap_dump.h │ ├── phmap_fwd_decl.h │ └── phmap_utils.h ├── include ├── BlockchainExplorerData.h ├── CMakeLists.txt ├── CryptoNote.h ├── CryptoTypes.h ├── IBlockchainExplorer.h ├── INode.h ├── IObservable.h ├── IStreamSerializable.h ├── ITransaction.h ├── ITransfersContainer.h ├── ITransfersSynchronizer.h ├── IWallet.h ├── IWalletLegacy.h └── android.h ├── src ├── AddressGenerator │ └── vanitygen.cpp ├── BinaryInfo │ ├── daemon.rc │ ├── greenwallet.rc │ ├── icons │ │ └── plura.ico │ ├── miner.rc │ ├── optimizer.rc │ ├── simplewallet.rc │ ├── vanitygen.rc │ └── walletd.rc ├── BlockchainExplorer │ ├── BlockchainExplorer.cpp │ ├── BlockchainExplorer.h │ ├── BlockchainExplorerDataBuilder.cpp │ ├── BlockchainExplorerDataBuilder.h │ ├── BlockchainExplorerErrors.cpp │ └── BlockchainExplorerErrors.h ├── CMakeLists.txt ├── Checkpoints │ ├── Checkpoints.cpp │ ├── Checkpoints.h │ └── CheckpointsData.h ├── Common │ ├── ArrayRef.h │ ├── ArrayView.h │ ├── Base58.cpp │ ├── Base58.h │ ├── BinaryArray.hpp │ ├── BlockingQueue.cpp │ ├── BlockingQueue.h │ ├── ColouredMsg.h │ ├── CommandLine.cpp │ ├── CommandLine.h │ ├── ConsoleHandler.cpp │ ├── ConsoleHandler.h │ ├── ConsoleTools.cpp │ ├── ConsoleTools.h │ ├── DnsTools.cpp │ ├── DnsTools.h │ ├── FileMappedVector.cpp │ ├── FileMappedVector.h │ ├── FormatTools.cpp │ ├── FormatTools.h │ ├── IInputStream.cpp │ ├── IInputStream.h │ ├── IOutputStream.cpp │ ├── IOutputStream.h │ ├── JsonValue.cpp │ ├── JsonValue.h │ ├── Lazy.h │ ├── Math.cpp │ ├── Math.h │ ├── MemoryInputStream.cpp │ ├── MemoryInputStream.h │ ├── ObserverManager.h │ ├── PasswordContainer.cpp │ ├── PasswordContainer.h │ ├── PathTools.cpp │ ├── PathTools.h │ ├── ScopeExit.cpp │ ├── ScopeExit.h │ ├── ShuffleGenerator.h │ ├── SignalHandler.cpp │ ├── SignalHandler.h │ ├── StdInputStream.cpp │ ├── StdInputStream.h │ ├── StdOutputStream.cpp │ ├── StdOutputStream.h │ ├── StreamTools.cpp │ ├── StreamTools.h │ ├── StringBuffer.h │ ├── StringInputStream.cpp │ ├── StringInputStream.h │ ├── StringOutputStream.cpp │ ├── StringOutputStream.h │ ├── StringTools.cpp │ ├── StringTools.h │ ├── StringView.cpp │ ├── StringView.h │ ├── UrlTools.cpp │ ├── UrlTools.h │ ├── Util.cpp │ ├── Util.h │ ├── Varint.h │ ├── VectorOutputStream.cpp │ ├── VectorOutputStream.h │ ├── base64.hpp │ ├── int-util.h │ ├── pod-class.h │ └── static_assert.h ├── CryptoNoteConfig.h ├── CryptoNoteCore │ ├── Account.cpp │ ├── Account.h │ ├── BlockIndex.cpp │ ├── BlockIndex.h │ ├── Blockchain.cpp │ ├── Blockchain.h │ ├── BlockchainIndices.cpp │ ├── BlockchainIndices.h │ ├── BlockchainMessages.cpp │ ├── BlockchainMessages.h │ ├── Core.cpp │ ├── Core.h │ ├── CoreConfig.cpp │ ├── CoreConfig.h │ ├── CryptoNoteBasic.cpp │ ├── CryptoNoteBasic.h │ ├── CryptoNoteBasicImpl.cpp │ ├── CryptoNoteBasicImpl.h │ ├── CryptoNoteFormatUtils.cpp │ ├── CryptoNoteFormatUtils.h │ ├── CryptoNoteSerialization.cpp │ ├── CryptoNoteSerialization.h │ ├── CryptoNoteStatInfo.h │ ├── CryptoNoteTools.cpp │ ├── CryptoNoteTools.h │ ├── Currency.cpp │ ├── Currency.h │ ├── Difficulty.cpp │ ├── Difficulty.h │ ├── IBlock.cpp │ ├── IBlock.h │ ├── IBlockchainStorageObserver.h │ ├── ICore.h │ ├── ICoreObserver.h │ ├── IMinerHandler.h │ ├── ITimeProvider.cpp │ ├── ITimeProvider.h │ ├── ITransactionValidator.h │ ├── ITxPoolObserver.h │ ├── IntrusiveLinkedList.h │ ├── MessageQueue.h │ ├── Miner.cpp │ ├── Miner.h │ ├── MinerConfig.cpp │ ├── MinerConfig.h │ ├── OnceInInterval.h │ ├── SwappedMap.cpp │ ├── SwappedMap.h │ ├── SwappedVector.cpp │ ├── SwappedVector.h │ ├── Transaction.cpp │ ├── TransactionApi.h │ ├── TransactionApiExtra.h │ ├── TransactionExtra.cpp │ ├── TransactionExtra.h │ ├── TransactionPool.cpp │ ├── TransactionPool.h │ ├── TransactionPrefixImpl.cpp │ ├── TransactionUtils.cpp │ ├── TransactionUtils.h │ ├── UpgradeDetector.cpp │ ├── UpgradeDetector.h │ └── VerificationContext.h ├── CryptoNoteProtocol │ ├── CryptoNoteProtocolDefinitions.h │ ├── CryptoNoteProtocolHandler.cpp │ ├── CryptoNoteProtocolHandler.h │ ├── CryptoNoteProtocolHandlerCommon.h │ ├── ICryptoNoteProtocolObserver.h │ └── ICryptoNoteProtocolQuery.h ├── Daemon │ ├── Daemon.cpp │ ├── DaemonCommandsHandler.cpp │ └── DaemonCommandsHandler.h ├── GreenWallet │ ├── AddressBook.cpp │ ├── AddressBook.h │ ├── CommandDispatcher.cpp │ ├── CommandDispatcher.h │ ├── CommandImplementations.cpp │ ├── CommandImplementations.h │ ├── Commands.cpp │ ├── Commands.h │ ├── Fusion.cpp │ ├── Fusion.h │ ├── GetInput.cpp │ ├── GetInput.h │ ├── Menu.cpp │ ├── Menu.h │ ├── Open.cpp │ ├── Open.h │ ├── ParseArguments.cpp │ ├── ParseArguments.h │ ├── Sync.cpp │ ├── Sync.h │ ├── Tools.cpp │ ├── Tools.h │ ├── Transfer.cpp │ ├── Transfer.h │ ├── Types.h │ ├── WalletConfig.h │ ├── ZedWallet.cpp │ └── ZedWallet.h ├── HTTP │ ├── HttpParser.cpp │ ├── HttpParser.h │ ├── HttpParserErrorCodes.cpp │ ├── HttpParserErrorCodes.h │ ├── HttpRequest.cpp │ ├── HttpRequest.h │ ├── HttpResponse.cpp │ ├── HttpResponse.h │ └── httplib.h ├── InProcessNode │ ├── InProcessNode.cpp │ ├── InProcessNode.h │ ├── InProcessNodeErrors.cpp │ └── InProcessNodeErrors.h ├── JsonRpcServer │ ├── JsonRpcServer.cpp │ └── JsonRpcServer.h ├── Logging │ ├── CommonLogger.cpp │ ├── CommonLogger.h │ ├── ConsoleLogger.cpp │ ├── ConsoleLogger.h │ ├── FileLogger.cpp │ ├── FileLogger.h │ ├── ILogger.cpp │ ├── ILogger.h │ ├── LoggerGroup.cpp │ ├── LoggerGroup.h │ ├── LoggerManager.cpp │ ├── LoggerManager.h │ ├── LoggerMessage.cpp │ ├── LoggerMessage.h │ ├── LoggerRef.cpp │ ├── LoggerRef.h │ ├── StreamLogger.cpp │ └── StreamLogger.h ├── Mnemonics │ ├── chinese_simplified.h │ ├── dutch.h │ ├── electrum-words.cpp │ ├── electrum-words.h │ ├── english.h │ ├── french.h │ ├── german.h │ ├── italian.h │ ├── japanese.h │ ├── language_base.h │ ├── polish.h │ ├── portuguese.h │ ├── russian.h │ ├── singleton.h │ ├── spanish.h │ └── ukrainian.h ├── NodeRpcProxy │ ├── NodeErrors.cpp │ ├── NodeErrors.h │ ├── NodeRpcProxy.cpp │ └── NodeRpcProxy.h ├── Optimizer │ └── Optimizer.cpp ├── P2p │ ├── ConnectionContext.h │ ├── LevinProtocol.cpp │ ├── LevinProtocol.h │ ├── NetNode.cpp │ ├── NetNode.h │ ├── NetNodeCommon.h │ ├── NetNodeConfig.cpp │ ├── NetNodeConfig.h │ ├── P2pNetworks.h │ ├── P2pProtocolDefinitions.h │ ├── P2pProtocolTypes.h │ ├── PeerListManager.cpp │ ├── PeerListManager.h │ └── PendingLiteBlock.h ├── PaymentGate │ ├── NodeFactory.cpp │ ├── NodeFactory.h │ ├── PaymentServiceJsonRpcMessages.cpp │ ├── PaymentServiceJsonRpcMessages.h │ ├── PaymentServiceJsonRpcServer.cpp │ ├── PaymentServiceJsonRpcServer.h │ ├── WalletService.cpp │ ├── WalletService.h │ ├── WalletServiceErrorCategory.cpp │ └── WalletServiceErrorCategory.h ├── PaymentGateService │ ├── ConfigurationManager.cpp │ ├── ConfigurationManager.h │ ├── PaymentGateService.cpp │ ├── PaymentGateService.h │ ├── PaymentServiceConfiguration.cpp │ ├── PaymentServiceConfiguration.h │ ├── RpcNodeConfiguration.cpp │ ├── RpcNodeConfiguration.h │ └── main.cpp ├── Platform │ ├── Android │ │ └── System │ │ │ ├── Dispatcher.cpp │ │ │ ├── Dispatcher.h │ │ │ ├── ErrorMessage.cpp │ │ │ ├── ErrorMessage.h │ │ │ ├── Future.h │ │ │ ├── Ipv4Resolver.cpp │ │ │ ├── Ipv4Resolver.h │ │ │ ├── TcpConnection.cpp │ │ │ ├── TcpConnection.h │ │ │ ├── TcpConnector.cpp │ │ │ ├── TcpConnector.h │ │ │ ├── TcpListener.cpp │ │ │ ├── TcpListener.h │ │ │ ├── Timer.cpp │ │ │ └── Timer.h │ ├── FreeBSD │ │ └── System │ │ │ ├── Context.c │ │ │ ├── Context.h │ │ │ ├── Dispatcher.cpp │ │ │ ├── Dispatcher.h │ │ │ ├── ErrorMessage.cpp │ │ │ ├── ErrorMessage.h │ │ │ ├── Future.h │ │ │ ├── Ipv4Resolver.cpp │ │ │ ├── Ipv4Resolver.h │ │ │ ├── TcpConnection.cpp │ │ │ ├── TcpConnection.h │ │ │ ├── TcpConnector.cpp │ │ │ ├── TcpConnector.h │ │ │ ├── TcpListener.cpp │ │ │ ├── TcpListener.h │ │ │ ├── Timer.cpp │ │ │ ├── Timer.h │ │ │ └── asm.s │ ├── Linux │ │ └── System │ │ │ ├── Dispatcher.cpp │ │ │ ├── Dispatcher.h │ │ │ ├── ErrorMessage.cpp │ │ │ ├── ErrorMessage.h │ │ │ ├── Future.h │ │ │ ├── Ipv4Resolver.cpp │ │ │ ├── Ipv4Resolver.h │ │ │ ├── TcpConnection.cpp │ │ │ ├── TcpConnection.h │ │ │ ├── TcpConnector.cpp │ │ │ ├── TcpConnector.h │ │ │ ├── TcpListener.cpp │ │ │ ├── TcpListener.h │ │ │ ├── Timer.cpp │ │ │ └── Timer.h │ ├── OSX │ │ └── System │ │ │ ├── Context.c │ │ │ ├── Context.h │ │ │ ├── Dispatcher.cpp │ │ │ ├── Dispatcher.h │ │ │ ├── ErrorMessage.cpp │ │ │ ├── ErrorMessage.h │ │ │ ├── Future.h │ │ │ ├── Ipv4Resolver.cpp │ │ │ ├── Ipv4Resolver.h │ │ │ ├── TcpConnection.cpp │ │ │ ├── TcpConnection.h │ │ │ ├── TcpConnector.cpp │ │ │ ├── TcpConnector.h │ │ │ ├── TcpListener.cpp │ │ │ ├── TcpListener.h │ │ │ ├── Timer.cpp │ │ │ ├── Timer.h │ │ │ └── asm.s │ ├── Posix │ │ └── System │ │ │ ├── MemoryMappedFile.cpp │ │ │ └── MemoryMappedFile.h │ ├── Windows │ │ └── System │ │ │ ├── Dispatcher.cpp │ │ │ ├── Dispatcher.h │ │ │ ├── ErrorMessage.cpp │ │ │ ├── ErrorMessage.h │ │ │ ├── Future.h │ │ │ ├── Ipv4Resolver.cpp │ │ │ ├── Ipv4Resolver.h │ │ │ ├── MemoryMappedFile.cpp │ │ │ ├── MemoryMappedFile.h │ │ │ ├── TcpConnection.cpp │ │ │ ├── TcpConnection.h │ │ │ ├── TcpConnector.cpp │ │ │ ├── TcpConnector.h │ │ │ ├── TcpListener.cpp │ │ │ ├── TcpListener.h │ │ │ ├── Timer.cpp │ │ │ └── Timer.h │ ├── mingw │ │ └── alloca.h │ └── msc │ │ ├── alloca.h │ │ ├── stdbool.h │ │ └── sys │ │ └── param.h ├── Rpc │ ├── CoreRpcServerCommandsDefinitions.h │ ├── CoreRpcServerErrorCodes.h │ ├── HttpRootCerts.h │ ├── JsonRpc.cpp │ ├── JsonRpc.h │ ├── RpcServer.cpp │ ├── RpcServer.h │ ├── RpcServerConfig.cpp │ └── RpcServerConfig.h ├── Serialization │ ├── BinaryInputStreamSerializer.cpp │ ├── BinaryInputStreamSerializer.h │ ├── BinaryOutputStreamSerializer.cpp │ ├── BinaryOutputStreamSerializer.h │ ├── BinarySerializationTools.h │ ├── BlockchainExplorerDataSerialization.cpp │ ├── BlockchainExplorerDataSerialization.h │ ├── ISerializer.h │ ├── IStream.h │ ├── JsonInputStreamSerializer.cpp │ ├── JsonInputStreamSerializer.h │ ├── JsonInputValueSerializer.cpp │ ├── JsonInputValueSerializer.h │ ├── JsonOutputStreamSerializer.cpp │ ├── JsonOutputStreamSerializer.h │ ├── KVBinaryCommon.h │ ├── KVBinaryInputStreamSerializer.cpp │ ├── KVBinaryInputStreamSerializer.h │ ├── KVBinaryOutputStreamSerializer.cpp │ ├── KVBinaryOutputStreamSerializer.h │ ├── MemoryStream.cpp │ ├── MemoryStream.h │ ├── SerializationOverloads.cpp │ ├── SerializationOverloads.h │ └── SerializationTools.h ├── SimpleWallet │ ├── SimpleWallet.cpp │ └── SimpleWallet.h ├── System │ ├── Context.h │ ├── ContextGroup.cpp │ ├── ContextGroup.h │ ├── ContextGroupTimeout.cpp │ ├── ContextGroupTimeout.h │ ├── Event.cpp │ ├── Event.h │ ├── EventLock.cpp │ ├── EventLock.h │ ├── InterruptedException.cpp │ ├── InterruptedException.h │ ├── Ipv4Address.cpp │ ├── Ipv4Address.h │ ├── OperationTimeout.h │ ├── RemoteContext.h │ ├── RemoteEventLock.cpp │ ├── RemoteEventLock.h │ ├── SocketStream.cpp │ ├── SocketStream.h │ ├── TcpStream.cpp │ └── TcpStream.h ├── Transfers │ ├── BlockchainSynchronizer.cpp │ ├── BlockchainSynchronizer.h │ ├── CommonTypes.h │ ├── IBlockchainSynchronizer.h │ ├── IObservableImpl.h │ ├── SynchronizationState.cpp │ ├── SynchronizationState.h │ ├── TransfersConsumer.cpp │ ├── TransfersConsumer.h │ ├── TransfersContainer.cpp │ ├── TransfersContainer.h │ ├── TransfersSubscription.cpp │ ├── TransfersSubscription.h │ ├── TransfersSynchronizer.cpp │ ├── TransfersSynchronizer.h │ └── TypeHelpers.h ├── Wallet │ ├── IFusionManager.h │ ├── LegacyKeysImporter.cpp │ ├── LegacyKeysImporter.h │ ├── WalletAsyncContextCounter.cpp │ ├── WalletAsyncContextCounter.h │ ├── WalletErrors.cpp │ ├── WalletErrors.h │ ├── WalletGreen.cpp │ ├── WalletGreen.h │ ├── WalletIndices.h │ ├── WalletRpcServer.cpp │ ├── WalletRpcServer.h │ ├── WalletRpcServerCommandsDefinitions.h │ ├── WalletRpcServerErrorCodes.h │ ├── WalletSerializationV1.cpp │ ├── WalletSerializationV1.h │ ├── WalletSerializationV2.cpp │ ├── WalletSerializationV2.h │ ├── WalletUtils.cpp │ └── WalletUtils.h ├── WalletLegacy │ ├── KeysStorage.cpp │ ├── KeysStorage.h │ ├── WalletHelper.cpp │ ├── WalletHelper.h │ ├── WalletLegacy.cpp │ ├── WalletLegacy.h │ ├── WalletLegacyEvent.h │ ├── WalletLegacySerialization.cpp │ ├── WalletLegacySerialization.h │ ├── WalletLegacySerializer.cpp │ ├── WalletLegacySerializer.h │ ├── WalletRequest.h │ ├── WalletSendTransactionContext.h │ ├── WalletTransactionSender.cpp │ ├── WalletTransactionSender.h │ ├── WalletUnconfirmedTransactions.cpp │ ├── WalletUnconfirmedTransactions.h │ ├── WalletUserTransactionsCache.cpp │ ├── WalletUserTransactionsCache.h │ └── WalletUtils.h ├── crypto │ ├── aesb.h │ ├── blake256.c │ ├── blake256.h │ ├── chacha8.cpp │ ├── chacha8.h │ ├── crypto-ops-data.c │ ├── crypto-ops.c │ ├── crypto-ops.h │ ├── crypto-util.c │ ├── crypto-util.h │ ├── crypto.cpp │ ├── crypto.h │ ├── generic-ops.h │ ├── groestl.c │ ├── groestl.h │ ├── groestl_tables.h │ ├── hash-extra-blake.c │ ├── hash-extra-groestl.c │ ├── hash-extra-jh.c │ ├── hash-extra-skein.c │ ├── hash-ops.h │ ├── hash.c │ ├── hash.h │ ├── insecure_memzero.h │ ├── jh.c │ ├── jh.h │ ├── keccak.c │ ├── keccak.h │ ├── oaes_config.h │ ├── oaes_lib.c │ ├── oaes_lib.h │ ├── random.h │ ├── skein.c │ ├── skein.h │ ├── skein_port.h │ ├── slow-hash.c │ ├── slow-hash.cpp │ ├── sysendian.h │ ├── tree-hash.c │ ├── yespower.c │ └── yespower.h ├── pluracoin.ico ├── pluracoin.rc ├── version.cmake └── version.h.in ├── tests ├── CMakeLists.txt ├── CoreTests │ ├── AccountBoostSerialization.h │ ├── BlockReward.cpp │ ├── BlockReward.h │ ├── BlockValidation.cpp │ ├── BlockValidation.h │ ├── BoostSerializationHelper.h │ ├── ChainSplit1.cpp │ ├── ChainSplit1.h │ ├── ChainSwitch1.cpp │ ├── ChainSwitch1.h │ ├── Chaingen.cpp │ ├── Chaingen.h │ ├── Chaingen001.cpp │ ├── Chaingen001.h │ ├── ChaingenMain.cpp │ ├── CryptoNoteBoostSerialization.h │ ├── DoubleSpend.cpp │ ├── DoubleSpend.h │ ├── IntegerOverflow.cpp │ ├── IntegerOverflow.h │ ├── RandomOuts.cpp │ ├── RandomOuts.h │ ├── RingSignature.cpp │ ├── RingSignature.h │ ├── TestGenerator.h │ ├── TransactionBuilder.cpp │ ├── TransactionBuilder.h │ ├── TransactionTests.cpp │ ├── TransactionTests.h │ ├── TransactionValidation.cpp │ ├── TransactionValidation.h │ ├── UnorderedContainersBoostSerialization.h │ ├── Upgrade.cpp │ ├── Upgrade.h │ └── double_spend.inl ├── Data │ ├── account-002bee2f8e16f5de4db0d3b8ce9227c8c0b7f9688348b028e022cb43f210968b40a69cdc8531fd4a2e7c9e144eec48bb477733d70ce5f9b85338a07cb10b849ad8fb │ ├── account-007af2d7c5ffd8f69005debae820207820805e28c7d7a16714591143f56fb51e2b91ad0c1a535567e6292b321773df5e5aaace00fe767c4f09de452838575357ca9f │ ├── account-009b82d66dfaaba55a581913fa09d6c5bebe179cd73731781265c96e9e630dcd27fd5d20e7f1d0fa42619de9ca8fe4c0659f6959b2bebb15079cdaed07a442a78486 │ └── account-00aff84db50d6a54dd56051379f6c336fdd330d1cb11e7523bbf71f30b1ae760fa47ace8679b6486f79429980fd2331715a631f5729db284eb1fc6f108aeb7a7f4fe ├── Difficulty │ ├── Difficulty.cpp │ ├── data.txt │ └── generate-data ├── Hash │ ├── main.cpp │ ├── tests-extra-blake.txt │ ├── tests-extra-groestl.txt │ ├── tests-extra-jh.txt │ ├── tests-extra-skein.txt │ ├── tests-fast.txt │ ├── tests-slow.txt │ └── tests-tree.txt ├── HashTarget.cpp ├── IntegrationTestLib │ ├── BaseFunctionalTests.cpp │ ├── BaseFunctionalTests.h │ ├── InProcTestNode.cpp │ ├── InProcTestNode.h │ ├── Logger.cpp │ ├── Logger.h │ ├── NetworkConfiguration.h │ ├── NodeCallback.h │ ├── NodeObserver.h │ ├── ObservableValue.h │ ├── Process.cpp │ ├── Process.h │ ├── RPCTestNode.cpp │ ├── RPCTestNode.h │ ├── TestNetwork.cpp │ ├── TestNetwork.h │ ├── TestNode.h │ ├── TestWalletLegacy.cpp │ └── TestWalletLegacy.h ├── IntegrationTests │ ├── BaseTests.h │ ├── IntegrationTests.cpp │ ├── MultiVersion.cpp │ ├── Node.cpp │ ├── WalletLegacyObserver.h │ ├── WalletLegacyTests.cpp │ └── main.cpp ├── Io.h ├── NodeRpcProxyTests │ └── NodeRpcProxyTests.cpp ├── PerformanceTests │ ├── CheckRingSignature.h │ ├── ConstructTransaction.h │ ├── CryptoNoteSlowHash.h │ ├── DerivePublicKey.h │ ├── DeriveSecretKey.h │ ├── GenerateKeyDerivation.h │ ├── GenerateKeyImage.h │ ├── GenerateKeyImageHelper.h │ ├── IsOutToAccount.h │ ├── MultiTransactionTestBase.h │ ├── PerformanceTests.h │ ├── PerformanceUtils.h │ ├── SingleTransactionTestBase.h │ └── main.cpp ├── System │ ├── ContextGroupTests.cpp │ ├── ContextGroupTimeoutTests.cpp │ ├── ContextTests.cpp │ ├── DispatcherTests.cpp │ ├── ErrorMessageTests.cpp │ ├── EventLockTests.cpp │ ├── EventTests.cpp │ ├── Ipv4AddressTests.cpp │ ├── Ipv4ResolverTests.cpp │ ├── OperationTimeoutTests.cpp │ ├── RemoteContextTests.cpp │ ├── TcpConnectionTests.cpp │ ├── TcpConnectorTests.cpp │ ├── TcpListenerTests.cpp │ ├── TimerTests.cpp │ └── main.cpp ├── TestGenerator │ ├── TestGenerator.cpp │ └── TestGenerator.h ├── TransfersTests │ ├── Globals.h │ ├── TestNodeRpcProxy.cpp │ ├── TestTxPoolSync.cpp │ ├── Tests.cpp │ └── main.cpp ├── UnitTests │ ├── ArrayRefTests.cpp │ ├── ArrayViewTests.cpp │ ├── Base58.cpp │ ├── BinarySerializationCompatibility.cpp │ ├── BlockReward.cpp │ ├── BlockingQueue.cpp │ ├── Chacha8.cpp │ ├── Checkpoints.cpp │ ├── DecomposeAmountIntoDigits.cpp │ ├── EventWaiter.cpp │ ├── EventWaiter.h │ ├── ICoreStub.cpp │ ├── ICoreStub.h │ ├── ICryptoNoteProtocolQueryStub.cpp │ ├── ICryptoNoteProtocolQueryStub.h │ ├── INodeStubs.cpp │ ├── INodeStubs.h │ ├── MulDiv.cpp │ ├── ParseAmount.cpp │ ├── PaymentGateTests.cpp │ ├── Serialization.cpp │ ├── SerializationKV.cpp │ ├── Shuffle.cpp │ ├── StringBufferTests.cpp │ ├── StringViewTests.cpp │ ├── TestBcS.cpp │ ├── TestBlockchainExplorer.cpp │ ├── TestBlockchainGenerator.cpp │ ├── TestBlockchainGenerator.h │ ├── TestCurrency.cpp │ ├── TestFileMappedVector.cpp │ ├── TestFormatUtils.cpp │ ├── TestInprocessNode.cpp │ ├── TestJsonValue.cpp │ ├── TestMessageQueue.cpp │ ├── TestPath.cpp │ ├── TestPeerlist.cpp │ ├── TestProtocolPack.cpp │ ├── TestTransactionPoolDetach.cpp │ ├── TestTransfers.cpp │ ├── TestTransfersConsumer.cpp │ ├── TestTransfersContainer.cpp │ ├── TestTransfersContainerKeyImage.cpp │ ├── TestTransfersSubscription.cpp │ ├── TestUpgradeDetector.cpp │ ├── TestWallet.cpp │ ├── TestWalletLegacy.cpp │ ├── TestWalletService.cpp │ ├── TransactionApi.cpp │ ├── TransactionApiHelpers.cpp │ ├── TransactionApiHelpers.h │ ├── TransactionPool.cpp │ ├── TransfersObserver.h │ ├── UnitTestsUtils.h │ └── main.cpp ├── crypto │ ├── crypto-ops-data.c │ ├── crypto-ops.c │ ├── crypto-tests.h │ ├── crypto.cpp │ ├── hash.c │ ├── main.cpp │ ├── random.c │ └── tests.txt ├── cryptolib.pl └── cryptotest.pl └── utils ├── munin_plugins ├── alt_blocks_count ├── difficulty ├── grey_peerlist_size ├── height ├── incoming_connections_count ├── outgoing_connections_count ├── tx_count ├── tx_pool_size └── white_peerlist_size ├── plura-control-shell ├── pluracoind.sh └── pluracoins.sh ├── systemd └── pluracoind.service └── test-static-assert.c /CTestCustom.cmake: -------------------------------------------------------------------------------- 1 | set(CTEST_CUSTOM_TESTS_IGNORE 2 | CoreTests 3 | IntegrationTestLibrary 4 | TestGenerator 5 | CryptoTests 6 | IntegrationTests 7 | NodeRpcProxyTests 8 | PerformanceTests 9 | TransfersTests 10 | ) 11 | 12 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:16.04 2 | 3 | RUN apt-get update && \ 4 | apt-get --no-install-recommends --yes install \ 5 | git \ 6 | automake \ 7 | build-essential \ 8 | libtool \ 9 | cmake \ 10 | autotools-dev \ 11 | autoconf \ 12 | pkg-config \ 13 | libssl-dev \ 14 | libboost-all-dev \ 15 | libevent-dev \ 16 | bsdmainutils \ 17 | vim \ 18 | software-properties-common 19 | 20 | RUN add-apt-repository ppa:bitcoin/bitcoin && \ 21 | apt-get update && \ 22 | apt-get --no-install-recommends --yes install \ 23 | libdb4.8-dev \ 24 | libdb4.8++-dev \ 25 | libminiupnpc-dev 26 | 27 | WORKDIR /pluracoin 28 | 29 | ENV PLURACOIN_VERSION 1.5.0 30 | 31 | RUN git clone https://github.com/pluracoin/PluraCoin.git . && \ 32 | git checkout $PLURACOIN_VERSION && \ 33 | make 34 | 35 | VOLUME ["/root/.pluracoin"] 36 | 37 | EXPOSE 19200 38 | 39 | ENTRYPOINT ["/pluracoin/build/release/src/./pluracoind"] 40 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | all: all-release 2 | 3 | cmake-debug: 4 | mkdir -p build/debug 5 | cd build/debug && cmake -D CMAKE_BUILD_TYPE=Debug ../.. 6 | 7 | build-debug: cmake-debug 8 | cd build/debug && $(MAKE) 9 | 10 | test-debug: build-debug 11 | cd build/debug && $(MAKE) test 12 | 13 | all-debug: build-debug 14 | 15 | cmake-release: 16 | mkdir -p build/release 17 | cd build/release && cmake -D CMAKE_BUILD_TYPE=Release ../.. 18 | 19 | build-release: cmake-release 20 | cd build/release && $(MAKE) 21 | 22 | test-release: build-release 23 | cd build/release && $(MAKE) test 24 | 25 | all-release: build-release 26 | 27 | clean: 28 | rm -rf build 29 | 30 | tags: 31 | ctags -R --sort=1 --c++-kinds=+p --fields=+iaS --extra=+q --language-force=C++ src contrib tests/gtest 32 | 33 | .PHONY: all cmake-debug build-debug test-debug all-debug cmake-release build-release test-release all-release clean tags 34 | -------------------------------------------------------------------------------- /cmake/Doxygen.extra.css.in: -------------------------------------------------------------------------------- 1 | /* increase vertical space */ 2 | #titlearea, #nav-path { 3 | display: none; 4 | height: 0px; 5 | } 6 | 7 | 8 | /* uncomment these lines for some extra vertical space */ 9 | 10 | /* 11 | .tablist li { 12 | line-height: 26px; 13 | } 14 | */ 15 | -------------------------------------------------------------------------------- /external/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(UPNPC_BUILD_STATIC ON CACHE BOOL "Build static library") 2 | set(UPNPC_BUILD_SHARED OFF CACHE BOOL "Build shared library") 3 | set(UPNPC_BUILD_TESTS OFF CACHE BOOL "Build test executables") 4 | 5 | if (STATIC AND MSVC) 6 | foreach(VAR CMAKE_C_FLAGS_RELEASE) 7 | string(REPLACE "/MD" "" ${VAR} "${${VAR}}") 8 | endforeach() 9 | endif() 10 | 11 | add_subdirectory(miniupnpc) 12 | add_subdirectory(gtest) 13 | 14 | set_property(TARGET upnpc-static gtest gtest_main PROPERTY FOLDER "external") 15 | 16 | if(MSVC) 17 | if (STATIC) 18 | set (UPNPC_FLAGS "/MT") 19 | endif() 20 | set_property(TARGET upnpc-static APPEND_STRING PROPERTY COMPILE_FLAGS " -wd4244 -wd4267 -wd4996 ${UPNPC_FLAGS}") 21 | elseif(FREEBSD) 22 | set_property(TARGET upnpc-static APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-undef -Wno-unused-result -Wno-unused-value") 23 | else() 24 | set_property(TARGET upnpc-static APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-undef -Wno-unused-result -Wno-unused-value") 25 | endif() 26 | -------------------------------------------------------------------------------- /external/boost1_65_1/libs/filesystem/src/operations.patch: -------------------------------------------------------------------------------- 1 | --- C:/Projects/3dParty/boost_1_65_1/libs/filesystem/src/operations.cpp.bak Sun Dec 24 19:42:59 2017 2 | +++ C:/Projects/3dParty/boost_1_65_1/libs/filesystem/src/operations.cpp Sun Dec 24 19:43:34 2017 3 | @@ -10,6 +10,7 @@ 4 | 5 | //--------------------------------------------------------------------------------------// 6 | 7 | +#if !(defined(__ANDROID__) && __ANDROID_API__ <= 21) 8 | // define 64-bit offset macros BEFORE including boost/config.hpp (see ticket #5355) 9 | #if !(defined(__HP_aCC) && defined(_ILP32) && !defined(_STATVFS_ACPP_PROBLEMS_FIXED)) 10 | #define _FILE_OFFSET_BITS 64 // at worst, these defines may have no effect, 11 | @@ -27,6 +28,7 @@ 12 | // systems as well. 13 | #else 14 | #define _FILE_OFFSET_BITS 64 15 | +#endif 16 | #endif 17 | 18 | // define BOOST_FILESYSTEM_SOURCE so that knows 19 | -------------------------------------------------------------------------------- /external/gtest/cmake/gtest.pc.in: -------------------------------------------------------------------------------- 1 | libdir=@CMAKE_INSTALL_FULL_LIBDIR@ 2 | includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ 3 | 4 | Name: gtest 5 | Description: GoogleTest (without main() function) 6 | Version: @PROJECT_VERSION@ 7 | URL: https://github.com/google/googletest 8 | Libs: -L${libdir} -lgtest @CMAKE_THREAD_LIBS_INIT@ 9 | Cflags: -I${includedir} @GTEST_HAS_PTHREAD_MACRO@ @CMAKE_THREAD_LIBS_INIT@ 10 | -------------------------------------------------------------------------------- /external/gtest/cmake/gtest_main.pc.in: -------------------------------------------------------------------------------- 1 | libdir=@CMAKE_INSTALL_FULL_LIBDIR@ 2 | includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ 3 | 4 | Name: gtest_main 5 | Description: GoogleTest (with main() function) 6 | Version: @PROJECT_VERSION@ 7 | URL: https://github.com/google/googletest 8 | Requires: gtest 9 | Libs: -L${libdir} -lgtest_main @CMAKE_THREAD_LIBS_INIT@ 10 | Cflags: -I${includedir} @GTEST_HAS_PTHREAD_MACRO@ @CMAKE_THREAD_LIBS_INIT@ 11 | -------------------------------------------------------------------------------- /external/gtest/docs/samples.md: -------------------------------------------------------------------------------- 1 | # Googletest Samples {#samples} 2 | 3 | If you're like us, you'd like to look at [googletest 4 | samples.](https://github.com/google/googletest/tree/master/googletest/samples) 5 | The sample directory has a number of well-commented samples showing how to use a 6 | variety of googletest features. 7 | 8 | * Sample #1 shows the basic steps of using googletest to test C++ functions. 9 | * Sample #2 shows a more complex unit test for a class with multiple member 10 | functions. 11 | * Sample #3 uses a test fixture. 12 | * Sample #4 teaches you how to use googletest and `googletest.h` together to 13 | get the best of both libraries. 14 | * Sample #5 puts shared testing logic in a base test fixture, and reuses it in 15 | derived fixtures. 16 | * Sample #6 demonstrates type-parameterized tests. 17 | * Sample #7 teaches the basics of value-parameterized tests. 18 | * Sample #8 shows using `Combine()` in value-parameterized tests. 19 | * Sample #9 shows use of the listener API to modify Google Test's console 20 | output and the use of its reflection API to inspect test results. 21 | * Sample #10 shows use of the listener API to implement a primitive memory 22 | leak checker. 23 | -------------------------------------------------------------------------------- /external/gtest/msvc/2010/gtest-md.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | 14 | 15 | Source Files 16 | 17 | 18 | -------------------------------------------------------------------------------- /external/gtest/msvc/2010/gtest.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | 14 | 15 | Source Files 16 | 17 | 18 | -------------------------------------------------------------------------------- /external/gtest/msvc/2010/gtest_main-md.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | 14 | 15 | Source Files 16 | 17 | 18 | -------------------------------------------------------------------------------- /external/gtest/msvc/2010/gtest_main.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | 14 | 15 | Source Files 16 | 17 | 18 | -------------------------------------------------------------------------------- /external/gtest/msvc/2010/gtest_prod_test-md.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | 14 | 15 | Source Files 16 | 17 | 18 | Source Files 19 | 20 | 21 | 22 | 23 | Header Files 24 | 25 | 26 | -------------------------------------------------------------------------------- /external/gtest/msvc/2010/gtest_prod_test.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | 14 | 15 | Source Files 16 | 17 | 18 | Source Files 19 | 20 | 21 | 22 | 23 | Header Files 24 | 25 | 26 | -------------------------------------------------------------------------------- /external/gtest/msvc/2010/gtest_unittest-md.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | 14 | 15 | Source Files 16 | 17 | 18 | -------------------------------------------------------------------------------- /external/gtest/msvc/2010/gtest_unittest.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | 14 | 15 | Source Files 16 | 17 | 18 | -------------------------------------------------------------------------------- /external/gtest/xcode/Config/DebugProject.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // DebugProject.xcconfig 3 | // 4 | // These are Debug Configuration project settings for the gtest framework and 5 | // examples. It is set in the "Based On:" dropdown in the "Project" info 6 | // dialog. 7 | // This file is based on the Xcode Configuration files in: 8 | // http://code.google.com/p/google-toolbox-for-mac/ 9 | // 10 | 11 | #include "General.xcconfig" 12 | 13 | // No optimization 14 | GCC_OPTIMIZATION_LEVEL = 0 15 | 16 | // Deployment postprocessing is what triggers Xcode to strip, turn it off 17 | DEPLOYMENT_POSTPROCESSING = NO 18 | 19 | // Dead code stripping off 20 | DEAD_CODE_STRIPPING = NO 21 | 22 | // Debug symbols should be on obviously 23 | GCC_GENERATE_DEBUGGING_SYMBOLS = YES 24 | 25 | // Define the DEBUG macro in all debug builds 26 | OTHER_CFLAGS = $(OTHER_CFLAGS) -DDEBUG=1 27 | 28 | // These are turned off to avoid STL incompatibilities with client code 29 | // // Turns on special C++ STL checks to "encourage" good STL use 30 | // GCC_PREPROCESSOR_DEFINITIONS = $(GCC_PREPROCESSOR_DEFINITIONS) _GLIBCXX_DEBUG_PEDANTIC _GLIBCXX_DEBUG _GLIBCPP_CONCEPT_CHECKS 31 | -------------------------------------------------------------------------------- /external/gtest/xcode/Config/FrameworkTarget.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // FrameworkTarget.xcconfig 3 | // 4 | // These are Framework target settings for the gtest framework and examples. It 5 | // is set in the "Based On:" dropdown in the "Target" info dialog. 6 | // This file is based on the Xcode Configuration files in: 7 | // http://code.google.com/p/google-toolbox-for-mac/ 8 | // 9 | 10 | // Dynamic libs need to be position independent 11 | GCC_DYNAMIC_NO_PIC = NO 12 | 13 | // Dynamic libs should not have their external symbols stripped. 14 | STRIP_STYLE = non-global 15 | 16 | // Let the user install by specifying the $DSTROOT with xcodebuild 17 | SKIP_INSTALL = NO 18 | -------------------------------------------------------------------------------- /external/gtest/xcode/Config/General.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // General.xcconfig 3 | // 4 | // These are General configuration settings for the gtest framework and 5 | // examples. 6 | // This file is based on the Xcode Configuration files in: 7 | // http://code.google.com/p/google-toolbox-for-mac/ 8 | // 9 | 10 | // Build for PPC and Intel, 32- and 64-bit 11 | ARCHS = i386 x86_64 ppc ppc64 12 | 13 | // Zerolink prevents link warnings so turn it off 14 | ZERO_LINK = NO 15 | 16 | // Prebinding considered unhelpful in 10.3 and later 17 | PREBINDING = NO 18 | 19 | // Strictest warning policy 20 | WARNING_CFLAGS = -Wall -Werror -Wendif-labels -Wnewline-eof -Wno-sign-compare -Wshadow 21 | 22 | // Work around Xcode bugs by using external strip. See: 23 | // http://lists.apple.com/archives/Xcode-users/2006/Feb/msg00050.html 24 | SEPARATE_STRIP = YES 25 | 26 | // Force C99 dialect 27 | GCC_C_LANGUAGE_STANDARD = c99 28 | 29 | // not sure why apple defaults this on, but it's pretty risky 30 | ALWAYS_SEARCH_USER_PATHS = NO 31 | 32 | // Turn on position dependent code for most cases (overridden where appropriate) 33 | GCC_DYNAMIC_NO_PIC = YES 34 | 35 | // Default SDK and minimum OS version is 10.4 36 | SDKROOT = $(DEVELOPER_SDK_DIR)/MacOSX10.4u.sdk 37 | MACOSX_DEPLOYMENT_TARGET = 10.4 38 | GCC_VERSION = 4.0 39 | 40 | // VERSIONING BUILD SETTINGS (used in Info.plist) 41 | GTEST_VERSIONINFO_ABOUT = © 2008 Google Inc. 42 | -------------------------------------------------------------------------------- /external/gtest/xcode/Config/ReleaseProject.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // ReleaseProject.xcconfig 3 | // 4 | // These are Release Configuration project settings for the gtest framework 5 | // and examples. It is set in the "Based On:" dropdown in the "Project" info 6 | // dialog. 7 | // This file is based on the Xcode Configuration files in: 8 | // http://code.google.com/p/google-toolbox-for-mac/ 9 | // 10 | 11 | #include "General.xcconfig" 12 | 13 | // subconfig/Release.xcconfig 14 | 15 | // Optimize for space and size (Apple recommendation) 16 | GCC_OPTIMIZATION_LEVEL = s 17 | 18 | // Deploment postprocessing is what triggers Xcode to strip 19 | DEPLOYMENT_POSTPROCESSING = YES 20 | 21 | // No symbols 22 | GCC_GENERATE_DEBUGGING_SYMBOLS = NO 23 | 24 | // Dead code strip does not affect ObjC code but can help for C 25 | DEAD_CODE_STRIPPING = YES 26 | 27 | // NDEBUG is used by things like assert.h, so define it for general compat. 28 | // ASSERT going away in release tends to create unused vars. 29 | OTHER_CFLAGS = $(OTHER_CFLAGS) -DNDEBUG=1 -Wno-unused-variable 30 | 31 | // When we strip we want to strip all symbols in release, but save externals. 32 | STRIP_STYLE = all 33 | -------------------------------------------------------------------------------- /external/gtest/xcode/Config/StaticLibraryTarget.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // StaticLibraryTarget.xcconfig 3 | // 4 | // These are static library target settings for libgtest.a. It 5 | // is set in the "Based On:" dropdown in the "Target" info dialog. 6 | // This file is based on the Xcode Configuration files in: 7 | // http://code.google.com/p/google-toolbox-for-mac/ 8 | // 9 | 10 | // Static libs can be included in bundles so make them position independent 11 | GCC_DYNAMIC_NO_PIC = NO 12 | 13 | // Static libs should not have their internal globals or external symbols 14 | // stripped. 15 | STRIP_STYLE = debugging 16 | 17 | // Let the user install by specifying the $DSTROOT with xcodebuild 18 | SKIP_INSTALL = NO 19 | -------------------------------------------------------------------------------- /external/gtest/xcode/Config/TestTarget.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // TestTarget.xcconfig 3 | // 4 | // These are Test target settings for the gtest framework and examples. It 5 | // is set in the "Based On:" dropdown in the "Target" info dialog. 6 | 7 | PRODUCT_NAME = $(TARGET_NAME) 8 | HEADER_SEARCH_PATHS = ../include 9 | -------------------------------------------------------------------------------- /external/gtest/xcode/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | com.google.${PRODUCT_NAME} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | GTEST_VERSIONINFO_LONG 21 | CFBundleShortVersionString 22 | GTEST_VERSIONINFO_SHORT 23 | CFBundleGetInfoString 24 | ${PRODUCT_NAME} GTEST_VERSIONINFO_LONG, ${GTEST_VERSIONINFO_ABOUT} 25 | NSHumanReadableCopyright 26 | ${GTEST_VERSIONINFO_ABOUT} 27 | CSResourcesFileMapped 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /external/gtest/xcode/Samples/FrameworkSample/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | com.google.gtest.${PRODUCT_NAME:identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | CSResourcesFileMapped 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /external/miniupnpc/MANIFEST.in: -------------------------------------------------------------------------------- 1 | include README 2 | include VERSION 3 | include LICENSE 4 | include miniupnpcmodule.c 5 | include setup.py 6 | include Makefile 7 | include *.[ch] 8 | include *.h.in 9 | include *.sh 10 | -------------------------------------------------------------------------------- /external/miniupnpc/VERSION: -------------------------------------------------------------------------------- 1 | 2.1 2 | -------------------------------------------------------------------------------- /external/miniupnpc/connecthostport.h: -------------------------------------------------------------------------------- 1 | /* $Id: connecthostport.h,v 1.2 2012/06/23 22:32:33 nanard Exp $ */ 2 | /* Project: miniupnp 3 | * http://miniupnp.free.fr/ 4 | * Author: Thomas Bernard 5 | * Copyright (c) 2010-2018 Thomas Bernard 6 | * This software is subjects to the conditions detailed 7 | * in the LICENCE file provided within this distribution */ 8 | #ifndef CONNECTHOSTPORT_H_INCLUDED 9 | #define CONNECTHOSTPORT_H_INCLUDED 10 | 11 | #include "miniupnpc_socketdef.h" 12 | 13 | /* connecthostport() 14 | * return a socket connected (TCP) to the host and port 15 | * or INVALID_SOCKET in case of error */ 16 | SOCKET connecthostport(const char * host, unsigned short port, 17 | unsigned int scope_id); 18 | 19 | #endif 20 | 21 | -------------------------------------------------------------------------------- /external/miniupnpc/external-ip.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $Id: external-ip.sh,v 1.1 2010/08/05 12:57:41 nanard Exp $ 3 | # (c) 2010 Reuben Hawkins 4 | upnpc -s | sed -n -e 's/^ExternalIPAddress = \([0-9.]*\)$/\1/p' 5 | -------------------------------------------------------------------------------- /external/miniupnpc/java/testjava.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | set JAVA=java 3 | set JAVAC=javac 4 | REM notice the semicolon for Windows. Write once, run ... oh nevermind 5 | set CP=miniupnpc_win32.jar;. 6 | 7 | %JAVAC% -cp "%CP%" JavaBridgeTest.java || exit 1 8 | %JAVA% -cp "%CP%" JavaBridgeTest 12345 UDP || exit 1 9 | -------------------------------------------------------------------------------- /external/miniupnpc/java/testjava.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | JAVA=java 4 | JAVAC=javac 5 | CP=$(for i in *.jar; do echo -n $i:; done). 6 | 7 | $JAVAC -cp $CP JavaBridgeTest.java || exit 1 8 | $JAVA -cp $CP JavaBridgeTest 12345 UDP || exit 1 9 | -------------------------------------------------------------------------------- /external/miniupnpc/mingw32make.bat: -------------------------------------------------------------------------------- 1 | @mingw32-make -f Makefile.mingw %1 2 | @if errorlevel 1 goto end 3 | @if not exist upnpc-static.exe goto end 4 | @strip upnpc-static.exe 5 | @upx --best upnpc-static.exe 6 | @strip upnpc-shared.exe 7 | @upx --best upnpc-shared.exe 8 | :end 9 | -------------------------------------------------------------------------------- /external/miniupnpc/minisoap.h: -------------------------------------------------------------------------------- 1 | /* $Id: minisoap.h,v 1.4 2010/04/12 20:39:41 nanard Exp $ */ 2 | /* Project : miniupnp 3 | * Author : Thomas Bernard 4 | * Copyright (c) 2005-2018 Thomas Bernard 5 | * This software is subject to the conditions detailed in the 6 | * LICENCE file provided in this distribution. */ 7 | #ifndef MINISOAP_H_INCLUDED 8 | #define MINISOAP_H_INCLUDED 9 | 10 | #include "miniupnpc_socketdef.h" 11 | 12 | /*int httpWrite(int, const char *, int, const char *);*/ 13 | int soapPostSubmit(SOCKET, const char *, const char *, unsigned short, 14 | const char *, const char *, const char *); 15 | 16 | #endif 17 | 18 | -------------------------------------------------------------------------------- /external/miniupnpc/miniupnpc.def: -------------------------------------------------------------------------------- 1 | LIBRARY 2 | ; miniupnpc library 3 | miniupnpc 4 | 5 | EXPORTS 6 | ; miniupnpc 7 | upnpDiscover 8 | freeUPNPDevlist 9 | parserootdesc 10 | UPNP_GetValidIGD 11 | UPNP_GetIGDFromUrl 12 | GetUPNPUrls 13 | FreeUPNPUrls 14 | ; miniwget 15 | miniwget 16 | miniwget_getaddr 17 | ; upnpcommands 18 | UPNP_GetTotalBytesSent 19 | UPNP_GetTotalBytesReceived 20 | UPNP_GetTotalPacketsSent 21 | UPNP_GetTotalPacketsReceived 22 | UPNP_GetStatusInfo 23 | UPNP_GetConnectionTypeInfo 24 | UPNP_GetExternalIPAddress 25 | UPNP_GetLinkLayerMaxBitRates 26 | UPNP_AddPortMapping 27 | UPNP_AddAnyPortMapping 28 | UPNP_DeletePortMapping 29 | UPNP_DeletePortMappingRange 30 | UPNP_GetPortMappingNumberOfEntries 31 | UPNP_GetSpecificPortMappingEntry 32 | UPNP_GetGenericPortMappingEntry 33 | UPNP_GetListOfPortMappings 34 | UPNP_AddPinhole 35 | UPNP_CheckPinholeWorking 36 | UPNP_UpdatePinhole 37 | UPNP_GetPinholePackets 38 | UPNP_DeletePinhole 39 | UPNP_GetFirewallStatus 40 | UPNP_GetOutboundPinholeTimeout 41 | ; upnperrors 42 | strupnperror 43 | ; portlistingparse 44 | ParsePortListing 45 | FreePortListing 46 | -------------------------------------------------------------------------------- /external/miniupnpc/miniupnpc_declspec.h: -------------------------------------------------------------------------------- 1 | #ifndef MINIUPNPC_DECLSPEC_H_INCLUDED 2 | #define MINIUPNPC_DECLSPEC_H_INCLUDED 3 | 4 | #if defined(_WIN32) && !defined(MINIUPNP_STATICLIB) 5 | /* for windows dll */ 6 | #ifdef MINIUPNP_EXPORTS 7 | #define MINIUPNP_LIBSPEC __declspec(dllexport) 8 | #else 9 | #define MINIUPNP_LIBSPEC __declspec(dllimport) 10 | #endif 11 | #else 12 | #if defined(__GNUC__) && __GNUC__ >= 4 13 | /* fix dynlib for OS X 10.9.2 and Apple LLVM version 5.0 */ 14 | #define MINIUPNP_LIBSPEC __attribute__ ((visibility ("default"))) 15 | #else 16 | #define MINIUPNP_LIBSPEC 17 | #endif 18 | #endif 19 | 20 | #endif /* MINIUPNPC_DECLSPEC_H_INCLUDED */ 21 | 22 | -------------------------------------------------------------------------------- /external/miniupnpc/miniupnpc_socketdef.h: -------------------------------------------------------------------------------- 1 | /* $Id: miniupnpc_socketdef.h,v 1.1 2018/03/13 23:44:10 nanard Exp $ */ 2 | /* Miniupnp project : http://miniupnp.free.fr/ or https://miniupnp.tuxfamily.org/ 3 | * Author : Thomas Bernard 4 | * Copyright (c) 2018 Thomas Bernard 5 | * This software is subject to the conditions detailed in the 6 | * LICENCE file provided within this distribution */ 7 | #ifndef MINIUPNPC_SOCKETDEF_H_INCLUDED 8 | #define MINIUPNPC_SOCKETDEF_H_INCLUDED 9 | 10 | #ifdef _MSC_VER 11 | 12 | #define ISINVALID(s) (INVALID_SOCKET==(s)) 13 | 14 | #else 15 | 16 | #ifndef SOCKET 17 | #define SOCKET int 18 | #endif 19 | #ifndef SSIZE_T 20 | #define SSIZE_T ssize_t 21 | #endif 22 | #ifndef INVALID_SOCKET 23 | #define INVALID_SOCKET (-1) 24 | #endif 25 | #ifndef ISINVALID 26 | #define ISINVALID(s) ((s)<0) 27 | #endif 28 | 29 | #endif 30 | 31 | #ifdef _WIN32 32 | #define PRINT_SOCKET_ERROR(x) fprintf(stderr, "Socket error: %s, %d\n", x, WSAGetLastError()); 33 | #else 34 | #define PRINT_SOCKET_ERROR(x) perror(x) 35 | #endif 36 | 37 | #endif /* MINIUPNPC_SOCKETDEF_H_INCLUDED */ 38 | -------------------------------------------------------------------------------- /external/miniupnpc/miniupnpcstrings.h.cmake: -------------------------------------------------------------------------------- 1 | #ifndef MINIUPNPCSTRINGS_H_INCLUDED 2 | #define MINIUPNPCSTRINGS_H_INCLUDED 3 | 4 | #define OS_STRING "${CMAKE_SYSTEM_NAME}" 5 | #define MINIUPNPC_VERSION_STRING "${MINIUPNPC_VERSION}" 6 | 7 | #if 0 8 | /* according to "UPnP Device Architecture 1.0" */ 9 | #define UPNP_VERSION_STRING "UPnP/1.0" 10 | #else 11 | /* according to "UPnP Device Architecture 1.1" */ 12 | #define UPNP_VERSION_STRING "UPnP/1.1" 13 | #endif 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /external/miniupnpc/miniupnpcstrings.h.in: -------------------------------------------------------------------------------- 1 | /* $Id: miniupnpcstrings.h.in,v 1.6 2014/11/04 22:31:55 nanard Exp $ */ 2 | /* Project: miniupnp 3 | * http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/ 4 | * Author: Thomas Bernard 5 | * Copyright (c) 2005-2014 Thomas Bernard 6 | * This software is subjects to the conditions detailed 7 | * in the LICENCE file provided within this distribution */ 8 | #ifndef MINIUPNPCSTRINGS_H_INCLUDED 9 | #define MINIUPNPCSTRINGS_H_INCLUDED 10 | 11 | #define OS_STRING "OS/version" 12 | #define MINIUPNPC_VERSION_STRING "version" 13 | 14 | #if 0 15 | /* according to "UPnP Device Architecture 1.0" */ 16 | #define UPNP_VERSION_STRING "UPnP/1.0" 17 | #else 18 | /* according to "UPnP Device Architecture 1.1" */ 19 | #define UPNP_VERSION_STRING "UPnP/1.1" 20 | #endif 21 | 22 | #endif 23 | 24 | -------------------------------------------------------------------------------- /external/miniupnpc/miniupnpctypes.h: -------------------------------------------------------------------------------- 1 | /* $Id: miniupnpctypes.h,v 1.1 2011/02/15 11:10:40 nanard Exp $ */ 2 | /* Miniupnp project : http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org 3 | * Author : Thomas Bernard 4 | * Copyright (c) 2011 Thomas Bernard 5 | * This software is subject to the conditions detailed in the 6 | * LICENCE file provided within this distribution */ 7 | #ifndef MINIUPNPCTYPES_H_INCLUDED 8 | #define MINIUPNPCTYPES_H_INCLUDED 9 | 10 | #if (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L) 11 | #define UNSIGNED_INTEGER unsigned long long 12 | #define STRTOUI strtoull 13 | #else 14 | #define UNSIGNED_INTEGER unsigned int 15 | #define STRTOUI strtoul 16 | #endif 17 | 18 | #endif 19 | 20 | -------------------------------------------------------------------------------- /external/miniupnpc/miniwget.h: -------------------------------------------------------------------------------- 1 | /* $Id: miniwget.h,v 1.12 2016/01/24 17:24:36 nanard Exp $ */ 2 | /* Project : miniupnp 3 | * Author : Thomas Bernard 4 | * Copyright (c) 2005-2016 Thomas Bernard 5 | * This software is subject to the conditions detailed in the 6 | * LICENCE file provided in this distribution. 7 | * */ 8 | #ifndef MINIWGET_H_INCLUDED 9 | #define MINIWGET_H_INCLUDED 10 | 11 | #include "miniupnpc_declspec.h" 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | MINIUPNP_LIBSPEC void * miniwget(const char *, int *, unsigned int, int *); 18 | 19 | MINIUPNP_LIBSPEC void * miniwget_getaddr(const char *, int *, char *, int, unsigned int, int *); 20 | 21 | int parseURL(const char *, char *, unsigned short *, char * *, unsigned int *); 22 | 23 | #ifdef __cplusplus 24 | } 25 | #endif 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /external/miniupnpc/miniwget_private.h: -------------------------------------------------------------------------------- 1 | /* $Id: miniwget_private.h,v 1.1 2018/04/06 10:17:58 nanard Exp $ */ 2 | /* Project : miniupnp 3 | * Author : Thomas Bernard 4 | * Copyright (c) 2018 Thomas Bernard 5 | * This software is subject to the conditions detailed in the 6 | * LICENCE file provided in this distribution. 7 | * */ 8 | #ifndef MINIWGET_INTERNAL_H_INCLUDED 9 | #define MINIWGET_INTERNAL_H_INCLUDED 10 | 11 | #include "miniupnpc_socketdef.h" 12 | 13 | void * getHTTPResponse(SOCKET s, int * size, int * status_code); 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /external/miniupnpc/minixml.h: -------------------------------------------------------------------------------- 1 | /* $Id: minixml.h,v 1.6 2006/11/30 11:47:21 nanard Exp $ */ 2 | /* minimal xml parser 3 | * 4 | * Project : miniupnp 5 | * Website : http://miniupnp.free.fr/ 6 | * Author : Thomas Bernard 7 | * Copyright (c) 2005 Thomas Bernard 8 | * This software is subject to the conditions detailed in the 9 | * LICENCE file provided in this distribution. 10 | * */ 11 | #ifndef MINIXML_H_INCLUDED 12 | #define MINIXML_H_INCLUDED 13 | #define IS_WHITE_SPACE(c) ((c==' ') || (c=='\t') || (c=='\r') || (c=='\n')) 14 | 15 | /* if a callback function pointer is set to NULL, 16 | * the function is not called */ 17 | struct xmlparser { 18 | const char *xmlstart; 19 | const char *xmlend; 20 | const char *xml; /* pointer to current character */ 21 | int xmlsize; 22 | void * data; 23 | void (*starteltfunc) (void *, const char *, int); 24 | void (*endeltfunc) (void *, const char *, int); 25 | void (*datafunc) (void *, const char *, int); 26 | void (*attfunc) (void *, const char *, int, const char *, int); 27 | }; 28 | 29 | /* parsexml() 30 | * the xmlparser structure must be initialized before the call 31 | * the following structure members have to be initialized : 32 | * xmlstart, xmlsize, data, *func 33 | * xml is for internal usage, xmlend is computed automatically */ 34 | void parsexml(struct xmlparser *); 35 | 36 | #endif 37 | 38 | -------------------------------------------------------------------------------- /external/miniupnpc/msvc/miniupnpc.vcproj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluracoin/PluraCoin/14c6d07df08292069863ac8a998dc4b73c433c2a/external/miniupnpc/msvc/miniupnpc.vcproj -------------------------------------------------------------------------------- /external/miniupnpc/msvc/upnpc-static.vcproj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluracoin/PluraCoin/14c6d07df08292069863ac8a998dc4b73c433c2a/external/miniupnpc/msvc/upnpc-static.vcproj -------------------------------------------------------------------------------- /external/miniupnpc/msvc/upnpc-static.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav 15 | 16 | 17 | 18 | 19 | Fichiers sources 20 | 21 | 22 | -------------------------------------------------------------------------------- /external/miniupnpc/receivedata.h: -------------------------------------------------------------------------------- 1 | /* $Id: receivedata.h,v 1.3 2012/06/23 22:34:47 nanard Exp $ */ 2 | /* Project: miniupnp 3 | * http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/ 4 | * Author: Thomas Bernard 5 | * Copyright (c) 2011-2018 Thomas Bernard 6 | * This software is subjects to the conditions detailed 7 | * in the LICENCE file provided within this distribution */ 8 | #ifndef RECEIVEDATA_H_INCLUDED 9 | #define RECEIVEDATA_H_INCLUDED 10 | 11 | #include "miniupnpc_socketdef.h" 12 | 13 | /* Reads data from the specified socket. 14 | * Returns the number of bytes read if successful, zero if no bytes were 15 | * read or if we timed out. Returns negative if there was an error. */ 16 | int receivedata(SOCKET socket, 17 | char * data, int length, 18 | int timeout, unsigned int * scope_id); 19 | 20 | #endif 21 | 22 | -------------------------------------------------------------------------------- /external/miniupnpc/setup.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/python 2 | # vim: tabstop=8 shiftwidth=8 expandtab 3 | # $Id: setup.py,v 1.9 2012/05/23 08:50:10 nanard Exp $ 4 | # the MiniUPnP Project (c) 2007-2017 Thomas Bernard 5 | # http://miniupnp.tuxfamily.org/ or http://miniupnp.free.fr/ 6 | # 7 | # python script to build the miniupnpc module under unix 8 | # 9 | # Uses MAKE environment variable (defaulting to 'make') 10 | 11 | from setuptools import setup, Extension 12 | from setuptools.command import build_ext 13 | import subprocess 14 | import os 15 | 16 | EXT = ['libminiupnpc.a'] 17 | 18 | class make_then_build_ext(build_ext.build_ext): 19 | def run(self): 20 | subprocess.check_call([os.environ.get('MAKE', 'make')] + EXT) 21 | build_ext.build_ext.run(self) 22 | 23 | setup(name="miniupnpc", 24 | version=open('VERSION').read().strip(), 25 | author='Thomas BERNARD', 26 | author_email='miniupnp@free.fr', 27 | license=open('LICENSE').read(), 28 | url='http://miniupnp.free.fr/', 29 | description='miniUPnP client', 30 | cmdclass={'build_ext': make_then_build_ext}, 31 | ext_modules=[ 32 | Extension(name="miniupnpc", sources=["miniupnpcmodule.c"], 33 | extra_objects=EXT) 34 | ]) 35 | 36 | -------------------------------------------------------------------------------- /external/miniupnpc/setupmingw32.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/python 2 | # vim: tabstop=8 shiftwidth=8 expandtab 3 | # $Id: setupmingw32.py,v 1.8 2012/05/23 08:50:10 nanard Exp $ 4 | # the MiniUPnP Project (c) 2007-2014 Thomas Bernard 5 | # http://miniupnp.tuxfamily.org/ or http://miniupnp.free.fr/ 6 | # 7 | # python script to build the miniupnpc module under windows (using mingw32) 8 | # 9 | try: 10 | from setuptools import setup, Extension 11 | except ImportError: 12 | from distutils.core import setup, Extension 13 | from distutils import sysconfig 14 | sysconfig.get_config_vars()["OPT"] = '' 15 | sysconfig.get_config_vars()["CFLAGS"] = '' 16 | setup(name="miniupnpc", 17 | version=open('VERSION').read().strip(), 18 | author='Thomas BERNARD', 19 | author_email='miniupnp@free.fr', 20 | license=open('LICENSE').read(), 21 | url='http://miniupnp.free.fr/', 22 | description='miniUPnP client', 23 | ext_modules=[ 24 | Extension(name="miniupnpc", sources=["miniupnpcmodule.c"], 25 | libraries=["ws2_32", "iphlpapi"], 26 | extra_objects=["libminiupnpc.a"]) 27 | ]) 28 | 29 | -------------------------------------------------------------------------------- /external/miniupnpc/testdesc/linksys_WAG200G_desc.values: -------------------------------------------------------------------------------- 1 | # values for linksys_WAG200G_desc.xml 2 | 3 | CIF: 4 | servicetype = urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1 5 | controlurl = /upnp/control/WANCommonIFC1 6 | eventsuburl = /upnp/event/WANCommonIFC1 7 | scpdurl = /cmnicfg.xml 8 | 9 | first: 10 | servicetype = urn:schemas-upnp-org:service:WANPPPConnection:1 11 | controlurl = /upnp/control/WANPPPConn1 12 | eventsuburl = /upnp/event/WANPPPConn1 13 | scpdurl = /pppcfg.xml 14 | 15 | -------------------------------------------------------------------------------- /external/miniupnpc/testdesc/new_LiveBox_desc.values: -------------------------------------------------------------------------------- 1 | # values for new_LiveBox_desc.xml 2 | 3 | CIF: 4 | servicetype = urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1 5 | controlurl = /87895a19/upnp/control/WANCommonIFC1 6 | eventsuburl = /87895a19/upnp/control/WANCommonIFC1 7 | scpdurl = /87895a19/gateicfgSCPD.xml 8 | 9 | first: 10 | servicetype = urn:schemas-upnp-org:service:WANPPPConnection:2 11 | controlurl = /87895a19/upnp/control/WANIPConn1 12 | eventsuburl = /87895a19/upnp/control/WANIPConn1 13 | scpdurl = /87895a19/gateconnSCPD_PPP.xml 14 | 15 | IPv6FC: 16 | servicetype = urn:schemas-upnp-org:service:WANIPv6FirewallControl:1 17 | controlurl = /87895a19/upnp/control/WANIPv6FwCtrl1 18 | eventsuburl = /87895a19/upnp/control/WANIPv6FwCtrl1 19 | scpdurl = /87895a19/wanipv6fwctrlSCPD.xml 20 | 21 | -------------------------------------------------------------------------------- /external/miniupnpc/testreplyparse/DeletePortMapping.namevalue: -------------------------------------------------------------------------------- 1 | NewRemoteHost= 2 | NewExternalPort=123 3 | NewProtocol=TCP 4 | -------------------------------------------------------------------------------- /external/miniupnpc/testreplyparse/DeletePortMapping.xml: -------------------------------------------------------------------------------- 1 | 2 | 123 3 | TCP 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /external/miniupnpc/testreplyparse/GetExternalIPAddress.namevalue: -------------------------------------------------------------------------------- 1 | NewExternalIPAddress=1.2.3.4 2 | 3 | -------------------------------------------------------------------------------- /external/miniupnpc/testreplyparse/GetExternalIPAddress.xml: -------------------------------------------------------------------------------- 1 | 1.2.3.4 2 | 3 | -------------------------------------------------------------------------------- /external/miniupnpc/testreplyparse/GetSpecificPortMappingEntryReq.namevalue: -------------------------------------------------------------------------------- 1 | NewProtocol=UDP 2 | NewExternalPort=12345 3 | NewRemoteHost= 4 | -------------------------------------------------------------------------------- /external/miniupnpc/testreplyparse/GetSpecificPortMappingEntryReq.xml: -------------------------------------------------------------------------------- 1 | 2 | 12345UDP 3 | 4 | -------------------------------------------------------------------------------- /external/miniupnpc/testreplyparse/GetSpecificPortMappingEntryResp.namevalue: -------------------------------------------------------------------------------- 1 | NewInternalPort=12345 2 | NewInternalClient=192.168.10.110 3 | NewEnabled=1 4 | NewPortMappingDescription=libminiupnpc 5 | NewLeaseDuration=0 6 | -------------------------------------------------------------------------------- /external/miniupnpc/testreplyparse/GetSpecificPortMappingEntryResp.xml: -------------------------------------------------------------------------------- 1 | 12345192.168.10.1101libminiupnpc0 2 | 3 | -------------------------------------------------------------------------------- /external/miniupnpc/testreplyparse/SetDefaultConnectionService.namevalue: -------------------------------------------------------------------------------- 1 | NewDefaultConnectionService=uuid:c6c05a33-f704-48df-9910-e099b3471d81:WANConnectionDevice:1,INVALID_SERVICE_ID 2 | -------------------------------------------------------------------------------- /external/miniupnpc/testreplyparse/SetDefaultConnectionService.xml: -------------------------------------------------------------------------------- 1 | uuid:c6c05a33-f704-48df-9910-e099b3471d81:WANConnectionDevice:1,INVALID_SERVICE_ID 2 | -------------------------------------------------------------------------------- /external/miniupnpc/testreplyparse/readme.txt: -------------------------------------------------------------------------------- 1 | This directory contains files used for validation of upnpreplyparse.c code. 2 | 3 | Each .xml file to parse should give the results which are in the .namevalue 4 | file. 5 | 6 | A .namevalue file contain name=value lines. 7 | 8 | -------------------------------------------------------------------------------- /external/miniupnpc/testupnpreplyparse.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | for f in testreplyparse/*.xml ; do 4 | bf="`dirname $f`/`basename $f .xml`" 5 | if ./testupnpreplyparse $f $bf.namevalue ; then 6 | echo "$f : passed" 7 | else 8 | echo "$f : FAILED" 9 | exit 1 10 | fi 11 | done 12 | 13 | exit 0 14 | 15 | -------------------------------------------------------------------------------- /external/miniupnpc/upnpdev.c: -------------------------------------------------------------------------------- 1 | /* $Id: upnpdev.c,v 1.1 2015/08/28 12:14:19 nanard Exp $ */ 2 | /* Project : miniupnp 3 | * Web : http://miniupnp.free.fr/ 4 | * Author : Thomas BERNARD 5 | * copyright (c) 2005-2015 Thomas Bernard 6 | * This software is subjet to the conditions detailed in the 7 | * provided LICENSE file. */ 8 | #include 9 | #include "upnpdev.h" 10 | 11 | /* freeUPNPDevlist() should be used to 12 | * free the chained list returned by upnpDiscover() */ 13 | void freeUPNPDevlist(struct UPNPDev * devlist) 14 | { 15 | struct UPNPDev * next; 16 | while(devlist) 17 | { 18 | next = devlist->pNext; 19 | free(devlist); 20 | devlist = next; 21 | } 22 | } 23 | 24 | -------------------------------------------------------------------------------- /external/miniupnpc/upnpdev.h: -------------------------------------------------------------------------------- 1 | /* $Id: upnpdev.h,v 1.1 2015/08/28 12:14:19 nanard Exp $ */ 2 | /* Project : miniupnp 3 | * Web : http://miniupnp.free.fr/ 4 | * Author : Thomas BERNARD 5 | * copyright (c) 2005-2018 Thomas Bernard 6 | * This software is subjet to the conditions detailed in the 7 | * provided LICENSE file. */ 8 | #ifndef UPNPDEV_H_INCLUDED 9 | #define UPNPDEV_H_INCLUDED 10 | 11 | #include "miniupnpc_declspec.h" 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | struct UPNPDev { 18 | struct UPNPDev * pNext; 19 | char * descURL; 20 | char * st; 21 | char * usn; 22 | unsigned int scope_id; 23 | char buffer[3]; 24 | }; 25 | 26 | /* freeUPNPDevlist() 27 | * free list returned by upnpDiscover() */ 28 | MINIUPNP_LIBSPEC void freeUPNPDevlist(struct UPNPDev * devlist); 29 | 30 | 31 | #ifdef __cplusplus 32 | } 33 | #endif 34 | 35 | 36 | #endif /* UPNPDEV_H_INCLUDED */ 37 | -------------------------------------------------------------------------------- /external/miniupnpc/upnperrors.h: -------------------------------------------------------------------------------- 1 | /* $Id: upnperrors.h,v 1.2 2008/07/02 23:31:15 nanard Exp $ */ 2 | /* (c) 2007-2015 Thomas Bernard 3 | * All rights reserved. 4 | * MiniUPnP Project. 5 | * http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/ 6 | * This software is subjet to the conditions detailed in the 7 | * provided LICENCE file. */ 8 | #ifndef UPNPERRORS_H_INCLUDED 9 | #define UPNPERRORS_H_INCLUDED 10 | 11 | #include "miniupnpc_declspec.h" 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | /* strupnperror() 18 | * Return a string description of the UPnP error code 19 | * or NULL for undefinded errors */ 20 | MINIUPNP_LIBSPEC const char * strupnperror(int err); 21 | 22 | #ifdef __cplusplus 23 | } 24 | #endif 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /include/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # list include header files in Visual Studio Solution Explorer 2 | 3 | file(GLOB_RECURSE IncludeHeaders "${CMAKE_SOURCE_DIR}/include/*.h*") 4 | add_custom_target(include SOURCES ${IncludeHeaders}) 5 | source_group("Public Headers" FILES ${IncludeHeaders}) -------------------------------------------------------------------------------- /include/IObservable.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Plura. 4 | // 5 | // Plura is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Plura is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Plura. If not, see . 17 | 18 | #pragma once 19 | 20 | namespace CryptoNote { 21 | 22 | template 23 | class IObservable { 24 | public: 25 | virtual void addObserver(T* observer) = 0; 26 | virtual void removeObserver(T* observer) = 0; 27 | }; 28 | 29 | } 30 | -------------------------------------------------------------------------------- /include/IStreamSerializable.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Plura. 4 | // 5 | // Plura is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Plura is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Plura. If not, see . 17 | 18 | #pragma once 19 | 20 | #include 21 | 22 | namespace CryptoNote { 23 | 24 | class IStreamSerializable { 25 | public: 26 | virtual void save(std::ostream& os) = 0; 27 | virtual void load(std::istream& in) = 0; 28 | }; 29 | 30 | } 31 | -------------------------------------------------------------------------------- /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 | 15 | template 16 | string to_string(T value) 17 | { 18 | std::ostringstream os; 19 | os << value; 20 | return os.str(); 21 | } 22 | 23 | /* 24 | inline unsigned long stoul (std::string const& str, size_t *idx = 0, int base = 10) 25 | { 26 | char *endp; 27 | unsigned long value = strtoul(str.c_str(), &endp, base); 28 | if (endp == str.c_str()) 29 | throw std::invalid_argument("my_stoul"); 30 | 31 | if (value == ULONG_MAX && errno == ERANGE) 32 | throw std::out_of_range("my_stoul"); 33 | 34 | if (idx) 35 | *idx = endp - str.c_str(); 36 | 37 | return value; 38 | } 39 | */ 40 | }// namespace std 41 | #endif 42 | -------------------------------------------------------------------------------- /src/BinaryInfo/daemon.rc: -------------------------------------------------------------------------------- 1 | #include 2 | #include "version.h" 3 | 4 | IDI_ICON1 ICON DISCARDABLE "icons/plura.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", "pluracoind.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/greenwallet.rc: -------------------------------------------------------------------------------- 1 | #include 2 | #include "version.h" 3 | 4 | IDI_ICON1 ICON DISCARDABLE "icons/plura.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 " GreenWallet " PROJECT_VERSION_LONG 25 | VALUE "FileVersion", PROJECT_VERSION_BUILD_NO 26 | VALUE "LegalCopyright", PROJECT_COPYRIGHT 27 | VALUE "OriginalFilename", "greenwallet.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/icons/plura.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluracoin/PluraCoin/14c6d07df08292069863ac8a998dc4b73c433c2a/src/BinaryInfo/icons/plura.ico -------------------------------------------------------------------------------- /src/BinaryInfo/miner.rc: -------------------------------------------------------------------------------- 1 | #include 2 | #include "version.h" 3 | 4 | IDI_ICON1 ICON DISCARDABLE "icons/plura.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 | -------------------------------------------------------------------------------- /src/BinaryInfo/optimizer.rc: -------------------------------------------------------------------------------- 1 | #include 2 | #include "version.h" 3 | 4 | IDI_ICON1 ICON DISCARDABLE "icons/plura.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/plura.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/BinaryInfo/vanitygen.rc: -------------------------------------------------------------------------------- 1 | #include 2 | #include "version.h" 3 | 4 | IDI_ICON1 ICON DISCARDABLE "icons/plura.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 " Address Generator " PROJECT_VERSION_LONG 25 | VALUE "FileVersion", PROJECT_VERSION_BUILD_NO 26 | VALUE "LegalCopyright", PROJECT_COPYRIGHT 27 | VALUE "OriginalFilename", "vanitygen.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/walletd.rc: -------------------------------------------------------------------------------- 1 | #include 2 | #include "version.h" 3 | 4 | IDI_ICON1 ICON DISCARDABLE "icons/plura.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 | -------------------------------------------------------------------------------- /src/BlockchainExplorer/BlockchainExplorerErrors.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Plura. 4 | // 5 | // Plura is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Plura is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Plura. If not, see . 17 | 18 | #include "BlockchainExplorerErrors.h" 19 | 20 | namespace CryptoNote { 21 | namespace error { 22 | 23 | BlockchainExplorerErrorCategory BlockchainExplorerErrorCategory::INSTANCE; 24 | 25 | } //namespace error 26 | } //namespace CryptoNote 27 | 28 | -------------------------------------------------------------------------------- /src/Common/Base58.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Plura. 4 | // 5 | // Plura is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Plura is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Plura. If not, see . 17 | 18 | #pragma once 19 | 20 | #include 21 | #include 22 | 23 | namespace Tools 24 | { 25 | namespace Base58 26 | { 27 | std::string encode(const std::string& data); 28 | bool decode(const std::string& enc, std::string& data); 29 | 30 | std::string encode_addr(uint64_t tag, const std::string& data); 31 | bool decode_addr(std::string addr, uint64_t& tag, std::string& data); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/Common/BinaryArray.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2018, The CryptoNote developers, The Bytecoin developers. 2 | // Licensed under the GNU Lesser General Public License. See LICENSE for details. 3 | 4 | #pragma once 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | using namespace CryptoNote; 12 | 13 | namespace Common { 14 | 15 | template 16 | inline BinaryArray::iterator append(BinaryArray &ba, It be, It en) { 17 | return ba.insert(ba.end(), be, en); 18 | } 19 | inline BinaryArray::iterator append(BinaryArray &ba, size_t add, BinaryArray::value_type va) { 20 | return ba.insert(ba.end(), add, va); 21 | } 22 | inline BinaryArray::iterator append(BinaryArray &ba, const BinaryArray &other) { 23 | return ba.insert(ba.end(), other.begin(), other.end()); 24 | } 25 | 26 | } // namespace Common -------------------------------------------------------------------------------- /src/Common/BlockingQueue.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Plura. 4 | // 5 | // Plura is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Plura is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Plura. If not, see . 17 | 18 | #include "BlockingQueue.h" 19 | 20 | namespace { 21 | #ifdef MSVC 22 | char suppressMSVCWarningLNK4221; 23 | #endif 24 | } 25 | -------------------------------------------------------------------------------- /src/Common/CommandLine.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Plura. 4 | // 5 | // Plura is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Plura is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Plura. If not, see . 17 | 18 | #include "CommandLine.h" 19 | 20 | namespace command_line 21 | { 22 | const arg_descriptor arg_help = {"help", "Produce help message"}; 23 | const arg_descriptor arg_version = {"version", "Output version information"}; 24 | const arg_descriptor arg_data_dir = {"data-dir", "Specify data directory"}; 25 | } 26 | -------------------------------------------------------------------------------- /src/Common/ConsoleTools.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Plura. 4 | // 5 | // Plura is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Plura is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Plura. If not, see . 17 | 18 | #pragma once 19 | 20 | #include 21 | 22 | namespace Common { namespace Console { 23 | 24 | enum class Color : uint8_t { 25 | Default, 26 | 27 | Blue, 28 | Green, 29 | Red, 30 | Yellow, 31 | White, 32 | Cyan, 33 | Magenta, 34 | 35 | BrightBlue, 36 | BrightGreen, 37 | BrightRed, 38 | BrightYellow, 39 | BrightWhite, 40 | BrightCyan, 41 | BrightMagenta 42 | }; 43 | 44 | void setTextColor(Color color); 45 | bool isConsoleTty(); 46 | 47 | }} 48 | -------------------------------------------------------------------------------- /src/Common/DnsTools.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2017-2018, Karbo developers 2 | // 3 | // This file is part of Karbo. 4 | // 5 | // Karbo is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Karbo is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Karbo. If not, see . 17 | 18 | #pragma once 19 | 20 | #include 21 | #include 22 | 23 | namespace Common { 24 | 25 | #ifndef __ANDROID__ 26 | 27 | bool fetch_dns_txt(const std::string domain, std::vector&records); 28 | bool processServerAliasResponse(const std::string& s, std::string& address); 29 | std::string resolveAlias(const std::string& aliasUrl); 30 | std::vector resolveAliases(const std::string& aliasUrl); 31 | 32 | #endif 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/Common/FileMappedVector.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Plura. 4 | // 5 | // Plura is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Plura is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Plura. If not, see . 17 | 18 | #include "FileMappedVector.h" 19 | 20 | namespace { 21 | #ifdef MSVC 22 | char suppressMSVCWarningLNK4221; 23 | #endif 24 | } 25 | -------------------------------------------------------------------------------- /src/Common/FormatTools.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2017, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2014-2018, The Monero Project 3 | // Copyright (c) 2018, The TurtleCoin Developers 4 | // Copyright (c) 2016-2019, The Karbo developers 5 | // 6 | // Please see the included LICENSE file for more information. 7 | 8 | #pragma once 9 | 10 | #include 11 | #include "Rpc/CoreRpcServerCommandsDefinitions.h" 12 | 13 | namespace Common { 14 | namespace Format { 15 | std::string get_mining_speed(const uint64_t hashrate); 16 | 17 | std::string get_sync_percentage( 18 | uint64_t height, 19 | const uint64_t target_height); 20 | 21 | std::string prettyPrintBytes(const uint64_t numBytes); 22 | 23 | std::string unixTimeToDate(const uint64_t timestamp); 24 | 25 | std::string formatAmount(uint64_t amount); 26 | 27 | std::string formatAmount(int64_t amount); 28 | 29 | bool parseAmount(const std::string& str, uint64_t& amount); 30 | } 31 | } -------------------------------------------------------------------------------- /src/Common/IInputStream.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Plura. 4 | // 5 | // Plura is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Plura is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Plura. If not, see . 17 | 18 | #include "IInputStream.h" 19 | -------------------------------------------------------------------------------- /src/Common/IInputStream.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Plura. 4 | // 5 | // Plura is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Plura is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Plura. If not, see . 17 | 18 | #pragma once 19 | 20 | #include 21 | 22 | namespace Common { 23 | 24 | class IInputStream { 25 | public: 26 | virtual ~IInputStream() { } 27 | virtual size_t readSome(void* data, size_t size) = 0; 28 | }; 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/Common/IOutputStream.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Plura. 4 | // 5 | // Plura is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Plura is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Plura. If not, see . 17 | 18 | #include "IOutputStream.h" 19 | -------------------------------------------------------------------------------- /src/Common/IOutputStream.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Plura. 4 | // 5 | // Plura is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Plura is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Plura. If not, see . 17 | 18 | #pragma once 19 | 20 | #include 21 | 22 | namespace Common { 23 | 24 | class IOutputStream { 25 | public: 26 | virtual ~IOutputStream() { } 27 | virtual size_t writeSome(const void* data, size_t size) = 0; 28 | }; 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/Common/Math.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Plura. 4 | // 5 | // Plura is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Plura is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Plura. If not, see . 17 | 18 | #include "Math.h" 19 | 20 | namespace { 21 | #ifdef _MSC_VER 22 | char suppressMSVCWarningLNK4221; 23 | #endif 24 | } 25 | -------------------------------------------------------------------------------- /src/Common/MemoryInputStream.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Plura. 4 | // 5 | // Plura is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Plura is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Plura. If not, see . 17 | 18 | #pragma once 19 | 20 | #include "IInputStream.h" 21 | 22 | namespace Common { 23 | 24 | class MemoryInputStream : public IInputStream { 25 | public: 26 | MemoryInputStream(const void* buffer, size_t bufferSize); 27 | size_t getPosition() const; 28 | bool endOfStream() const; 29 | 30 | // IInputStream 31 | virtual size_t readSome(void* data, size_t size) override; 32 | 33 | private: 34 | const char* buffer; 35 | size_t bufferSize; 36 | size_t position; 37 | }; 38 | } 39 | -------------------------------------------------------------------------------- /src/Common/ScopeExit.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Plura. 4 | // 5 | // Plura is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Plura is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Plura. If not, see . 17 | 18 | #include "ScopeExit.h" 19 | 20 | namespace Tools { 21 | 22 | ScopeExit::ScopeExit(std::function&& handler) : 23 | m_handler(std::move(handler)), 24 | m_cancelled(false) { 25 | } 26 | 27 | ScopeExit::~ScopeExit() { 28 | if (!m_cancelled) { 29 | m_handler(); 30 | } 31 | } 32 | 33 | void ScopeExit::cancel() { 34 | m_cancelled = true; 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /src/Common/ScopeExit.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Plura. 4 | // 5 | // Plura is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Plura is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Plura. If not, see . 17 | 18 | #pragma once 19 | 20 | #include 21 | 22 | namespace Tools { 23 | 24 | class ScopeExit { 25 | public: 26 | ScopeExit(std::function&& handler); 27 | ~ScopeExit(); 28 | 29 | ScopeExit(const ScopeExit&) = delete; 30 | ScopeExit(ScopeExit&&) = delete; 31 | ScopeExit& operator=(const ScopeExit&) = delete; 32 | ScopeExit& operator=(ScopeExit&&) = delete; 33 | 34 | void cancel(); 35 | 36 | private: 37 | std::function m_handler; 38 | bool m_cancelled; 39 | }; 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/Common/SignalHandler.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Plura. 4 | // 5 | // Plura is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Plura is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Plura. If not, see . 17 | 18 | #pragma once 19 | 20 | #include 21 | 22 | namespace Tools { 23 | 24 | class SignalHandler 25 | { 26 | public: 27 | static bool install(std::function t); 28 | }; 29 | } 30 | -------------------------------------------------------------------------------- /src/Common/StdInputStream.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Plura. 4 | // 5 | // Plura is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Plura is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Plura. If not, see . 17 | 18 | #include "StdInputStream.h" 19 | 20 | namespace Common { 21 | 22 | StdInputStream::StdInputStream(std::istream& in) : in(in) { 23 | } 24 | 25 | size_t StdInputStream::readSome(void* data, size_t size) { 26 | in.read(static_cast(data), size); 27 | return in.gcount(); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/Common/StdInputStream.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Plura. 4 | // 5 | // Plura is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Plura is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Plura. If not, see . 17 | 18 | #pragma once 19 | 20 | #include 21 | #include "IInputStream.h" 22 | 23 | namespace Common { 24 | 25 | class StdInputStream : public IInputStream { 26 | public: 27 | StdInputStream(std::istream& in); 28 | StdInputStream& operator=(const StdInputStream&) = delete; 29 | size_t readSome(void* data, size_t size) override; 30 | 31 | private: 32 | std::istream& in; 33 | }; 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/Common/StdOutputStream.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Plura. 4 | // 5 | // Plura is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Plura is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Plura. If not, see . 17 | 18 | #include "StdOutputStream.h" 19 | 20 | namespace Common { 21 | 22 | StdOutputStream::StdOutputStream(std::ostream& out) : out(out) { 23 | } 24 | 25 | size_t StdOutputStream::writeSome(const void* data, size_t size) { 26 | out.write(static_cast(data), size); 27 | if (out.bad()) { 28 | return 0; 29 | } 30 | 31 | return size; 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/Common/StdOutputStream.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Plura. 4 | // 5 | // Plura is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Plura is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Plura. If not, see . 17 | 18 | #pragma once 19 | 20 | #include 21 | #include "IOutputStream.h" 22 | 23 | namespace Common { 24 | 25 | class StdOutputStream : public IOutputStream { 26 | public: 27 | StdOutputStream(std::ostream& out); 28 | StdOutputStream& operator=(const StdOutputStream&) = delete; 29 | size_t writeSome(const void* data, size_t size) override; 30 | 31 | private: 32 | std::ostream& out; 33 | }; 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/Common/StringInputStream.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Plura. 4 | // 5 | // Plura is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Plura is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Plura. If not, see . 17 | 18 | #include "StringInputStream.h" 19 | #include 20 | 21 | namespace Common { 22 | 23 | StringInputStream::StringInputStream(const std::string& in) : in(in), offset(0) { 24 | } 25 | 26 | size_t StringInputStream::readSome(void* data, size_t size) { 27 | if (size > in.size() - offset) { 28 | size = in.size() - offset; 29 | } 30 | 31 | memcpy(data, in.data() + offset, size); 32 | offset += size; 33 | return size; 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/Common/StringInputStream.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Plura. 4 | // 5 | // Plura is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Plura is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Plura. If not, see . 17 | 18 | #pragma once 19 | 20 | #include 21 | #include "IInputStream.h" 22 | 23 | namespace Common { 24 | 25 | class StringInputStream : public IInputStream { 26 | public: 27 | StringInputStream(const std::string& in); 28 | size_t readSome(void* data, size_t size) override; 29 | 30 | private: 31 | const std::string& in; 32 | size_t offset; 33 | }; 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/Common/StringOutputStream.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Plura. 4 | // 5 | // Plura is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Plura is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Plura. If not, see . 17 | 18 | #include "StringOutputStream.h" 19 | 20 | namespace Common { 21 | 22 | StringOutputStream::StringOutputStream(std::string& out) : out(out) { 23 | } 24 | 25 | size_t StringOutputStream::writeSome(const void* data, size_t size) { 26 | out.append(static_cast(data), size); 27 | return size; 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/Common/StringOutputStream.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Plura. 4 | // 5 | // Plura is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Plura is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Plura. If not, see . 17 | 18 | #pragma once 19 | 20 | #include 21 | #include "IOutputStream.h" 22 | 23 | namespace Common { 24 | 25 | class StringOutputStream : public IOutputStream { 26 | public: 27 | StringOutputStream(std::string& out); 28 | size_t writeSome(const void* data, size_t size) override; 29 | 30 | private: 31 | std::string& out; 32 | }; 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/Common/UrlTools.h: -------------------------------------------------------------------------------- 1 | 2 | // Copyright (c) 2017-2019, Karbo developers 3 | // 4 | // This file is part of Karbo. 5 | // 6 | // Karbo 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 | // Karbo 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 Karbo. If not, see . 18 | 19 | 20 | #pragma once 21 | 22 | #include 23 | #include 24 | 25 | namespace Common { 26 | 27 | bool parseUrlAddress(const std::string& url, std::string& host, uint16_t& port, std::string& path, bool& ssl); 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/Common/Util.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Plura. 4 | // 5 | // Plura is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Plura is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Plura. If not, see . 17 | 18 | #pragma once 19 | 20 | #include 21 | #include 22 | 23 | namespace Tools 24 | { 25 | std::string getDefaultDataDirectory(); 26 | std::string get_os_version_string(); 27 | bool create_directories_if_necessary(const std::string& path); 28 | std::error_code replace_file(const std::string& replacement_name, const std::string& replaced_name); 29 | bool directoryExists(const std::string& path); 30 | } 31 | -------------------------------------------------------------------------------- /src/Common/VectorOutputStream.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Plura. 4 | // 5 | // Plura is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Plura is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Plura. If not, see . 17 | 18 | #include "VectorOutputStream.h" 19 | 20 | namespace Common { 21 | 22 | VectorOutputStream::VectorOutputStream(std::vector& out) : out(out) { 23 | } 24 | 25 | size_t VectorOutputStream::writeSome(const void* data, size_t size) { 26 | out.insert(out.end(), static_cast(data), static_cast(data) + size); 27 | return size; 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/Common/VectorOutputStream.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Plura. 4 | // 5 | // Plura is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Plura is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Plura. If not, see . 17 | 18 | #pragma once 19 | 20 | #include 21 | #include 22 | #include "IOutputStream.h" 23 | 24 | namespace Common { 25 | 26 | class VectorOutputStream : public IOutputStream { 27 | public: 28 | VectorOutputStream(std::vector& out); 29 | VectorOutputStream& operator=(const VectorOutputStream&) = delete; 30 | size_t writeSome(const void* data, size_t size) override; 31 | 32 | private: 33 | std::vector& out; 34 | }; 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/Common/pod-class.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Plura. 4 | // 5 | // Plura is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Plura is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Plura. If not, see . 17 | 18 | #pragma once 19 | 20 | #if defined(_MSC_VER) 21 | #define POD_CLASS struct 22 | #else 23 | #define POD_CLASS class 24 | #endif 25 | -------------------------------------------------------------------------------- /src/Common/static_assert.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Plura. 4 | // 5 | // Plura is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Plura is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Plura. If not, see . 17 | 18 | #pragma once 19 | 20 | #ifndef __cplusplus 21 | #ifdef __clang__ 22 | 23 | #define static_assert _Static_assert 24 | 25 | #endif 26 | #endif 27 | -------------------------------------------------------------------------------- /src/CryptoNoteCore/CoreConfig.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Plura. 4 | // 5 | // Plura is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Plura is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Plura. If not, see . 17 | 18 | #pragma once 19 | 20 | #include 21 | 22 | #include 23 | 24 | namespace CryptoNote { 25 | 26 | class CoreConfig { 27 | public: 28 | CoreConfig(); 29 | 30 | static void initOptions(boost::program_options::options_description& desc); 31 | void init(const boost::program_options::variables_map& options); 32 | 33 | std::string configFolder; 34 | bool configFolderDefaulted = true; 35 | }; 36 | 37 | } //namespace CryptoNote 38 | -------------------------------------------------------------------------------- /src/CryptoNoteCore/CryptoNoteBasic.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Plura. 4 | // 5 | // Plura is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Plura is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Plura. If not, see . 17 | 18 | #include "CryptoNoteBasic.h" 19 | #include "crypto/crypto.h" 20 | 21 | namespace CryptoNote { 22 | 23 | KeyPair generateKeyPair() { 24 | KeyPair k; 25 | Crypto::generate_keys(k.publicKey, k.secretKey); 26 | return k; 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/CryptoNoteCore/Difficulty.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Plura. 4 | // 5 | // Plura is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Plura is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Plura. If not, see . 17 | 18 | #pragma once 19 | 20 | #include 21 | #include 22 | 23 | #include "crypto/hash.h" 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 | -------------------------------------------------------------------------------- /src/CryptoNoteCore/IBlock.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Plura. 4 | // 5 | // Plura is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Plura is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Plura. If not, see . 17 | 18 | #include "IBlock.h" 19 | 20 | namespace CryptoNote { 21 | IBlock::~IBlock() { 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/CryptoNoteCore/IBlock.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Plura. 4 | // 5 | // Plura is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Plura is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Plura. If not, see . 17 | 18 | #pragma once 19 | 20 | #include "CryptoNote.h" 21 | 22 | namespace CryptoNote { 23 | class IBlock { 24 | public: 25 | virtual ~IBlock(); 26 | 27 | virtual const Block& getBlock() const = 0; 28 | virtual size_t getTransactionCount() const = 0; 29 | virtual const Transaction& getTransaction(size_t index) const = 0; 30 | }; 31 | } 32 | -------------------------------------------------------------------------------- /src/CryptoNoteCore/IBlockchainStorageObserver.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Plura. 4 | // 5 | // Plura is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Plura is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Plura. If not, see . 17 | 18 | #pragma once 19 | 20 | namespace CryptoNote { 21 | class IBlockchainStorageObserver { 22 | public: 23 | virtual ~IBlockchainStorageObserver() { 24 | } 25 | 26 | virtual void blockchainUpdated() = 0; 27 | }; 28 | } 29 | -------------------------------------------------------------------------------- /src/CryptoNoteCore/ICoreObserver.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Plura. 4 | // 5 | // Plura is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Plura is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Plura. If not, see . 17 | 18 | #pragma once 19 | 20 | namespace CryptoNote { 21 | 22 | class ICoreObserver { 23 | public: 24 | virtual ~ICoreObserver() {}; 25 | virtual void blockchainUpdated() {}; 26 | virtual void poolUpdated() {}; 27 | }; 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/CryptoNoteCore/ITimeProvider.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Plura. 4 | // 5 | // Plura is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Plura is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Plura. If not, see . 17 | 18 | #include "ITimeProvider.h" 19 | -------------------------------------------------------------------------------- /src/CryptoNoteCore/ITimeProvider.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Plura. 4 | // 5 | // Plura is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Plura is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Plura. If not, see . 17 | 18 | #pragma once 19 | 20 | #include 21 | 22 | namespace CryptoNote { 23 | 24 | struct ITimeProvider { 25 | virtual time_t now() = 0; 26 | virtual ~ITimeProvider() {} 27 | }; 28 | 29 | struct RealTimeProvider : public ITimeProvider { 30 | virtual time_t now() override { 31 | return time(nullptr); 32 | } 33 | }; 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/CryptoNoteCore/ITxPoolObserver.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Plura. 4 | // 5 | // Plura is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Plura is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Plura. If not, see . 17 | 18 | #pragma once 19 | 20 | namespace CryptoNote { 21 | class ITxPoolObserver { 22 | public: 23 | virtual ~ITxPoolObserver() { 24 | } 25 | 26 | virtual void txDeletedFromPool() = 0; 27 | }; 28 | } 29 | -------------------------------------------------------------------------------- /src/CryptoNoteCore/SwappedMap.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Plura. 4 | // 5 | // Plura is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Plura is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Plura. If not, see . 17 | 18 | #include "SwappedMap.h" 19 | 20 | namespace { 21 | #ifdef _MSC_VER 22 | char suppressMSVCWarningLNK4221; 23 | #endif 24 | } 25 | -------------------------------------------------------------------------------- /src/CryptoNoteCore/SwappedVector.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Plura. 4 | // 5 | // Plura is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Plura is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Plura. If not, see . 17 | 18 | #include "SwappedVector.h" 19 | 20 | namespace { 21 | #ifdef _MSC_VER 22 | char suppressMSVCWarningLNK4221; 23 | #endif 24 | } 25 | -------------------------------------------------------------------------------- /src/CryptoNoteCore/UpgradeDetector.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Plura. 4 | // 5 | // Plura is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Plura is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Plura. If not, see . 17 | 18 | #include "UpgradeDetector.h" 19 | -------------------------------------------------------------------------------- /src/CryptoNoteProtocol/ICryptoNoteProtocolObserver.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Plura. 4 | // 5 | // Plura is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Plura is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Plura. If not, see . 17 | 18 | #pragma once 19 | 20 | #include 21 | #include 22 | #include 23 | 24 | namespace CryptoNote { 25 | 26 | class ICryptoNoteProtocolObserver { 27 | public: 28 | virtual void peerCountUpdated(size_t count) {} 29 | virtual void lastKnownBlockHeightUpdated(uint32_t height) {} 30 | virtual void blockchainSynchronized(uint32_t topHeight) {} 31 | }; 32 | 33 | } //namespace CryptoNote 34 | -------------------------------------------------------------------------------- /src/GreenWallet/AddressBook.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2018, The TurtleCoin Developers 2 | // Copyright (c) 2018-2019, The Karbo Developers 3 | // 4 | // Please see the included LICENSE file for more information. 5 | 6 | #include 7 | 8 | void addToAddressBook(); 9 | 10 | void sendFromAddressBook(std::shared_ptr walletInfo, 11 | uint32_t height, std::string feeAddress, uint64_t nodeFee); 12 | 13 | void deleteFromAddressBook(); 14 | 15 | void listAddressBook(); 16 | 17 | const Maybe getAddressBookPaymentID(); 18 | 19 | const Maybe getAddressBookAddress(); 20 | 21 | const Maybe getAddressBookEntry(AddressBook addressBook); 22 | 23 | const std::string getAddressBookName(AddressBook addressBook); 24 | 25 | AddressBook getAddressBook(); 26 | 27 | bool saveAddressBook(AddressBook addressBook); 28 | 29 | bool isAddressBookEmpty(AddressBook addressBook); 30 | -------------------------------------------------------------------------------- /src/GreenWallet/CommandDispatcher.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2018, The TurtleCoin Developers 2 | // Copyright (c) 2018-2019, The Karbo Developers 3 | // 4 | // Please see the included LICENSE file for more information. 5 | 6 | #pragma once 7 | 8 | #include 9 | 10 | bool handleCommand(const std::string command, 11 | std::shared_ptr walletInfo, 12 | CryptoNote::INode &node); 13 | 14 | std::shared_ptr handleLaunchCommand(CryptoNote::WalletGreen &wallet, 15 | std::string launchCommand, 16 | Config &config); 17 | -------------------------------------------------------------------------------- /src/GreenWallet/Fusion.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2018, The TurtleCoin Developers 2 | // Copyright (c) 2018-2019, The Karbo Developers 3 | // 4 | // Please see the included LICENSE file for more information. 5 | 6 | #pragma once 7 | 8 | #include 9 | 10 | bool fusionTX(CryptoNote::WalletGreen &wallet, 11 | CryptoNote::TransactionParameters p); 12 | 13 | bool optimize(CryptoNote::WalletGreen &wallet, uint64_t threshold); 14 | 15 | void fullOptimize(CryptoNote::WalletGreen &wallet); 16 | 17 | size_t makeFusionTransaction(CryptoNote::WalletGreen &wallet, 18 | uint64_t threshold); 19 | -------------------------------------------------------------------------------- /src/GreenWallet/GetInput.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2018, The TurtleCoin Developers 2 | // Copyright (c) 2018-2019, The Karbo Developers 3 | // 4 | // Please see the included LICENSE file for more information. 5 | 6 | #pragma once 7 | 8 | #include 9 | 10 | #include 11 | 12 | #include 13 | #include 14 | 15 | std::string yellowANSIMsg(std::string msg); 16 | 17 | std::string getPrompt(std::shared_ptr walletInfo); 18 | 19 | template 20 | std::string getInputAndWorkInBackground(const std::vector 21 | &availableCommands, 22 | std::string prompt, 23 | bool backgroundRefresh, 24 | std::shared_ptr 25 | walletInfo); 26 | 27 | template 28 | std::string getInput(const std::vector &availableCommands, 29 | std::string prompt); 30 | -------------------------------------------------------------------------------- /src/GreenWallet/Menu.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2018, The TurtleCoin Developers 2 | // Copyright (c) 2018-2019, The Karbo Developers 3 | // 4 | // Please see the included LICENSE file for more information. 5 | 6 | #pragma once 7 | 8 | #include 9 | 10 | template 11 | std::string parseCommand(const std::vector &printableCommands, 12 | const std::vector &availableCommands, 13 | std::string prompt, 14 | bool backgroundRefresh, 15 | std::shared_ptr walletInfo); 16 | 17 | std::tuple> 18 | selectionScreen(Config &config, CryptoNote::WalletGreen &wallet, 19 | CryptoNote::INode &node); 20 | 21 | bool checkNodeStatus(CryptoNote::INode &node); 22 | 23 | std::string getAction(Config &config); 24 | 25 | void mainLoop(std::shared_ptr walletInfo, CryptoNote::INode &node); 26 | 27 | template 28 | void printCommands(const std::vector &commands, int offset = 0); 29 | -------------------------------------------------------------------------------- /src/GreenWallet/ParseArguments.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2018, The TurtleCoin Developers 2 | // Copyright (c) 2018-2019, The Karbo Developers 3 | // 4 | // Please see the included LICENSE file for more information. 5 | 6 | #pragma once 7 | 8 | #include 9 | 10 | char* getCmdOption(char ** begin, char ** end, const std::string & option); 11 | 12 | bool cmdOptionExists(char** begin, char** end, const std::string& option); 13 | 14 | Config parseArguments(int argc, char **argv); 15 | 16 | void helpMessage(); 17 | 18 | std::string getVersion(); 19 | 20 | std::vector getCLICommands(); 21 | -------------------------------------------------------------------------------- /src/GreenWallet/Sync.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2018, The TurtleCoin Developers 2 | // Copyright (c) 2018-2019, The Karbo Developers 3 | // 4 | // Please see the included LICENSE file for more information. 5 | 6 | #pragma once 7 | 8 | #include 9 | 10 | void syncWallet(CryptoNote::INode &node, 11 | std::shared_ptr walletInfo); 12 | 13 | void checkForNewTransactions(std::shared_ptr walletInfo); 14 | -------------------------------------------------------------------------------- /src/GreenWallet/ZedWallet.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2018, The TurtleCoin Developers 2 | // Copyright (c) 2018-2019, The Karbo Developers 3 | // 4 | // Please see the included LICENSE file for more information. 5 | 6 | #pragma once 7 | 8 | #include 9 | #include 10 | 11 | int main(int argc, char **argv); 12 | 13 | void run(CryptoNote::WalletGreen &wallet, CryptoNote::INode &node, 14 | Config &config); 15 | -------------------------------------------------------------------------------- /src/HTTP/HttpParserErrorCodes.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Plura. 4 | // 5 | // Plura is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Plura is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Plura. If not, see . 17 | 18 | #include "HttpParserErrorCodes.h" 19 | 20 | namespace CryptoNote { 21 | namespace error { 22 | 23 | HttpParserErrorCategory HttpParserErrorCategory::INSTANCE; 24 | 25 | } //namespace error 26 | } //namespace CryptoNote 27 | -------------------------------------------------------------------------------- /src/InProcessNode/InProcessNodeErrors.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Plura. 4 | // 5 | // Plura is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Plura is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Plura. If not, see . 17 | 18 | #include "InProcessNodeErrors.h" 19 | 20 | namespace CryptoNote { 21 | namespace error { 22 | 23 | InProcessNodeErrorCategory InProcessNodeErrorCategory::INSTANCE; 24 | 25 | } //namespace error 26 | } //namespace CryptoNote 27 | -------------------------------------------------------------------------------- /src/Logging/ConsoleLogger.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Plura. 4 | // 5 | // Plura is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Plura is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Plura. If not, see . 17 | 18 | #pragma once 19 | 20 | #include 21 | #include "CommonLogger.h" 22 | 23 | namespace Logging { 24 | 25 | class ConsoleLogger : public CommonLogger { 26 | public: 27 | ConsoleLogger(Level level = DEBUGGING); 28 | 29 | protected: 30 | virtual void doLogString(const std::string& message) override; 31 | 32 | private: 33 | std::mutex mutex; 34 | }; 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/Logging/FileLogger.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Plura. 4 | // 5 | // Plura is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Plura is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Plura. If not, see . 17 | 18 | #include "FileLogger.h" 19 | 20 | namespace Logging { 21 | 22 | FileLogger::FileLogger(Level level) : StreamLogger(level) { 23 | } 24 | 25 | void FileLogger::init(const std::string& fileName) { 26 | fileStream.open(fileName, std::ios::app); 27 | StreamLogger::attachToStream(fileStream); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/Logging/FileLogger.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Plura. 4 | // 5 | // Plura is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Plura is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Plura. If not, see . 17 | 18 | #pragma once 19 | 20 | #include 21 | #include "StreamLogger.h" 22 | 23 | namespace Logging { 24 | 25 | class FileLogger : public StreamLogger { 26 | public: 27 | FileLogger(Level level = DEBUGGING); 28 | void init(const std::string& filename); 29 | 30 | private: 31 | std::ofstream fileStream; 32 | }; 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/Logging/LoggerGroup.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Plura. 4 | // 5 | // Plura is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Plura is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Plura. If not, see . 17 | 18 | #pragma once 19 | 20 | #include 21 | #include "CommonLogger.h" 22 | 23 | namespace Logging { 24 | 25 | class LoggerGroup : public CommonLogger { 26 | public: 27 | LoggerGroup(Level level = DEBUGGING); 28 | 29 | void addLogger(ILogger& logger); 30 | void removeLogger(ILogger& logger); 31 | virtual void operator()(const std::string& category, Level level, boost::posix_time::ptime time, const std::string& body) override; 32 | 33 | protected: 34 | std::vector loggers; 35 | }; 36 | 37 | } 38 | -------------------------------------------------------------------------------- /src/Logging/StreamLogger.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Plura. 4 | // 5 | // Plura is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Plura is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Plura. If not, see . 17 | 18 | #pragma once 19 | 20 | #include 21 | #include "CommonLogger.h" 22 | 23 | namespace Logging { 24 | 25 | class StreamLogger : public CommonLogger { 26 | public: 27 | StreamLogger(Level level = DEBUGGING); 28 | StreamLogger(std::ostream& stream, Level level = DEBUGGING); 29 | void attachToStream(std::ostream& stream); 30 | 31 | protected: 32 | virtual void doLogString(const std::string& message) override; 33 | 34 | protected: 35 | std::ostream* stream; 36 | 37 | private: 38 | std::mutex mutex; 39 | }; 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/NodeRpcProxy/NodeErrors.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Plura. 4 | // 5 | // Plura is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Plura is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Plura. If not, see . 17 | 18 | #include "NodeErrors.h" 19 | 20 | namespace CryptoNote { 21 | namespace error { 22 | 23 | NodeErrorCategory NodeErrorCategory::INSTANCE; 24 | 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/P2p/P2pNetworks.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers, The Pluracoin developers 2 | // 3 | // This file is part of Plura. 4 | // 5 | // Plura is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Plura is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Plura. If not, see . 17 | 18 | #include 19 | #include 20 | #include 21 | #include "../CryptoNoteConfig.h" 22 | 23 | #pragma once 24 | 25 | namespace CryptoNote 26 | { 27 | namespace 28 | { 29 | boost::uuids::uuid name; 30 | boost::uuids::name_generator gen(name); 31 | boost::uuids::uuid u = gen(GENESIS_COINBASE_TX_HEX); 32 | } 33 | const static boost::uuids::uuid CRYPTONOTE_NETWORK = u; 34 | } 35 | 36 | -------------------------------------------------------------------------------- /src/P2p/PendingLiteBlock.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2018-2019, The TurtleCoin Developers 2 | // 3 | // Please see the included LICENSE file for more information. 4 | 5 | #pragma once 6 | 7 | #include "CryptoNoteProtocol/CryptoNoteProtocolDefinitions.h" 8 | 9 | #include 10 | 11 | namespace CryptoNote 12 | { 13 | struct PendingLiteBlock 14 | { 15 | NOTIFY_NEW_LITE_BLOCK_request request; 16 | std::unordered_set missed_transactions; 17 | }; 18 | } // namespace CryptoNote 19 | -------------------------------------------------------------------------------- /src/PaymentGate/WalletServiceErrorCategory.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Plura. 4 | // 5 | // Plura is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Plura is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Plura. If not, see . 17 | 18 | #include "WalletServiceErrorCategory.h" 19 | 20 | namespace CryptoNote { 21 | namespace error { 22 | 23 | WalletServiceErrorCategory WalletServiceErrorCategory::INSTANCE; 24 | 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/PaymentGateService/RpcNodeConfiguration.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Plura. 4 | // 5 | // Plura is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Plura is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Plura. If not, see . 17 | 18 | #pragma once 19 | 20 | #include 21 | #include 22 | 23 | namespace PaymentService { 24 | 25 | class RpcNodeConfiguration { 26 | public: 27 | RpcNodeConfiguration(); 28 | 29 | static void initOptions(boost::program_options::options_description& desc); 30 | void init(const boost::program_options::variables_map& options); 31 | 32 | std::string m_daemon_host; 33 | uint16_t m_daemon_port; 34 | }; 35 | 36 | } //namespace PaymentService 37 | -------------------------------------------------------------------------------- /src/Platform/Android/System/ErrorMessage.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2016-2017, Karbo developers 3 | // 4 | // This file is part of Plura. 5 | // 6 | // Plura 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 | // Plura 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 Plura. If not, see . 18 | 19 | #include "ErrorMessage.h" 20 | #include 21 | #include 22 | 23 | namespace System { 24 | 25 | std::string lastErrorMessage() { 26 | return errorMessage(errno); 27 | } 28 | 29 | std::string errorMessage(int err) { 30 | return "result=" + std::to_string(err) + ", " + std::strerror(err); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /src/Platform/Android/System/ErrorMessage.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2016-2017, Karbo developers 3 | // 4 | // This file is part of Plura. 5 | // 6 | // Plura 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 | // Plura 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 Plura. If not, see . 18 | 19 | #pragma once 20 | 21 | #include 22 | #include 23 | #include "android.h" 24 | 25 | namespace System { 26 | std::string lastErrorMessage(); 27 | std::string errorMessage(int); 28 | } 29 | -------------------------------------------------------------------------------- /src/Platform/Android/System/Future.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // Copyright (c) 2016-2017, Karbo developers 3 | // 4 | // This file is part of Plura. 5 | // 6 | // Plura 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 | // Plura 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 Plura. 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 | return std::async(std::launch::async, std::move(operation)); 31 | } 32 | 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/Platform/FreeBSD/System/ErrorMessage.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Karbo. 4 | // 5 | // Karbo is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Karbo is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Karbo. If not, see . 17 | 18 | #include "ErrorMessage.h" 19 | #include 20 | #include 21 | 22 | namespace System { 23 | 24 | std::string lastErrorMessage() { 25 | return errorMessage(errno); 26 | } 27 | 28 | std::string errorMessage(int err) { 29 | return "result=" + std::to_string(err) + ", " + std::strerror(err); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/Platform/FreeBSD/System/ErrorMessage.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Karbo. 4 | // 5 | // Karbo is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Karbo is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Karbo. If not, see . 17 | 18 | #pragma once 19 | 20 | #include 21 | 22 | namespace System { 23 | std::string lastErrorMessage(); 24 | std::string errorMessage(int); 25 | } 26 | -------------------------------------------------------------------------------- /src/Platform/FreeBSD/System/Timer.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Karbo. 4 | // 5 | // Karbo is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Karbo is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Karbo. If not, see . 17 | 18 | #pragma once 19 | 20 | #include 21 | 22 | namespace System { 23 | 24 | class Dispatcher; 25 | 26 | class Timer { 27 | public: 28 | Timer(); 29 | explicit Timer(Dispatcher& dispatcher); 30 | Timer(const Timer&) = delete; 31 | Timer(Timer&& other); 32 | ~Timer(); 33 | Timer& operator=(const Timer&) = delete; 34 | Timer& operator=(Timer&& other); 35 | void sleep(std::chrono::nanoseconds duration); 36 | 37 | private: 38 | Dispatcher* dispatcher; 39 | int timer; 40 | void* context; 41 | }; 42 | 43 | } 44 | -------------------------------------------------------------------------------- /src/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/Platform/Linux/System/ErrorMessage.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Karbo. 4 | // 5 | // Karbo is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Karbo is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Karbo. If not, see . 17 | 18 | #include "ErrorMessage.h" 19 | #include 20 | #include 21 | 22 | namespace System { 23 | 24 | std::string lastErrorMessage() { 25 | return errorMessage(errno); 26 | } 27 | 28 | std::string errorMessage(int err) { 29 | return "result=" + std::to_string(err) + ", " + std::strerror(err); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/Platform/Linux/System/ErrorMessage.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Karbo. 4 | // 5 | // Karbo is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Karbo is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Karbo. If not, see . 17 | 18 | #pragma once 19 | 20 | #include 21 | 22 | namespace System { 23 | std::string lastErrorMessage(); 24 | std::string errorMessage(int); 25 | } 26 | -------------------------------------------------------------------------------- /src/Platform/Linux/System/Future.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Karbo. 4 | // 5 | // Karbo is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Karbo is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Karbo. If not, see . 17 | 18 | #pragma once 19 | 20 | #include 21 | 22 | namespace System { 23 | 24 | namespace Detail { 25 | 26 | template using Future = std::future; 27 | 28 | template Future async(std::function&& operation) { 29 | return std::async(std::launch::async, std::move(operation)); 30 | } 31 | 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/Platform/Linux/System/Timer.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Karbo. 4 | // 5 | // Karbo is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Karbo is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Karbo. If not, see . 17 | 18 | #pragma once 19 | 20 | #include 21 | 22 | namespace System { 23 | 24 | class Dispatcher; 25 | 26 | class Timer { 27 | public: 28 | Timer(); 29 | explicit Timer(Dispatcher& dispatcher); 30 | Timer(const Timer&) = delete; 31 | Timer(Timer&& other); 32 | ~Timer(); 33 | Timer& operator=(const Timer&) = delete; 34 | Timer& operator=(Timer&& other); 35 | void sleep(std::chrono::nanoseconds duration); 36 | 37 | private: 38 | Dispatcher* dispatcher; 39 | void* context; 40 | int timer; 41 | }; 42 | 43 | } 44 | -------------------------------------------------------------------------------- /src/Platform/OSX/System/ErrorMessage.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Karbo. 4 | // 5 | // Karbo is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Karbo is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Karbo. If not, see . 17 | 18 | #include "ErrorMessage.h" 19 | #include 20 | #include 21 | 22 | namespace System { 23 | 24 | std::string lastErrorMessage() { 25 | return errorMessage(errno); 26 | } 27 | 28 | std::string errorMessage(int err) { 29 | return "result=" + std::to_string(err) + ", " + std::strerror(err); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/Platform/OSX/System/ErrorMessage.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Karbo. 4 | // 5 | // Karbo is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Karbo is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Karbo. If not, see . 17 | 18 | #pragma once 19 | 20 | #include 21 | 22 | namespace System { 23 | std::string lastErrorMessage(); 24 | std::string errorMessage(int); 25 | } 26 | -------------------------------------------------------------------------------- /src/Platform/OSX/System/Timer.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Karbo. 4 | // 5 | // Karbo is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Karbo is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Karbo. If not, see . 17 | 18 | #pragma once 19 | 20 | #include 21 | 22 | namespace System { 23 | 24 | class Dispatcher; 25 | 26 | class Timer { 27 | public: 28 | Timer(); 29 | explicit Timer(Dispatcher& dispatcher); 30 | Timer(const Timer&) = delete; 31 | Timer(Timer&& other); 32 | ~Timer(); 33 | Timer& operator=(const Timer&) = delete; 34 | Timer& operator=(Timer&& other); 35 | void sleep(std::chrono::nanoseconds duration); 36 | 37 | private: 38 | Dispatcher* dispatcher; 39 | int timer; 40 | void* context; 41 | }; 42 | 43 | } 44 | -------------------------------------------------------------------------------- /src/Platform/Windows/System/ErrorMessage.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Karbo. 4 | // 5 | // Karbo is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Karbo is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Karbo. If not, see . 17 | 18 | #pragma once 19 | 20 | #include 21 | 22 | namespace System { 23 | 24 | std::string lastErrorMessage(); 25 | std::string errorMessage(int); 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/Platform/Windows/System/Future.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Karbo. 4 | // 5 | // Karbo is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Karbo is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Karbo. If not, see . 17 | 18 | #pragma once 19 | 20 | #include 21 | 22 | namespace System { 23 | 24 | namespace Detail { 25 | 26 | template using Future = std::future; 27 | 28 | template Future async(std::function&& operation) { 29 | return std::async(std::launch::async, std::move(operation)); 30 | } 31 | 32 | } 33 | 34 | } 35 | 36 | -------------------------------------------------------------------------------- /src/Platform/Windows/System/Timer.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Karbo. 4 | // 5 | // Karbo is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Karbo is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Karbo. If not, see . 17 | 18 | #pragma once 19 | 20 | #include 21 | 22 | namespace System { 23 | 24 | class Dispatcher; 25 | 26 | class Timer { 27 | public: 28 | Timer(); 29 | explicit Timer(Dispatcher& dispatcher); 30 | Timer(const Timer&) = delete; 31 | Timer(Timer&& other); 32 | ~Timer(); 33 | Timer& operator=(const Timer&) = delete; 34 | Timer& operator=(Timer&& other); 35 | void sleep(std::chrono::nanoseconds duration); 36 | 37 | private: 38 | Dispatcher* dispatcher; 39 | void* context; 40 | }; 41 | 42 | } 43 | -------------------------------------------------------------------------------- /src/Platform/mingw/alloca.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Karbo. 4 | // 5 | // Karbo is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Karbo is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Karbo. If not, see . 17 | 18 | #pragma once 19 | 20 | #include 21 | -------------------------------------------------------------------------------- /src/Platform/msc/alloca.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Karbo. 4 | // 5 | // Karbo is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Karbo is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Karbo. If not, see . 17 | 18 | #pragma once 19 | 20 | #ifndef __cplusplus 21 | #define alloca(size) _alloca(size) 22 | #endif 23 | -------------------------------------------------------------------------------- /src/Platform/msc/stdbool.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Karbo. 4 | // 5 | // Karbo is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Karbo is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Karbo. If not, see . 17 | 18 | #pragma once 19 | 20 | #if !defined(__cplusplus) 21 | 22 | typedef int bool; 23 | #define true 1 24 | #define false 0 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /src/Platform/msc/sys/param.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Karbo. 4 | // 5 | // Karbo is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Karbo is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Karbo. If not, see . 17 | 18 | #pragma once 19 | 20 | #define LITTLE_ENDIAN 1234 21 | #define BIG_ENDIAN 4321 22 | #define PDP_ENDIAN 3412 23 | #define BYTE_ORDER LITTLE_ENDIAN 24 | -------------------------------------------------------------------------------- /src/Rpc/CoreRpcServerErrorCodes.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Plura. 4 | // 5 | // Plura is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Plura is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Plura. If not, see . 17 | 18 | #pragma once 19 | 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 | #define CORE_RPC_ERROR_CODE_RESTRICTED -10 30 | -------------------------------------------------------------------------------- /src/Serialization/IStream.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Karbo. 4 | // 5 | // Karbo is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Karbo is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Karbo. If not, see . 17 | 18 | #pragma once 19 | 20 | #include 21 | #include 22 | 23 | namespace CryptoNote { 24 | 25 | class IInputStream { 26 | public: 27 | virtual size_t read(char* data, size_t size) = 0; 28 | }; 29 | 30 | class IOutputStream { 31 | public: 32 | virtual void write(const char* data, size_t size) = 0; 33 | }; 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/Serialization/JsonInputStreamSerializer.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Karbo. 4 | // 5 | // Karbo is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Karbo is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Karbo. If not, see . 17 | 18 | #pragma once 19 | 20 | #include 21 | #include 22 | #include 23 | #include "../Common/JsonValue.h" 24 | #include "JsonInputValueSerializer.h" 25 | 26 | namespace CryptoNote { 27 | 28 | //deserialization 29 | class JsonInputStreamSerializer : public JsonInputValueSerializer { 30 | public: 31 | JsonInputStreamSerializer(std::istream& stream); 32 | virtual ~JsonInputStreamSerializer(); 33 | }; 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/Serialization/KVBinaryInputStreamSerializer.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Karbo. 4 | // 5 | // Karbo is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Karbo is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Karbo. If not, see . 17 | 18 | #pragma once 19 | 20 | #include 21 | #include "ISerializer.h" 22 | #include "JsonInputValueSerializer.h" 23 | 24 | namespace CryptoNote { 25 | 26 | class KVBinaryInputStreamSerializer : public JsonInputValueSerializer { 27 | public: 28 | KVBinaryInputStreamSerializer(Common::IInputStream& strm); 29 | 30 | virtual bool binary(void* value, size_t size, Common::StringView name) override; 31 | virtual bool binary(std::string& value, Common::StringView name) override; 32 | }; 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/Serialization/MemoryStream.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Karbo. 4 | // 5 | // Karbo is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Karbo is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Karbo. If not, see . 17 | 18 | #include "MemoryStream.h" 19 | -------------------------------------------------------------------------------- /src/System/ContextGroupTimeout.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Plura. 4 | // 5 | // Plura is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Plura is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Plura. If not, see . 17 | 18 | #include "ContextGroupTimeout.h" 19 | #include 20 | 21 | using namespace System; 22 | 23 | ContextGroupTimeout::ContextGroupTimeout(Dispatcher& dispatcher, ContextGroup& contextGroup, std::chrono::nanoseconds timeout) : 24 | workingContextGroup(dispatcher), 25 | timeoutTimer(dispatcher) { 26 | workingContextGroup.spawn([&, timeout] { 27 | try { 28 | timeoutTimer.sleep(timeout); 29 | contextGroup.interrupt(); 30 | } catch (InterruptedException&) { 31 | } 32 | }); 33 | } 34 | -------------------------------------------------------------------------------- /src/System/ContextGroupTimeout.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Plura. 4 | // 5 | // Plura is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Plura is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Plura. If not, see . 17 | 18 | #pragma once 19 | #include 20 | #include 21 | #include 22 | 23 | namespace System { 24 | 25 | class ContextGroupTimeout { 26 | public: 27 | ContextGroupTimeout(Dispatcher&, ContextGroup&, std::chrono::nanoseconds); 28 | 29 | private: 30 | Timer timeoutTimer; 31 | ContextGroup workingContextGroup; 32 | }; 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/System/Event.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Plura. 4 | // 5 | // Plura is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Plura is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Plura. If not, see . 17 | 18 | #pragma once 19 | 20 | namespace System { 21 | 22 | class Dispatcher; 23 | 24 | class Event { 25 | public: 26 | Event(); 27 | explicit Event(Dispatcher& dispatcher); 28 | Event(const Event&) = delete; 29 | Event(Event&& other); 30 | ~Event(); 31 | Event& operator=(const Event&) = delete; 32 | Event& operator=(Event&& other); 33 | bool get() const; 34 | void clear(); 35 | void set(); 36 | void wait(); 37 | 38 | private: 39 | Dispatcher* dispatcher; 40 | bool state; 41 | void* first; 42 | void* last; 43 | }; 44 | 45 | } 46 | -------------------------------------------------------------------------------- /src/System/EventLock.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Plura. 4 | // 5 | // Plura is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Plura is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Plura. If not, see . 17 | 18 | #include "EventLock.h" 19 | #include 20 | 21 | namespace System { 22 | 23 | EventLock::EventLock(Event& event) : event(event) { 24 | while (!event.get()) { 25 | event.wait(); 26 | } 27 | 28 | event.clear(); 29 | } 30 | 31 | EventLock::~EventLock() { 32 | event.set(); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/System/EventLock.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Plura. 4 | // 5 | // Plura is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Plura is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Plura. If not, see . 17 | 18 | #pragma once 19 | 20 | namespace System { 21 | 22 | class Event; 23 | 24 | class EventLock { 25 | public: 26 | explicit EventLock(Event& event); 27 | ~EventLock(); 28 | EventLock& operator=(const EventLock&) = delete; 29 | 30 | private: 31 | Event& event; 32 | }; 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/System/InterruptedException.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Plura. 4 | // 5 | // Plura is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Plura is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Plura. If not, see . 17 | 18 | #include "InterruptedException.h" 19 | 20 | namespace { 21 | #ifdef _MSC_VER 22 | char suppressMSVCWarningLNK4221; 23 | #endif 24 | } 25 | -------------------------------------------------------------------------------- /src/System/InterruptedException.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Plura. 4 | // 5 | // Plura is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Plura is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Plura. If not, see . 17 | 18 | #pragma once 19 | 20 | #include 21 | 22 | namespace System { 23 | 24 | class InterruptedException : public std::exception { 25 | public: 26 | virtual const char* what() const throw() override { 27 | return "interrupted"; 28 | } 29 | }; 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/System/Ipv4Address.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Plura. 4 | // 5 | // Plura is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Plura is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Plura. If not, see . 17 | 18 | #pragma once 19 | 20 | #include 21 | #include 22 | 23 | namespace System { 24 | 25 | class Ipv4Address { 26 | public: 27 | explicit Ipv4Address(uint32_t value); 28 | explicit Ipv4Address(const std::string& dottedDecimal); 29 | bool operator!=(const Ipv4Address& other) const; 30 | bool operator==(const Ipv4Address& other) const; 31 | uint32_t getValue() const; 32 | bool isLoopback() const; 33 | bool isPrivate() const; 34 | std::string toDottedDecimal() const; 35 | 36 | private: 37 | uint32_t value; 38 | }; 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/System/RemoteEventLock.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Plura. 4 | // 5 | // Plura is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Plura is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Plura. If not, see . 17 | 18 | #pragma once 19 | 20 | namespace System { 21 | 22 | class Dispatcher; 23 | class Event; 24 | 25 | class RemoteEventLock { 26 | public: 27 | RemoteEventLock(Dispatcher& dispatcher, Event& event); 28 | ~RemoteEventLock(); 29 | 30 | private: 31 | Dispatcher& dispatcher; 32 | Event& event; 33 | }; 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/Transfers/IObservableImpl.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Plura. 4 | // 5 | // Plura is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Plura is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Plura. If not, see . 17 | 18 | #pragma once 19 | 20 | #include "Common/ObserverManager.h" 21 | 22 | namespace CryptoNote { 23 | 24 | template 25 | class IObservableImpl : public Base { 26 | public: 27 | 28 | virtual void addObserver(Observer* observer) override { 29 | m_observerManager.add(observer); 30 | } 31 | 32 | virtual void removeObserver(Observer* observer) override { 33 | m_observerManager.remove(observer); 34 | } 35 | 36 | protected: 37 | Tools::ObserverManager m_observerManager; 38 | }; 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/Wallet/LegacyKeysImporter.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Plura. 4 | // 5 | // Plura is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Plura is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Plura. If not, see . 17 | 18 | #pragma once 19 | 20 | #include 21 | #include 22 | 23 | namespace CryptoNote { 24 | 25 | void importLegacyKeys(const std::string& legacyKeysFilename, const std::string& password, std::ostream& destination); 26 | 27 | } //namespace CryptoNote 28 | -------------------------------------------------------------------------------- /src/Wallet/WalletErrors.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Plura. 4 | // 5 | // Plura is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Plura is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Plura. If not, see . 17 | 18 | #include "WalletErrors.h" 19 | 20 | namespace CryptoNote { 21 | namespace error { 22 | 23 | WalletErrorCategory WalletErrorCategory::INSTANCE; 24 | 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/WalletLegacy/KeysStorage.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Plura. 4 | // 5 | // Plura is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Plura is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Plura. If not, see . 17 | 18 | #pragma once 19 | 20 | #include "crypto/crypto.h" 21 | 22 | #include 23 | 24 | namespace CryptoNote { 25 | 26 | class ISerializer; 27 | 28 | //This is DTO structure. Do not change it. 29 | struct KeysStorage { 30 | uint64_t creationTimestamp; 31 | 32 | Crypto::PublicKey spendPublicKey; 33 | Crypto::SecretKey spendSecretKey; 34 | 35 | Crypto::PublicKey viewPublicKey; 36 | Crypto::SecretKey viewSecretKey; 37 | 38 | void serialize(ISerializer& serializer, const std::string& name); 39 | }; 40 | 41 | } //namespace CryptoNote 42 | -------------------------------------------------------------------------------- /src/crypto/crypto-util.c: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2018, The CryptoNote developers, The Bytecoin developers. 2 | // Licensed under the GNU Lesser General Public License. See LICENSE for details. 3 | 4 | // Copyright (c) 2013-2018 5 | // Frank Denis 6 | // See https://github.com/jedisct1/libsodium/blob/master/LICENSE for details 7 | 8 | #include 9 | #include 10 | 11 | #include "crypto-util.h" 12 | 13 | #ifdef _WIN32 14 | #include 15 | #endif 16 | 17 | void sodium_memzero(void *pnt, size_t len) { 18 | #ifdef _WIN32 19 | SecureZeroMemory(pnt, len); 20 | #else 21 | volatile unsigned char *volatile pnt_ = (volatile unsigned char *volatile)pnt; 22 | size_t i = (size_t)0U; 23 | 24 | while (i < len) { 25 | pnt_[i++] = 0U; 26 | } 27 | #endif 28 | } 29 | 30 | int sodium_compare(const void *a1, const void *a2, size_t len) { 31 | const volatile unsigned char *volatile b1 = (const volatile unsigned char *)a1; 32 | const volatile unsigned char *volatile b2 = (const volatile unsigned char *)a2; 33 | size_t i; 34 | volatile unsigned char gt = 0U; 35 | volatile unsigned char eq = 1U; 36 | uint16_t x1, x2; 37 | 38 | i = len; 39 | while (i != 0U) { 40 | i--; 41 | x1 = b1[i]; 42 | x2 = b2[i]; 43 | gt |= ((x2 - x1) >> 8) & eq; 44 | eq &= ((x2 ^ x1) - 1) >> 8; 45 | } 46 | return (int)(gt + gt + eq) - 1; 47 | } 48 | -------------------------------------------------------------------------------- /src/crypto/crypto-util.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2018, The CryptoNote developers, The Bytecoin developers. 2 | // Licensed under the GNU Lesser General Public License. See LICENSE for details. 3 | 4 | // Copyright (c) 2013-2018 5 | // Frank Denis 6 | // See https://github.com/jedisct1/libsodium/blob/master/LICENSE for details 7 | 8 | #pragma once 9 | 10 | #include 11 | #include 12 | 13 | #if defined(__cplusplus) 14 | extern "C" { 15 | #endif 16 | // We borrow from https://libsodium.org/ 17 | void sodium_memzero(void *pnt, size_t length); 18 | int sodium_compare(const void *a1, const void *a2, size_t length); 19 | 20 | #if defined(__cplusplus) 21 | } 22 | #endif 23 | -------------------------------------------------------------------------------- /src/crypto/hash-extra-blake.c: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Karbo. 4 | // 5 | // Karbo is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Karbo is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Karbo. If not, see . 17 | 18 | #include 19 | #include 20 | 21 | #include "blake256.h" 22 | 23 | void hash_extra_blake(const void *data, size_t length, char *hash) { 24 | blake256_hash((uint8_t*)hash, data, length); 25 | } 26 | -------------------------------------------------------------------------------- /src/crypto/hash-extra-groestl.c: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Karbo. 4 | // 5 | // Karbo is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Karbo is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Karbo. If not, see . 17 | 18 | #include 19 | #include 20 | 21 | #include "groestl.h" 22 | 23 | void hash_extra_groestl(const void *data, size_t length, char *hash) { 24 | groestl(data, length * 8, (uint8_t*)hash); 25 | } 26 | -------------------------------------------------------------------------------- /src/crypto/hash-extra-jh.c: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Karbo. 4 | // 5 | // Karbo is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Karbo is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Karbo. If not, see . 17 | 18 | #include 19 | #include 20 | #include 21 | #include 22 | 23 | #include "jh.h" 24 | #include "hash-ops.h" 25 | 26 | void hash_extra_jh(const void *data, size_t length, char *hash) { 27 | int r = jh_hash(HASH_SIZE * 8, data, 8 * length, (uint8_t*)hash); 28 | assert(SUCCESS == r); 29 | } 30 | -------------------------------------------------------------------------------- /src/crypto/hash-extra-skein.c: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Karbo. 4 | // 5 | // Karbo is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Karbo is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Karbo. If not, see . 17 | 18 | #include 19 | #include 20 | 21 | #include "hash-ops.h" 22 | #include "skein.h" 23 | 24 | void hash_extra_skein(const void *data, size_t length, char *hash) { 25 | int r = skein_hash(8 * HASH_SIZE, data, 8 * length, (uint8_t*)hash); 26 | assert(SKEIN_SUCCESS == r); 27 | } 28 | -------------------------------------------------------------------------------- /src/crypto/insecure_memzero.h: -------------------------------------------------------------------------------- 1 | #define insecure_memzero(buf, len) /* empty */ 2 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/pluracoin.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluracoin/PluraCoin/14c6d07df08292069863ac8a998dc4b73c433c2a/src/pluracoin.ico -------------------------------------------------------------------------------- /src/pluracoin.rc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | 1 VERSIONINFO 4 | FILEVERSION 1,5,1 5 | PRODUCTVERSION 1,5,1 6 | FILEFLAGSMASK 0x3fL 7 | FILEFLAGS 0x0L 8 | FILEOS 0x40004L 9 | FILETYPE 0x1L 10 | FILESUBTYPE 0x0L 11 | BEGIN 12 | BLOCK "StringFileInfo" 13 | BEGIN 14 | BLOCK "040904b0" 15 | BEGIN 16 | VALUE "CompanyName", "PluraCoin" 17 | VALUE "FileDescription", "PluraCoin network daemon" 18 | VALUE "FileVersion", "1.5.1" 19 | VALUE "InternalName", "pluracoind.exe" 20 | VALUE "LegalCopyright", "Copyright (C) 2018, PluraCoin Developers" 21 | VALUE "OriginalFilename", "pluracoind.exe" 22 | VALUE "ProductName", "PLURA" 23 | VALUE "ProductVersion", "1.5.1" 24 | END 25 | END 26 | BLOCK "VarFileInfo" 27 | BEGIN 28 | VALUE "Translation", 0x409, 1200 29 | END 30 | END 31 | 32 | 101 ICON "pluracoin.ico" 33 | -------------------------------------------------------------------------------- /src/version.h.in: -------------------------------------------------------------------------------- 1 | #define STR_HELPER(x) #x 2 | #define STR(x) STR_HELPER(x) 3 | 4 | #define PROJECT_NAME "Plura" 5 | #define PROJECT_SITE "https://pluracoin.org" 6 | #define PROJECT_COPYRIGHT "Copyright 2018-2021, Plura Developers" 7 | #define APP_VER_MAJOR @PROJECT_VERSION_MAJOR@ 8 | #define APP_VER_MINOR @PROJECT_VERSION_MINOR@ 9 | #define APP_VER_REV @PROJECT_VERSION_PATCH@ 10 | #define APP_VER_BUILD @PROJECT_VERSION_REV@ 11 | #define BUILD_COMMIT_ID "@PROJECT_GIT_COMMIT_ID@" 12 | #cmakedefine BUILD_REMARK "@BUILD_REMARK@" 13 | 14 | #define PROJECT_VERSION "3.0.0" 15 | 16 | #define PROJECT_VERSION_BUILD_NO STR(APP_VER_BUILD) 17 | 18 | #ifdef BUILD_REMARK 19 | #define PROJECT_VERSION_LONG PROJECT_VERSION "." PROJECT_VERSION_BUILD_NO "-" BUILD_COMMIT_ID "-" BUILD_REMARK 20 | #else 21 | #define PROJECT_VERSION_LONG PROJECT_VERSION "." PROJECT_VERSION_BUILD_NO "-" BUILD_COMMIT_ID 22 | #endif 23 | 24 | #define PROJECT_DESCRIPTION PROJECT_NAME " v. " PROJECT_VERSION_LONG 25 | -------------------------------------------------------------------------------- /tests/CoreTests/TransactionTests.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Plura. 4 | // 5 | // Plura is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Plura is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Plura. If not, see . 17 | 18 | #pragma once 19 | 20 | bool test_transactions(); 21 | bool test_block_creation(); 22 | -------------------------------------------------------------------------------- /tests/Data/account-002bee2f8e16f5de4db0d3b8ce9227c8c0b7f9688348b028e022cb43f210968b40a69cdc8531fd4a2e7c9e144eec48bb477733d70ce5f9b85338a07cb10b849ad8fb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluracoin/PluraCoin/14c6d07df08292069863ac8a998dc4b73c433c2a/tests/Data/account-002bee2f8e16f5de4db0d3b8ce9227c8c0b7f9688348b028e022cb43f210968b40a69cdc8531fd4a2e7c9e144eec48bb477733d70ce5f9b85338a07cb10b849ad8fb -------------------------------------------------------------------------------- /tests/Data/account-007af2d7c5ffd8f69005debae820207820805e28c7d7a16714591143f56fb51e2b91ad0c1a535567e6292b321773df5e5aaace00fe767c4f09de452838575357ca9f: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluracoin/PluraCoin/14c6d07df08292069863ac8a998dc4b73c433c2a/tests/Data/account-007af2d7c5ffd8f69005debae820207820805e28c7d7a16714591143f56fb51e2b91ad0c1a535567e6292b321773df5e5aaace00fe767c4f09de452838575357ca9f -------------------------------------------------------------------------------- /tests/Data/account-009b82d66dfaaba55a581913fa09d6c5bebe179cd73731781265c96e9e630dcd27fd5d20e7f1d0fa42619de9ca8fe4c0659f6959b2bebb15079cdaed07a442a78486: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluracoin/PluraCoin/14c6d07df08292069863ac8a998dc4b73c433c2a/tests/Data/account-009b82d66dfaaba55a581913fa09d6c5bebe179cd73731781265c96e9e630dcd27fd5d20e7f1d0fa42619de9ca8fe4c0659f6959b2bebb15079cdaed07a442a78486 -------------------------------------------------------------------------------- /tests/Data/account-00aff84db50d6a54dd56051379f6c336fdd330d1cb11e7523bbf71f30b1ae760fa47ace8679b6486f79429980fd2331715a631f5729db284eb1fc6f108aeb7a7f4fe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pluracoin/PluraCoin/14c6d07df08292069863ac8a998dc4b73c433c2a/tests/Data/account-00aff84db50d6a54dd56051379f6c336fdd330d1cb11e7523bbf71f30b1ae760fa47ace8679b6486f79429980fd2331715a631f5729db284eb1fc6f108aeb7a7f4fe -------------------------------------------------------------------------------- /tests/Hash/tests-slow.txt: -------------------------------------------------------------------------------- 1 | 2f8e3df40bd11f9ac90c743ca8e32bb391da4fb98612aa3b6cdc639ee00b31f5 6465206f6d6e69627573206475626974616e64756d 2 | 722fa8ccd594d40e4a41f3822734304c8d5eff7e1b528408e2229da38ba553c4 6162756e64616e732063617574656c61206e6f6e206e6f636574 3 | bbec2cacf69866a8e740380fe7b818fc78f8571221742d729d9d02d7f8989b87 63617665617420656d70746f72 4 | b1257de4efc5ce28c6b40ceb1c6c8f812a64634eb3e81c5220bee9b2b76a6f05 6578206e6968696c6f206e6968696c20666974 5 | -------------------------------------------------------------------------------- /tests/IntegrationTestLib/Process.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Plura. 4 | // 5 | // Plura is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Plura is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Plura. If not, see . 17 | 18 | #pragma once 19 | 20 | #include 21 | #include 22 | 23 | namespace Tests { 24 | 25 | class Process { 26 | public: 27 | 28 | void startChild(const std::string& executablePath, const std::vector& args = {}); 29 | void wait(); 30 | 31 | private: 32 | 33 | size_t m_pid = 0; 34 | 35 | }; 36 | } 37 | -------------------------------------------------------------------------------- /tests/PerformanceTests/GenerateKeyDerivation.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Plura. 4 | // 5 | // Plura is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Plura is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Plura. If not, see . 17 | 18 | #pragma once 19 | 20 | #include "crypto/crypto.h" 21 | #include "CryptoNoteCore/CryptoNoteBasic.h" 22 | 23 | #include "SingleTransactionTestBase.h" 24 | 25 | class test_generate_key_derivation : public single_tx_test_base 26 | { 27 | public: 28 | static const size_t loop_count = 1000; 29 | 30 | bool test() 31 | { 32 | Crypto::KeyDerivation recv_derivation; 33 | Crypto::generate_key_derivation(m_tx_pub_key, m_bob.getAccountKeys().viewSecretKey, recv_derivation); 34 | return true; 35 | } 36 | }; 37 | -------------------------------------------------------------------------------- /tests/System/ErrorMessageTests.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Plura. 4 | // 5 | // Plura is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Plura is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Plura. If not, see . 17 | 18 | #include 19 | #include 20 | 21 | using namespace System; 22 | 23 | TEST(ErrorMessageTests, testErrorMessage) { 24 | auto msg = errorMessage(100); 25 | ASSERT_EQ(msg.substr(0, 12), "result=100, "); 26 | } 27 | -------------------------------------------------------------------------------- /tests/System/main.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Plura. 4 | // 5 | // Plura is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Plura is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Plura. If not, see . 17 | 18 | #include 19 | 20 | int main(int argc, char** argv) { 21 | ::testing::InitGoogleTest(&argc, argv); 22 | return RUN_ALL_TESTS(); 23 | } 24 | -------------------------------------------------------------------------------- /tests/TransfersTests/Globals.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Plura. 4 | // 5 | // Plura is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Plura is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Plura. If not, see . 17 | 18 | #pragma once 19 | 20 | #include "../IntegrationTestLib/BaseFunctionalTests.h" 21 | #include "../IntegrationTestLib/Logger.h" 22 | #include "gtest/gtest.h" 23 | 24 | extern System::Dispatcher globalSystem; 25 | extern CryptoNote::Currency currency; 26 | extern Tests::Common::BaseFunctionalTestsConfig config; 27 | 28 | class TransfersTest : 29 | public Tests::Common::BaseFunctionalTests, 30 | public ::testing::Test { 31 | 32 | public: 33 | TransfersTest() : BaseFunctionalTests(currency, globalSystem, config) { 34 | } 35 | }; 36 | -------------------------------------------------------------------------------- /tests/UnitTests/EventWaiter.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Plura. 4 | // 5 | // Plura is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Plura is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Plura. If not, see . 17 | 18 | #include 19 | #include 20 | 21 | #pragma once 22 | 23 | class EventWaiter { 24 | private: 25 | std::mutex mtx; 26 | std::condition_variable cv; 27 | bool available; 28 | 29 | public: 30 | EventWaiter() : available(false) {} 31 | 32 | void notify(); 33 | void wait(); 34 | bool wait_for(const std::chrono::milliseconds& rel_time); 35 | }; 36 | -------------------------------------------------------------------------------- /tests/UnitTests/main.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Plura. 4 | // 5 | // Plura is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Plura is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Plura. If not, see . 17 | 18 | #include "gtest/gtest.h" 19 | 20 | int main(int argc, char** argv) 21 | { 22 | ::testing::InitGoogleTest(&argc, argv); 23 | return RUN_ALL_TESTS(); 24 | } 25 | -------------------------------------------------------------------------------- /tests/crypto/crypto-ops-data.c: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Bytecoin. 4 | // 5 | // Bytecoin is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Bytecoin is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Bytecoin. If not, see . 17 | 18 | #include "crypto/crypto-ops-data.c" 19 | -------------------------------------------------------------------------------- /tests/crypto/crypto-ops.c: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Bytecoin. 4 | // 5 | // Bytecoin is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Bytecoin is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Bytecoin. If not, see . 17 | 18 | #include "crypto/crypto-ops.c" 19 | -------------------------------------------------------------------------------- /tests/crypto/hash.c: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Bytecoin. 4 | // 5 | // Bytecoin is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Bytecoin is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Bytecoin. If not, see . 17 | 18 | #include "crypto/hash.c" 19 | #include "crypto/keccak.c" 20 | -------------------------------------------------------------------------------- /tests/crypto/random.c: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2016, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Bytecoin. 4 | // 5 | // Bytecoin is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Bytecoin is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Bytecoin. If not, see . 17 | 18 | #include "crypto/random.c" 19 | 20 | #include "crypto-tests.h" 21 | 22 | void setup_random(void) { 23 | memset(&state, 42, sizeof(union hash_state)); 24 | } 25 | -------------------------------------------------------------------------------- /utils/munin_plugins/alt_blocks_count: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | case $1 in 4 | config) 5 | cat <<'EOM' 6 | graph_title alt_blocks_count 7 | graph_vlabel alt_blocks_count 8 | graph_category bytecoin 9 | alt_blocks_count.label alt_blocks_count 10 | EOM 11 | exit 0;; 12 | esac 13 | 14 | printf "alt_blocks_count.value " 15 | /home/user/bytecoin_bin/connectivity_tool --ip=127.0.0.1 --rpc_port=8081 --timeout=1000 --rpc_get_daemon_info | grep alt_blocks_count | cut -d ' ' -f2 16 | -------------------------------------------------------------------------------- /utils/munin_plugins/difficulty: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | case $1 in 4 | config) 5 | cat <<'EOM' 6 | graph_title difficulty 7 | graph_vlabel difficulty 8 | graph_category bytecoin 9 | difficulty.label difficulty 10 | EOM 11 | exit 0;; 12 | esac 13 | 14 | printf "difficulty.value " 15 | /home/user/bytecoin_bin/connectivity_tool --ip=127.0.0.1 --rpc_port=8081 --timeout=1000 --rpc_get_daemon_info | grep difficulty | cut -d ' ' -f2 16 | -------------------------------------------------------------------------------- /utils/munin_plugins/grey_peerlist_size: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | case $1 in 4 | config) 5 | cat <<'EOM' 6 | graph_title grey_peerlist_size 7 | graph_vlabel grey_peerlist_size 8 | graph_category bytecoin 9 | grey_peerlist_size.label grey_peerlist_size 10 | EOM 11 | exit 0;; 12 | esac 13 | 14 | printf "grey_peerlist_size.value " 15 | /home/user/bytecoin_bin/connectivity_tool --ip=127.0.0.1 --rpc_port=8081 --timeout=1000 --rpc_get_daemon_info | grep grey_peerlist_size | cut -d ' ' -f2 16 | -------------------------------------------------------------------------------- /utils/munin_plugins/height: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | case $1 in 4 | config) 5 | cat <<'EOM' 6 | graph_title Height 7 | graph_vlabel height 8 | graph_category bytecoin 9 | height.label height 10 | height.type COUNTER 11 | EOM 12 | exit 0;; 13 | esac 14 | 15 | printf "height.value " 16 | /home/user/bytecoin_bin/connectivity_tool --ip=127.0.0.1 --rpc_port=8081 --timeout=1000 --rpc_get_daemon_info | grep height | cut -d ' ' -f2 17 | -------------------------------------------------------------------------------- /utils/munin_plugins/incoming_connections_count: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | case $1 in 4 | config) 5 | cat <<'EOM' 6 | graph_title incoming_connections_count 7 | graph_vlabel incoming_connections_count 8 | graph_category bytecoin 9 | incoming_connections_count.label incoming_connections_count 10 | EOM 11 | exit 0;; 12 | esac 13 | 14 | printf "incoming_connections_count.value " 15 | /home/user/bytecoin_bin/connectivity_tool --ip=127.0.0.1 --rpc_port=8081 --timeout=1000 --rpc_get_daemon_info | grep incoming_connections_count | cut -d ' ' -f2 16 | -------------------------------------------------------------------------------- /utils/munin_plugins/outgoing_connections_count: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | case $1 in 4 | config) 5 | cat <<'EOM' 6 | graph_title outgoing_connections_count 7 | graph_vlabel outgoing_connections_count 8 | graph_category bytecoin 9 | outgoing_connections_count.label outgoing_connections_count 10 | EOM 11 | exit 0;; 12 | esac 13 | 14 | printf "outgoing_connections_count.value " 15 | /home/user/bytecoin_bin/connectivity_tool --ip=127.0.0.1 --rpc_port=8081 --timeout=1000 --rpc_get_daemon_info | grep outgoing_connections_count | cut -d ' ' -f2 16 | -------------------------------------------------------------------------------- /utils/munin_plugins/tx_count: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | case $1 in 4 | config) 5 | cat <<'EOM' 6 | graph_title tx_count 7 | graph_vlabel tx_count 8 | graph_category bytecoin 9 | tx_count.label tx_count 10 | tx_count.type COUNTER 11 | EOM 12 | exit 0;; 13 | esac 14 | 15 | printf "tx_count.value " 16 | /home/user/bytecoin_bin/connectivity_tool --ip=127.0.0.1 --rpc_port=8081 --timeout=1000 --rpc_get_daemon_info | grep tx_count| cut -d ' ' -f2 17 | -------------------------------------------------------------------------------- /utils/munin_plugins/tx_pool_size: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | case $1 in 4 | config) 5 | cat <<'EOM' 6 | graph_title tx_pool_size 7 | graph_vlabel tx_pool_size 8 | graph_category bytecoin 9 | tx_pool_size.label tx_pool_size 10 | EOM 11 | exit 0;; 12 | esac 13 | 14 | printf "tx_pool_size.value " 15 | /home/user/bytecoin_bin/connectivity_tool --ip=127.0.0.1 --rpc_port=8081 --timeout=1000 --rpc_get_daemon_info | grep tx_pool_size| cut -d ' ' -f2 16 | -------------------------------------------------------------------------------- /utils/munin_plugins/white_peerlist_size: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | case $1 in 4 | config) 5 | cat <<'EOM' 6 | graph_title white_peerlist_size 7 | graph_vlabel white_peerlist_size 8 | graph_category bytecoin 9 | white_peerlist_size.label white_peerlist_size 10 | EOM 11 | exit 0;; 12 | esac 13 | 14 | printf "white_peerlist_size.value " 15 | /home/user/bytecoin_bin/connectivity_tool --ip=127.0.0.1 --rpc_port=8081 --timeout=1000 --rpc_get_daemon_info | grep white_peerlist_size | cut -d ' ' -f2 16 | -------------------------------------------------------------------------------- /utils/systemd/pluracoind.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=PluraCoin PLURA service 3 | After=network.target 4 | 5 | [Service] 6 | Type=oneshot 7 | User=pluracoin 8 | Group=pluracoin 9 | PermissionsStartOnly=true 10 | RemainAfterExit=yes 11 | ExecStartPre=-/bin/mkdir -p /var/run/pluracoin 12 | ExecStartPre=/bin/chown -R pluracoin:pluracoin /var/run/pluracoin/ 13 | ExecStart=/usr/lib/pluracoin/pluracoind.sh --start 14 | ExecStop=/usr/lib/pluracoin/pluracoind.sh --stop 15 | 16 | [Install] 17 | WantedBy=multi-user.target 18 | -------------------------------------------------------------------------------- /utils/test-static-assert.c: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2014, The CryptoNote developers, The Bytecoin developers 2 | // 3 | // This file is part of Bytecoin. 4 | // 5 | // Bytecoin is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Bytecoin is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Bytecoin. If not, see . 17 | 18 | #include 19 | 20 | static_assert(1, "FAIL"); 21 | int main(int argc, char *argv[]) { 22 | return 0; 23 | } --------------------------------------------------------------------------------