From b7ccd48dd8dd2fb5c37f81e734673e998fd2d78a Mon Sep 17 00:00:00 2001 From: s_nakamoto Date: Thu, 25 Nov 2010 16:40:25 +0000 Subject: [PATCH 1/3] still working on account-based commands getbalance, move and sendfrom, they're only for testing for now git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@190 1a98c847-1fd6-4fd8-948a-caf3550aa51b --- rpc.cpp | 2 ++ serialize.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/rpc.cpp b/rpc.cpp index 113de85a..422113a4 100644 --- a/rpc.cpp +++ b/rpc.cpp @@ -628,6 +628,8 @@ Value getbalance(const Array& params, bool fHelp) if (params.size() == 0) return ((double)GetBalance() / (double)COIN); + throw runtime_error("under construction"); //// to be released soon + string strAccount = params[0].get_str(); int nMinDepth = 1; if (params.size() > 1) diff --git a/serialize.h b/serialize.h index a289769f..a3cfa9c0 100644 --- a/serialize.h +++ b/serialize.h @@ -22,7 +22,7 @@ class CDataStream; class CAutoFile; static const unsigned int MAX_SIZE = 0x02000000; -static const int VERSION = 31601; +static const int VERSION = 31602; static const char* pszSubVer = ""; From 24324d83e8d9f0b9403ca1c333b594b77eaefb4c Mon Sep 17 00:00:00 2001 From: s_nakamoto Date: Thu, 25 Nov 2010 20:41:57 +0000 Subject: [PATCH 2/3] -- version 0.3.17 release git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@191 1a98c847-1fd6-4fd8-948a-caf3550aa51b --- build-unix.txt | 3 ++- rpc.cpp | 4 ++++ serialize.h | 2 +- setup.nsi | 6 +++--- ui.cpp | 3 +++ 5 files changed, 13 insertions(+), 5 deletions(-) diff --git a/build-unix.txt b/build-unix.txt index cb8c3ae1..7e0d8fe2 100644 --- a/build-unix.txt +++ b/build-unix.txt @@ -21,7 +21,8 @@ or Boost 1.37: sudo apt-get install libboost1.37-dev If using Boost 1.37, append -mt to the boost libraries in the makefile. -We're now using wxWidgets 2.9, which uses UTF-8. Don't try 2.8, it won't work. +We're using wxWidgets 2.9.0, which uses UTF-8. Don't try 2.8, it won't work. +The build hasn't been updated to work with wxWidgets 2.9.1 yet. You need to download wxWidgets from http://www.wxwidgets.org/downloads/ and build it yourself. See the build instructions and configure parameters diff --git a/rpc.cpp b/rpc.cpp index 422113a4..a7066ab3 100644 --- a/rpc.cpp +++ b/rpc.cpp @@ -648,6 +648,8 @@ Value movecmd(const Array& params, bool fHelp) "move [minconf=1] [comment]\n" "Move from one account in your wallet to another."); + throw runtime_error("under construction"); + string strFrom = params[0].get_str(); string strTo = params[1].get_str(); int64 nAmount = AmountFromValue(params[2]); @@ -709,6 +711,8 @@ Value sendfrom(const Array& params, bool fHelp) "sendfrom [minconf=1] [comment] [comment-to]\n" " is a real and is rounded to the nearest 0.01"); + throw runtime_error("under construction"); + string strAccount = params[0].get_str(); string strAddress = params[1].get_str(); int64 nAmount = AmountFromValue(params[2]); diff --git a/serialize.h b/serialize.h index a3cfa9c0..5bf2fb63 100644 --- a/serialize.h +++ b/serialize.h @@ -22,7 +22,7 @@ class CDataStream; class CAutoFile; static const unsigned int MAX_SIZE = 0x02000000; -static const int VERSION = 31602; +static const int VERSION = 31700; static const char* pszSubVer = ""; diff --git a/setup.nsi b/setup.nsi index e999b6e1..1cb00549 100644 --- a/setup.nsi +++ b/setup.nsi @@ -7,7 +7,7 @@ RequestExecutionLevel highest # General Symbol Definitions !define REGKEY "SOFTWARE\$(^Name)" -!define VERSION 0.3.15 +!define VERSION 0.3.17 !define COMPANY "Bitcoin project" !define URL http://www.bitcoin.org/ @@ -42,12 +42,12 @@ Var StartMenuGroup !insertmacro MUI_LANGUAGE English # Installer attributes -OutFile bitcoin-0.3.15-win32-setup.exe +OutFile bitcoin-0.3.17-win32-setup.exe InstallDir $PROGRAMFILES\Bitcoin CRCCheck on XPStyle on ShowInstDetails show -VIProductVersion 0.3.15.0 +VIProductVersion 0.3.17.0 VIAddVersionKey ProductName Bitcoin VIAddVersionKey ProductVersion "${VERSION}" VIAddVersionKey CompanyName "${COMPANY}" diff --git a/ui.cpp b/ui.cpp index aafd4a7a..321214fe 100644 --- a/ui.cpp +++ b/ui.cpp @@ -1631,6 +1631,9 @@ COptionsDialog::COptionsDialog(wxWindow* parent) : COptionsDialogBase(parent) //m_listBox->Append(_("Test 2")); m_listBox->SetSelection(0); SelectPage(0); +#ifndef __WXMSW__ + SetSize(1.0 * GetSize().GetWidth(), 1.2 * GetSize().GetHeight()); +#endif #if defined(__WXGTK__) || defined(__WXMAC_OSX__) m_checkBoxStartOnSystemStartup->SetLabel(_("&Start Bitcoin on window system startup")); if (!mapArgs.count("-minimizetotray")) From 84d7c981dc52cc738053f9ec48648ab6fbf9311b Mon Sep 17 00:00:00 2001 From: s_nakamoto Date: Sat, 27 Nov 2010 23:12:41 +0000 Subject: [PATCH 3/3] added boost tuples to serialize.h git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@192 1a98c847-1fd6-4fd8-948a-caf3550aa51b --- db.cpp | 4 +-- serialize.h | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 81 insertions(+), 3 deletions(-) diff --git a/db.cpp b/db.cpp index c768778c..2833a8be 100644 --- a/db.cpp +++ b/db.cpp @@ -592,7 +592,7 @@ bool CWalletDB::WriteAccount(const string& strAccount, const CAccount& account) bool CWalletDB::WriteAccountingEntry(const string& strAccount, const CAccountingEntry& acentry) { - return Write(make_pair(string("acentry"), make_pair(strAccount, ++nAccountingEntryNumber)), acentry); + return Write(make_tuple(string("acentry"), strAccount, ++nAccountingEntryNumber), acentry); } int64 CWalletDB::GetAccountCreditDebit(const string& strAccount) @@ -608,7 +608,7 @@ int64 CWalletDB::GetAccountCreditDebit(const string& strAccount) // Read next record CDataStream ssKey; if (fFlags == DB_SET_RANGE) - ssKey << make_pair(string("acentry"), make_pair(strAccount, uint64(0))); + ssKey << make_tuple(string("acentry"), strAccount, uint64(0)); CDataStream ssValue; int ret = ReadAtCursor(pcursor, ssKey, ssValue, fFlags); fFlags = DB_NEXT; diff --git a/serialize.h b/serialize.h index 5bf2fb63..3debdf08 100644 --- a/serialize.h +++ b/serialize.h @@ -7,6 +7,9 @@ #include #include #include +#include +#include +#include #if defined(_MSC_VER) || defined(__BORLANDC__) typedef __int64 int64; typedef unsigned __int64 uint64; @@ -22,7 +25,7 @@ class CDataStream; class CAutoFile; static const unsigned int MAX_SIZE = 0x02000000; -static const int VERSION = 31700; +static const int VERSION = 31701; static const char* pszSubVer = ""; @@ -338,6 +341,16 @@ template unsigned int GetSerializeSize(const std::pair void Serialize(Stream& os, const std::pair& item, int nType, int nVersion=VERSION); template void Unserialize(Stream& is, std::pair& item, int nType, int nVersion=VERSION); +// 3 tuple +template unsigned int GetSerializeSize(const boost::tuple& item, int nType, int nVersion=VERSION); +template void Serialize(Stream& os, const boost::tuple& item, int nType, int nVersion=VERSION); +template void Unserialize(Stream& is, boost::tuple& item, int nType, int nVersion=VERSION); + +// 4 tuple +template unsigned int GetSerializeSize(const boost::tuple& item, int nType, int nVersion=VERSION); +template void Serialize(Stream& os, const boost::tuple& item, int nType, int nVersion=VERSION); +template void Unserialize(Stream& is, boost::tuple& item, int nType, int nVersion=VERSION); + // map template unsigned int GetSerializeSize(const std::map& m, int nType, int nVersion=VERSION); template void Serialize(Stream& os, const std::map& m, int nType, int nVersion=VERSION); @@ -554,6 +567,71 @@ void Unserialize(Stream& is, std::pair& item, int nType, int nVersion) +// +// 3 tuple +// +template +unsigned int GetSerializeSize(const boost::tuple& item, int nType, int nVersion) +{ + unsigned int nSize = 0; + nSize += GetSerializeSize(get<0>(item), nType, nVersion); + nSize += GetSerializeSize(get<1>(item), nType, nVersion); + nSize += GetSerializeSize(get<2>(item), nType, nVersion); + return nSize; +} + +template +void Serialize(Stream& os, const boost::tuple& item, int nType, int nVersion) +{ + Serialize(os, get<0>(item), nType, nVersion); + Serialize(os, get<1>(item), nType, nVersion); + Serialize(os, get<2>(item), nType, nVersion); +} + +template +void Unserialize(Stream& is, boost::tuple& item, int nType, int nVersion) +{ + Unserialize(is, get<0>(item), nType, nVersion); + Unserialize(is, get<1>(item), nType, nVersion); + Unserialize(is, get<2>(item), nType, nVersion); +} + + + +// +// 4 tuple +// +template +unsigned int GetSerializeSize(const boost::tuple& item, int nType, int nVersion) +{ + unsigned int nSize = 0; + nSize += GetSerializeSize(get<0>(item), nType, nVersion); + nSize += GetSerializeSize(get<1>(item), nType, nVersion); + nSize += GetSerializeSize(get<2>(item), nType, nVersion); + nSize += GetSerializeSize(get<3>(item), nType, nVersion); + return nSize; +} + +template +void Serialize(Stream& os, const boost::tuple& item, int nType, int nVersion) +{ + Serialize(os, get<0>(item), nType, nVersion); + Serialize(os, get<1>(item), nType, nVersion); + Serialize(os, get<2>(item), nType, nVersion); + Serialize(os, get<3>(item), nType, nVersion); +} + +template +void Unserialize(Stream& is, boost::tuple& item, int nType, int nVersion) +{ + Unserialize(is, get<0>(item), nType, nVersion); + Unserialize(is, get<1>(item), nType, nVersion); + Unserialize(is, get<2>(item), nType, nVersion); + Unserialize(is, get<3>(item), nType, nVersion); +} + + + // // map //