Skip to content

Commit

Permalink
Multi-signatures added
Browse files Browse the repository at this point in the history
  • Loading branch information
Antonio Juarez committed Aug 13, 2014
1 parent ce6a3be commit 4363a9f
Show file tree
Hide file tree
Showing 197 changed files with 17,943 additions and 5,921 deletions.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ if(MSVC)
# set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Dinline=__inline")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /STACK:10485760")
if(STATIC)
foreach(VAR CMAKE_C_FLAGS_DEBUG CMAKE_CXX_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE CMAKE_CXX_FLAGS_RELEASE)
foreach(VAR CMAKE_C_FLAGS_DEBUG CMAKE_CXX_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE CMAKE_CXX_FLAGS_RELEASE CMAKE_C_FLAGS_RELWITHDEBINFO CMAKE_CXX_FLAGS_RELWITHDEBINFO)
string(REPLACE "/MD" "/MT" ${VAR} "${${VAR}}")
endforeach()
endif()
Expand Down Expand Up @@ -122,6 +122,7 @@ else()
endif()
endif()

add_subdirectory(contrib)
add_subdirectory(external)
add_subdirectory(src)
add_subdirectory(tests)
12 changes: 12 additions & 0 deletions ReleaseNotes.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
Release notes 1.0.0

- Multi-signatures
- Updated block reward scheme
- Further optimization in daemon RAM consumption
- Faster wallet refresh
- Transaction priority based on tx fee
- Transactions are returned from tx pools after 24 hours
- Dynamic maximum block size limit
- Reduced default transaction fee
- Various network health updates

Release notes 0.8.11

- Increased minimum transaction fee
Expand Down
7 changes: 7 additions & 0 deletions contrib/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
file(GLOB_RECURSE EPEE epee/include/*)

source_group(epee FILES ${EPEE})

add_library(epee ${EPEE})

set_property(TARGET epee PROPERTY FOLDER "external")
3 changes: 0 additions & 3 deletions contrib/epee/demo/demo_levin_server/stdafx.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,4 @@

#define BOOST_FILESYSTEM_VERSION 3
#define ENABLE_RELEASE_LOGGING
#include "log_opt_defs.h"
#include "misc_log_ex.h"


59 changes: 15 additions & 44 deletions contrib/epee/include/console_handler.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@
#include <mutex>
#include <thread>

#include <boost/algorithm/string/classification.hpp>
#include <boost/algorithm/string/split.hpp>

#include "string_tools.h"

namespace epee
{
class async_stdin_reader
Expand Down Expand Up @@ -294,7 +299,7 @@ namespace epee
bool start_default_console(t_server* ptsrv, t_handler handlr, const std::string& prompt, const std::string& usage = "")
{
std::shared_ptr<async_console_handler> console_handler = std::make_shared<async_console_handler>();
boost::thread([=](){console_handler->run<t_server, t_handler>(ptsrv, handlr, prompt, usage);}).detach();
std::thread([=](){console_handler->run<t_server, t_handler>(ptsrv, handlr, prompt, usage);}).detach();
return true;
}

Expand All @@ -314,46 +319,24 @@ namespace epee
bool run_default_console_handler_no_srv_param(t_server* ptsrv, t_handler handlr, const std::string& prompt, const std::string& usage = "")
{
async_console_handler console_handler;
return console_handler.run(ptsrv, boost::bind<bool>(no_srv_param_adapter<t_server, t_handler>, _1, _2, handlr), prompt, usage);
return console_handler.run(ptsrv, std::bind<bool>(no_srv_param_adapter<t_server, t_handler>, std::placeholders::_1, std::placeholders::_2, handlr), prompt, usage);
}

template<class t_server, class t_handler>
bool start_default_console_handler_no_srv_param(t_server* ptsrv, t_handler handlr, const std::string& prompt, const std::string& usage = "")
{
boost::thread( boost::bind(run_default_console_handler_no_srv_param<t_server, t_handler>, ptsrv, handlr, prompt, usage) );
std::thread( std::bind(run_default_console_handler_no_srv_param<t_server, t_handler>, ptsrv, handlr, prompt, usage) );
return true;
}

/*template<class a>
bool f(int i, a l)
{
return true;
}*/
/*
template<class chain_handler>
bool default_console_handler2(chain_handler ch_handler, const std::string usage)
*/


/*template<class t_handler>
bool start_default_console2(t_handler handlr, const std::string& usage = "")
{
//std::string usage_local = usage;
boost::thread( boost::bind(default_console_handler2<t_handler>, handlr, usage) );
//boost::function<bool ()> p__ = boost::bind(f<t_handler>, 1, handlr);
//boost::function<bool ()> p__ = boost::bind(default_console_handler2<t_handler>, handlr, usage);
//boost::thread tr(p__);
return true;
}*/

/************************************************************************/
/* */
/************************************************************************/
class console_handlers_binder
{
typedef boost::function<bool (const std::vector<std::string> &)> console_command_handler;
typedef std::function<bool (const std::vector<std::string> &)> console_command_handler;
typedef std::map<std::string, std::pair<console_command_handler, std::string> > command_handlers_map;
std::unique_ptr<boost::thread> m_console_thread;
std::unique_ptr<std::thread> m_console_thread;
command_handlers_map m_command_handlers;
async_console_handler m_console_handler;
public:
Expand Down Expand Up @@ -396,16 +379,9 @@ namespace epee
return process_command_vec(cmd_v);
}

/*template<class t_srv>
bool start_handling(t_srv& srv, const std::string& usage_string = "")
{
start_default_console_handler_no_srv_param(&srv, boost::bind(&console_handlers_binder::process_command_str, this, _1));
return true;
}*/

bool start_handling(const std::string& prompt, const std::string& usage_string = "")
{
m_console_thread.reset(new boost::thread(boost::bind(&console_handlers_binder::run_handling, this, prompt, usage_string)));
m_console_thread.reset(new std::thread(std::bind(&console_handlers_binder::run_handling, this, prompt, usage_string)));
m_console_thread->detach();
return true;
}
Expand All @@ -417,14 +393,8 @@ namespace epee

bool run_handling(const std::string& prompt, const std::string& usage_string)
{
return m_console_handler.run(boost::bind(&console_handlers_binder::process_command_str, this, _1), prompt, usage_string);
return m_console_handler.run(std::bind(&console_handlers_binder::process_command_str, this, std::placeholders::_1), prompt, usage_string);
}

/*template<class t_srv>
bool run_handling(t_srv& srv, const std::string& usage_string)
{
return run_default_console_handler_no_srv_param(&srv, boost::bind<bool>(&console_handlers_binder::process_command_str, this, _1), usage_string);
}*/
};

