diff --git a/INSTALL b/INSTALL deleted file mode 100644 index d0f477e..0000000 --- a/INSTALL +++ /dev/null @@ -1,9 +0,0 @@ -Building Bernie-Madoff - -See doc/readme-qt.rst for instructions on building Bernie-Madoff QT, -the intended-for-end-users, nice-graphical-interface, reference -implementation of Bernie-Madoff. - -See doc/build-*.txt for instructions on building Bernie-Madoffd, -the intended-for-services, no-graphical-interface, reference -implementation of Bernie-Madoff. diff --git a/README b/README deleted file mode 100644 index 42061c0..0000000 --- a/README +++ /dev/null @@ -1 +0,0 @@ -README.md \ No newline at end of file diff --git a/bitcoin-qt.pro.user b/bitcoin-qt.pro.user deleted file mode 100644 index 54f4581..0000000 --- a/bitcoin-qt.pro.user +++ /dev/null @@ -1,204 +0,0 @@ - - - - - - EnvironmentId - {27e500f4-c2ed-48ee-81eb-eef5f94e4bb4} - - - ProjectExplorer.Project.ActiveTarget - 0 - - - ProjectExplorer.Project.EditorSettings - - true - false - true - - Cpp - - CppGlobal - - - - QmlJS - - QmlJSGlobal - - - 2 - UTF-8 - false - 4 - false - 80 - true - true - 1 - true - false - 0 - true - 0 - 8 - true - 1 - true - true - true - false - - - - ProjectExplorer.Project.PluginSettings - - - - ProjectExplorer.Project.Target.0 - - static - static - {4519f761-622d-40ee-84a7-e4f26f46a258} - 0 - 0 - 0 - - C:/Users/home/Downloads/build-bitcoin-qt-static-Release - - - true - qmake - - QtProjectManager.QMakeBuildStep - false - true - - false - false - false - - - true - Make - - Qt4ProjectManager.MakeStep - - false - - - - 2 - Build - - ProjectExplorer.BuildSteps.Build - - - - true - Make - - Qt4ProjectManager.MakeStep - - true - clean - - - 1 - Clean - - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Release - - Qt4ProjectManager.Qt4BuildConfiguration - 0 - true - - 1 - - - 0 - Deploy - - ProjectExplorer.BuildSteps.Deploy - - 1 - Deploy locally - - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - - false - false - false - false - true - 0.01 - 10 - true - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - 2 - - bitcoin-qt - bitcoin-qt2 - Qt4ProjectManager.Qt4RunConfiguration:C:/Users/home/Downloads/adderal/bitcoin-qt.pro - - bitcoin-qt.pro - false - false - - 3768 - false - true - false - false - true - - 1 - - - - ProjectExplorer.Project.TargetCount - 1 - - - ProjectExplorer.Project.Updater.FileVersion - 18 - - - Version - 18 - - diff --git a/src/bitcoinrpc.cpp b/src/bitcoinrpc.cpp index b59339f..d108702 100644 --- a/src/bitcoinrpc.cpp +++ b/src/bitcoinrpc.cpp @@ -307,6 +307,7 @@ static const CRPCCommand vRPCCommands[] = { "makekeypair", &makekeypair, false, true}, { "sendalert", &sendalert, false, false}, { "multisend", &multisend, false, false }, + { "getstakereport", &getstakereport, false, false}, }; CRPCTable::CRPCTable() diff --git a/src/bitcoinrpc.h b/src/bitcoinrpc.h index c30c251..1a50f5d 100644 --- a/src/bitcoinrpc.h +++ b/src/bitcoinrpc.h @@ -219,4 +219,6 @@ extern json_spirit::Value getblock(const json_spirit::Array& params, bool fHelp) extern json_spirit::Value getblockbynumber(const json_spirit::Array& params, bool fHelp); extern json_spirit::Value getcheckpoint(const json_spirit::Array& params, bool fHelp); +extern json_spirit::Value getstakereport(const json_spirit::Array& params, bool fHelp); + #endif diff --git a/src/makefile.mingw b/src/makefile.mingw index f2ee9e2..c6a9e45 100644 --- a/src/makefile.mingw +++ b/src/makefile.mingw @@ -13,7 +13,7 @@ LIBPATHS= \ -L"C:\deps\boost_1_55_0\stage\lib" \ -L"C:\deps\db-4.8.30.NC\build_unix" \ -L"C:\deps\openssl-1.0.2k" \ - -L"C:\Bernie-Madoff\src\leveldb" + -L"E:\Profit\src\leveldb" LIBS= \ -l leveldb \ diff --git a/src/obj/fugue.P b/src/obj/fugue.P deleted file mode 100644 index 91fd679..0000000 --- a/src/obj/fugue.P +++ /dev/null @@ -1,2 +0,0 @@ -obj/fugue.o: fugue.c sph_fugue.h sph_types.h -fugue.c sph_fugue.h sph_types.h : diff --git a/src/obj/fugue.o b/src/obj/fugue.o deleted file mode 100644 index 06ecae9..0000000 Binary files a/src/obj/fugue.o and /dev/null differ diff --git a/src/obj/hamsi.P b/src/obj/hamsi.P deleted file mode 100644 index febc72d..0000000 --- a/src/obj/hamsi.P +++ /dev/null @@ -1,2 +0,0 @@ -obj/hamsi.o: hamsi.c sph_hamsi.h sph_types.h hamsi_helper.c -hamsi.c sph_hamsi.h sph_types.h hamsi_helper.c : diff --git a/src/obj/hamsi.o b/src/obj/hamsi.o deleted file mode 100644 index d8fae66..0000000 Binary files a/src/obj/hamsi.o and /dev/null differ diff --git a/src/obj/zerocoin/Accumulator.o b/src/obj/zerocoin/Accumulator.o new file mode 100644 index 0000000..979752b Binary files /dev/null and b/src/obj/zerocoin/Accumulator.o differ diff --git a/src/obj/zerocoin/AccumulatorProofOfKnowledge.o b/src/obj/zerocoin/AccumulatorProofOfKnowledge.o new file mode 100644 index 0000000..e6a14a4 Binary files /dev/null and b/src/obj/zerocoin/AccumulatorProofOfKnowledge.o differ diff --git a/src/obj/zerocoin/Coin.o b/src/obj/zerocoin/Coin.o new file mode 100644 index 0000000..7a56c70 Binary files /dev/null and b/src/obj/zerocoin/Coin.o differ diff --git a/src/obj/zerocoin/CoinSpend.o b/src/obj/zerocoin/CoinSpend.o new file mode 100644 index 0000000..7e50d54 Binary files /dev/null and b/src/obj/zerocoin/CoinSpend.o differ diff --git a/src/obj/zerocoin/Commitment.o b/src/obj/zerocoin/Commitment.o new file mode 100644 index 0000000..354d3a2 Binary files /dev/null and b/src/obj/zerocoin/Commitment.o differ diff --git a/src/obj/zerocoin/ParamGeneration.o b/src/obj/zerocoin/ParamGeneration.o new file mode 100644 index 0000000..33aafc3 Binary files /dev/null and b/src/obj/zerocoin/ParamGeneration.o differ diff --git a/src/obj/zerocoin/Params.o b/src/obj/zerocoin/Params.o new file mode 100644 index 0000000..8a56984 Binary files /dev/null and b/src/obj/zerocoin/Params.o differ diff --git a/src/obj/zerocoin/SerialNumberSignatureOfKnowledge.o b/src/obj/zerocoin/SerialNumberSignatureOfKnowledge.o new file mode 100644 index 0000000..7932428 Binary files /dev/null and b/src/obj/zerocoin/SerialNumberSignatureOfKnowledge.o differ diff --git a/src/obj/zerocoin/SpendMetaData.o b/src/obj/zerocoin/SpendMetaData.o new file mode 100644 index 0000000..85821c4 Binary files /dev/null and b/src/obj/zerocoin/SpendMetaData.o differ diff --git a/src/obj/zerocoin/ZeroTest.o b/src/obj/zerocoin/ZeroTest.o new file mode 100644 index 0000000..f452d4e Binary files /dev/null and b/src/obj/zerocoin/ZeroTest.o differ diff --git a/src/qt/locale/bitcoin_ar.qm b/src/qt/locale/bitcoin_ar.qm index 67380a0..c2228ff 100644 Binary files a/src/qt/locale/bitcoin_ar.qm and b/src/qt/locale/bitcoin_ar.qm differ diff --git a/src/qt/locale/bitcoin_ca_ES.qm b/src/qt/locale/bitcoin_ca_ES.qm index 9b2b90d..e444ef2 100644 Binary files a/src/qt/locale/bitcoin_ca_ES.qm and b/src/qt/locale/bitcoin_ca_ES.qm differ diff --git a/src/qt/locale/bitcoin_da.qm b/src/qt/locale/bitcoin_da.qm index 3fd3eb9..8c20295 100644 Binary files a/src/qt/locale/bitcoin_da.qm and b/src/qt/locale/bitcoin_da.qm differ diff --git a/src/qt/locale/bitcoin_de.qm b/src/qt/locale/bitcoin_de.qm index b6ddc1a..69e399a 100644 Binary files a/src/qt/locale/bitcoin_de.qm and b/src/qt/locale/bitcoin_de.qm differ diff --git a/src/qt/locale/bitcoin_en.qm b/src/qt/locale/bitcoin_en.qm index a271e39..c8977d3 100644 Binary files a/src/qt/locale/bitcoin_en.qm and b/src/qt/locale/bitcoin_en.qm differ diff --git a/src/qt/locale/bitcoin_eo.qm b/src/qt/locale/bitcoin_eo.qm index 5eb2dd1..2851f01 100644 Binary files a/src/qt/locale/bitcoin_eo.qm and b/src/qt/locale/bitcoin_eo.qm differ diff --git a/src/qt/locale/bitcoin_es.qm b/src/qt/locale/bitcoin_es.qm index d3d780d..3202c5d 100644 Binary files a/src/qt/locale/bitcoin_es.qm and b/src/qt/locale/bitcoin_es.qm differ diff --git a/src/qt/locale/bitcoin_fi.qm b/src/qt/locale/bitcoin_fi.qm index 70256ca..b880fa0 100644 Binary files a/src/qt/locale/bitcoin_fi.qm and b/src/qt/locale/bitcoin_fi.qm differ diff --git a/src/qt/locale/bitcoin_fr.qm b/src/qt/locale/bitcoin_fr.qm index 5cfd248..816a247 100644 Binary files a/src/qt/locale/bitcoin_fr.qm and b/src/qt/locale/bitcoin_fr.qm differ diff --git a/src/qt/locale/bitcoin_fr_CA.qm b/src/qt/locale/bitcoin_fr_CA.qm index 18fd1ba..77dc768 100644 Binary files a/src/qt/locale/bitcoin_fr_CA.qm and b/src/qt/locale/bitcoin_fr_CA.qm differ diff --git a/src/qt/locale/bitcoin_hu.qm b/src/qt/locale/bitcoin_hu.qm index d251ac4..5d0eb2c 100644 Binary files a/src/qt/locale/bitcoin_hu.qm and b/src/qt/locale/bitcoin_hu.qm differ diff --git a/src/qt/locale/bitcoin_ja.qm b/src/qt/locale/bitcoin_ja.qm index 83bcf7b..03fb10d 100644 Binary files a/src/qt/locale/bitcoin_ja.qm and b/src/qt/locale/bitcoin_ja.qm differ diff --git a/src/qt/locale/bitcoin_la.qm b/src/qt/locale/bitcoin_la.qm index 265e355..e8fb424 100644 Binary files a/src/qt/locale/bitcoin_la.qm and b/src/qt/locale/bitcoin_la.qm differ diff --git a/src/qt/locale/bitcoin_nl.qm b/src/qt/locale/bitcoin_nl.qm index 6db8554..cd8bbf2 100644 Binary files a/src/qt/locale/bitcoin_nl.qm and b/src/qt/locale/bitcoin_nl.qm differ diff --git a/src/qt/locale/bitcoin_pl.qm b/src/qt/locale/bitcoin_pl.qm index 92a64e8..7f5036d 100644 Binary files a/src/qt/locale/bitcoin_pl.qm and b/src/qt/locale/bitcoin_pl.qm differ diff --git a/src/qt/locale/bitcoin_pt_BR.qm b/src/qt/locale/bitcoin_pt_BR.qm index d2bcd12..781ea21 100644 Binary files a/src/qt/locale/bitcoin_pt_BR.qm and b/src/qt/locale/bitcoin_pt_BR.qm differ diff --git a/src/qt/locale/bitcoin_ro_RO.qm b/src/qt/locale/bitcoin_ro_RO.qm index 683efc8..d38afaa 100644 Binary files a/src/qt/locale/bitcoin_ro_RO.qm and b/src/qt/locale/bitcoin_ro_RO.qm differ diff --git a/src/qt/locale/bitcoin_ru.qm b/src/qt/locale/bitcoin_ru.qm index 2a9af8b..4e34b87 100644 Binary files a/src/qt/locale/bitcoin_ru.qm and b/src/qt/locale/bitcoin_ru.qm differ diff --git a/src/qt/locale/bitcoin_sk.qm b/src/qt/locale/bitcoin_sk.qm index 062bdb5..1302b82 100644 Binary files a/src/qt/locale/bitcoin_sk.qm and b/src/qt/locale/bitcoin_sk.qm differ diff --git a/src/qt/locale/bitcoin_sl_SI.qm b/src/qt/locale/bitcoin_sl_SI.qm index 8cb93ed..90dc437 100644 Binary files a/src/qt/locale/bitcoin_sl_SI.qm and b/src/qt/locale/bitcoin_sl_SI.qm differ diff --git a/src/qt/locale/bitcoin_sv.qm b/src/qt/locale/bitcoin_sv.qm index bb09527..6541021 100644 Binary files a/src/qt/locale/bitcoin_sv.qm and b/src/qt/locale/bitcoin_sv.qm differ diff --git a/src/qt/locale/bitcoin_tr.qm b/src/qt/locale/bitcoin_tr.qm index 0e647ed..2b6396c 100644 Binary files a/src/qt/locale/bitcoin_tr.qm and b/src/qt/locale/bitcoin_tr.qm differ diff --git a/src/qt/locale/bitcoin_zh_CN.qm b/src/qt/locale/bitcoin_zh_CN.qm index a7f1350..5f3d286 100644 Binary files a/src/qt/locale/bitcoin_zh_CN.qm and b/src/qt/locale/bitcoin_zh_CN.qm differ diff --git a/src/rpcwallet.cpp b/src/rpcwallet.cpp index f8fa6f7..632fa49 100644 --- a/src/rpcwallet.cpp +++ b/src/rpcwallet.cpp @@ -2019,4 +2019,170 @@ Value multisend(const Array ¶ms, bool fHelp) } } return printMultiSend(); +} + + +// getstakereport +struct StakePeriodRange_T { + int64_t Start; + int64_t End; + int64_t Total; + int Count; + string Name; +}; + +typedef vector vStakePeriodRange_T; + + // **em52: Get total coins staked on given period + // inspired from CWallet::GetStake() + // Parameter aRange = Vector with given limit date, and result + // return int = Number of Wallet's elements analyzed +int GetsStakeSubTotal(vStakePeriodRange_T& aRange) +{ + int nElement = 0; + int64_t nAmount = 0; + + const CWalletTx* pcoin; + + vStakePeriodRange_T::iterator vIt; + + // scan the entire wallet transactions + for (map::const_iterator it = pwalletMain->mapWallet.begin(); + it != pwalletMain->mapWallet.end(); + ++it) + { + pcoin = &(*it).second; + + // skip orphan block or immature + if ((!pcoin->GetDepthInMainChain()) || (pcoin->GetBlocksToMaturity()>0)) + continue; + + // skip transaction other than POS block + if (!(pcoin->IsCoinStake())) + continue; + + nElement++; + + // use the cached amount if available + if (pcoin->fCreditCached && pcoin->fDebitCached) + nAmount = pcoin->nCreditCached - pcoin->nDebitCached; + else + nAmount = pcoin->GetCredit() - pcoin->GetDebit(); + + // scan the range + for(vIt=aRange.begin(); vIt != aRange.end(); vIt++) + { + if (pcoin->nTime >= vIt->Start) + { + if (! vIt->End) + { // Manage Special case + vIt->Start = pcoin->nTime; + vIt->Total = nAmount; + } + else if (pcoin->nTime <= vIt->End) + { + vIt->Count++; + vIt->Total += nAmount; + } + } + } + + } + return nElement; +} + + // prepare range for stake report +vStakePeriodRange_T PrepareRangeForStakeReport() +{ + vStakePeriodRange_T aRange; + StakePeriodRange_T x; + + struct tm Loc_MidNight; + + int64_t n1Hour = 60*60; + int64_t n1Day = 24 * n1Hour; + + int64_t nToday = GetTime(); + time_t CurTime = nToday; + + localtime_r(&CurTime, &Loc_MidNight); + Loc_MidNight.tm_hour = 0; + Loc_MidNight.tm_min = 0; + Loc_MidNight.tm_sec = 0; // set midnight + + x.Start = mktime(&Loc_MidNight); + x.End = nToday; + x.Count = 0; + x.Total = 0; + + // prepare last single 30 day Range + for(int i=0; i<30; i++) + { + x.Name = DateTimeStrFormat(x.Start); + + aRange.push_back(x); + + x.End = x.Start - 1; + x.Start -= n1Day; + } + + // prepare subtotal range of last 24H, 1 week, 30 days, 1 years + int GroupDays[4][2] = { {1 ,0}, {7 ,0 }, {30, 0}, {365, 0}}; + string sGroupName[] = {"24H", "7 Days", "30 Days", "365 Days" }; + + nToday = GetTime(); + + for(int i=0; i<4; i++) + { + x.Start = nToday - GroupDays[i][0] * n1Day; + x.End = nToday - GroupDays[i][1] * n1Day; + x.Name = "Last " + sGroupName[i]; + + aRange.push_back(x); + } + + // Special case. not a subtotal, but last stake + x.End = 0; + x.Start = 0; + x.Name = "Latest Stake"; + aRange.push_back(x); + +return aRange; +} + + // getstakereport: return SubTotal of the staked coin in last 24H, 7 days, etc.. of all owns address +Value getstakereport(const Array& params, bool fHelp) +{ + if ((params.size()>0) || (fHelp)) + throw runtime_error( + "getstakereport\n" + "List last single 30 day stake subtotal and last 24h, 7, 30, 365 day subtotal.\n"); + + vStakePeriodRange_T aRange = PrepareRangeForStakeReport(); + + // get subtotal calc + int64_t nTook = GetTimeMillis(); + int nItemCounted = GetsStakeSubTotal(aRange); + nTook = GetTimeMillis() - nTook; + + Object result; + + vStakePeriodRange_T::iterator vIt; + + // report it + for(vIt = aRange.begin(); vIt != aRange.end(); vIt++) + { + result.push_back(Pair(vIt->Name, FormatMoney(vIt->Total).c_str())); + } + + vIt--; + result.push_back(Pair("Latest Time", + vIt->Start ? DateTimeStrFormat(vIt->Start).c_str() : + "Never")); + + // report element counted / time took + result.push_back(Pair("Stake counted", nItemCounted)); + result.push_back(Pair("time took (ms)", nTook )); + + return result; } \ No newline at end of file