diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..aefb630 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +#KDevelop4 IDE files +*.kdev4 diff --git a/CMakeLists.txt b/CMakeLists.txt index 8e2ccca..034a7a1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,6 +12,14 @@ SET(MINOR_VERSION 1) SET(PATCH_VERSION 0) SET(SO_VERSION 0) +if(CMAKE_SIZEOF_VOID_P EQUAL 8) + set(LIB_SUFFIX 64) + MESSAGE( "64 bit compiler detected" ) +else() + set(LIB_SUFFIX "") + MESSAGE( "32 bit compiler detected" ) +endif() + # Add source directory ADD_SUBDIRECTORY(src/bitcoinapi) diff --git a/cmake/FindJSONCPP.cmake b/cmake/FindJSONCPP.cmake index 64bc183..bdb7bc4 100644 --- a/cmake/FindJSONCPP.cmake +++ b/cmake/FindJSONCPP.cmake @@ -12,7 +12,7 @@ FIND_PATH(JSONCPP_INCLUDE_DIRS json.h /usr/include /usr/local/include ${CMAKE_SOURCE_DIR}/win32-deps/include -PATH_SUFFIXES jsoncpp/json jsoncpp +PATH_SUFFIXES jsoncpp/json jsoncpp json ) diff --git a/src/bitcoinapi/CMakeLists.txt b/src/bitcoinapi/CMakeLists.txt index 1838b24..5ce3111 100644 --- a/src/bitcoinapi/CMakeLists.txt +++ b/src/bitcoinapi/CMakeLists.txt @@ -36,5 +36,5 @@ SET_TARGET_PROPERTIES(bitcoinapi bitcoinapi_static PROPERTIES INSTALL(FILES ${bitcoinapi_header} DESTINATION include/bitcoinapi) INSTALL(TARGETS bitcoinapi bitcoinapi_static - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib) + LIBRARY DESTINATION lib${LIB_SUFFIX} + ARCHIVE DESTINATION lib${LIB_SUFFIX}) diff --git a/src/bitcoinapi/bitcoinapi.cpp b/src/bitcoinapi/bitcoinapi.cpp index cc12ab0..d259ec0 100644 --- a/src/bitcoinapi/bitcoinapi.cpp +++ b/src/bitcoinapi/bitcoinapi.cpp @@ -55,7 +55,7 @@ int BitcoinAPI::StringToNumber (const string &text){ return ss >> result ? result : 0; } -Value BitcoinAPI::sendcommand(const string& command, const Value& params){ +Value BitcoinAPI::sendcommand(const string& command, const Value& params){ Value result; try{ @@ -571,6 +571,7 @@ vector BitcoinAPI::listtransactions() { tmp.time = val["time"].asInt(); tmp.timereceived = val["timereceived"].asInt(); + tmp.vout = val["vout"].asInt(); ret.push_back(tmp); } @@ -609,6 +610,7 @@ vector BitcoinAPI::listtransactions(const string& account, in tmp.time = val["time"].asInt(); tmp.timereceived = val["timereceived"].asInt(); + tmp.vout = val["vout"].asInt(); ret.push_back(tmp); } @@ -1018,6 +1020,7 @@ txsinceblock_t BitcoinAPI::listsinceblock(const string& blockhash, int target_co tmp.time = val["time"].asInt(); tmp.timereceived = val["timereceived"].asInt(); + tmp.vout = val["vout"].asInt(); ret.transactions.push_back(tmp); } diff --git a/src/bitcoinapi/exception.h b/src/bitcoinapi/exception.h index f4ff324..3a488ee 100644 --- a/src/bitcoinapi/exception.h +++ b/src/bitcoinapi/exception.h @@ -13,9 +13,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include using Json::Value; @@ -31,11 +31,11 @@ class BitcoinException: public std::exception public: explicit BitcoinException(int errcode, const std::string& message) { - + /* Connection error */ if(errcode == Errors::ERROR_CLIENT_CONNECTOR){ this->code = errcode; - this->msg = removePrefix(message, " -> "); + this->msg = removePrefix(message, " -> "); /* Authentication error */ }else if(errcode == Errors::ERROR_RPC_INTERNAL_ERROR && message.size() == 18){ this->code = errcode; diff --git a/src/bitcoinapi/types.h b/src/bitcoinapi/types.h index 5051914..7b50779 100644 --- a/src/bitcoinapi/types.h +++ b/src/bitcoinapi/types.h @@ -13,7 +13,7 @@ #include #include -#include +#include /* === General types === */ struct getinfo_t{ @@ -86,6 +86,7 @@ std::vector walletconflicts; int time; int timereceived; + int vout; }; struct multisig_t{