/* work around because of broken boost bind */
Expand All @@ -438,13 +408,14 @@ namespace epee
public:
bool start_handling(t_server* psrv, const std::string& prompt, const std::string& usage_string = "")
{
boost::thread(boost::bind(&srv_console_handlers_binder<t_server>::run_handling, this, psrv, prompt, usage_string)).detach();
std::thread(std::bind(&srv_console_handlers_binder<t_server>::run_handling, this, psrv, prompt, usage_string)).detach();
return true;
}

bool run_handling(t_server* psrv, const std::string& prompt, const std::string& usage_string)
{
return m_console_handler.run(psrv, boost::bind(&srv_console_handlers_binder<t_server>::process_command_str, this, _1, _2), prompt, usage_string);
return m_console_handler.run(psrv, std::bind(&srv_console_handlers_binder<t_server>::process_command_str, this,
std::placeholders::_1, std::placeholders::_2), prompt, usage_string);
}

void stop_handling()
Expand Down
13 changes: 5 additions & 8 deletions contrib/epee/include/file_io_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,7 @@
#ifndef _FILE_IO_UTILS_H_
#define _FILE_IO_UTILS_H_


//#include <sys/types.h>
//#include <sys/stat.h>

#include <fstream>
#include <iostream>
#include <boost/filesystem.hpp>

Expand Down Expand Up @@ -75,7 +72,7 @@ namespace file_io_utils

#ifdef BOOST_LEXICAL_CAST_INCLUDED
inline
bool get_not_used_filename(const std::string& folder, OUT std::string& result_name)
bool get_not_used_filename(const std::string& folder, std::string& result_name)
{
DWORD folder_attr = ::GetFileAttributesA(folder.c_str());
if(folder_attr == INVALID_FILE_ATTRIBUTES)
Expand Down Expand Up @@ -302,7 +299,7 @@ namespace file_io_utils
}
*/
inline
bool get_file_time(const std::string& path_to_file, OUT time_t& ft)
bool get_file_time(const std::string& path_to_file, time_t& ft)
{
boost::system::error_code ec;
ft = boost::filesystem::last_write_time(boost::filesystem::path(path_to_file), ec);
Expand Down Expand Up @@ -408,7 +405,7 @@ namespace file_io_utils
}
*/
#ifdef WINDOWS_PLATFORM
inline bool get_folder_content(const std::string& path, std::list<WIN32_FIND_DATAA>& OUT target_list)
inline bool get_folder_content(const std::string& path, std::list<WIN32_FIND_DATAA>& target_list)
{
WIN32_FIND_DATAA find_data = {0};
HANDLE hfind = ::FindFirstFileA((path + "\\*.*").c_str(), &find_data);
Expand All @@ -426,7 +423,7 @@ namespace file_io_utils
return true;
}
#endif
inline bool get_folder_content(const std::string& path, std::list<std::string>& OUT target_list, bool only_files = false)
inline bool get_folder_content(const std::string& path, std::list<std::string>& target_list, bool only_files = false)
{
try
{
Expand Down
1 change: 1 addition & 0 deletions contrib/epee/include/math_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include <boost/uuid/random_generator.hpp>

#include "misc_os_dependent.h"
#include "pragma_comp_defs.h"

namespace epee
{
Expand Down
Loading

0 comments on commit 4363a9f

Please sign in to comment.