Skip to content

Commit

Permalink
Merge pull request #404 from duality-solutions/v2.4.4.0-WIP
Browse files Browse the repository at this point in the history
V2.4.4.0
  • Loading branch information
SvenKercher committed Jan 16, 2020
2 parents 75cd043 + fe0706e commit 1c9c322
Show file tree
Hide file tree
Showing 61 changed files with 8,221 additions and 3,443 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
**Dynamic CHANGELOG**
-------------------------

**Dynamic v2.4.4.0**

* [Qt] Update Splashscreen for v2.4.4.0
* [RPC] More user-friendly error message when partially signing
* [Qt] Translations Updated
* [BDAP] Show fee required in the insufficient funds error message
* [BDAP] Use new epoch to string format function in Qt
* [Tests] Add unit test for new add months to epoch function
* [Util] Refactor add months to epoch functions
* [Test] Add unit tests for new format ISO date and time
* [BDAP] Fix comparison between signed and unsigned warning
* [RPC] Fix dynode-list bug


**Dynamic v2.4.3.0**

* [BDAP] Remove second month overrun check
Expand Down Expand Up @@ -569,6 +583,7 @@
* [Fluid] Fix consensus issues with new db code
* Update changelog and cleanup fluid to do lists/comments


**Dynamic v2.3.0.0**

* Skip existing Dynodes connections on mixing
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![Build Status](https://travis-ci.org/duality-solutions/Dynamic.png?branch=master)](https://travis-ci.org/duality-solutions/Dynamic)

# **Dynamic (DYN) v2.4.3.0**
# **Dynamic (DYN) v2.4.4.0**

![DYN logo](https://github.com/duality-solutions/Dynamic/blob/master/src/qt/res/icons/drk/about.png)

Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ dnl require autoconf 2.60 (AS_ECHO/AS_ECHO_N)
AC_PREREQ([2.60])
define(_CLIENT_VERSION_MAJOR, 2)
define(_CLIENT_VERSION_MINOR, 4)
define(_CLIENT_VERSION_REVISION, 3)
define(_CLIENT_VERSION_REVISION, 4)
define(_CLIENT_VERSION_BUILD, 0)
define(_CLIENT_VERSION_IS_RELEASE, true)
define(_COPYRIGHT_YEAR, 2019)
Expand Down
112 changes: 0 additions & 112 deletions contrib/gitian-descriptors/gitian-arm.yml

This file was deleted.

2 changes: 1 addition & 1 deletion contrib/gitian-descriptors/gitian-linux.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: "dynamic-linux-2.4.3.0"
name: "dynamic-linux-2.4.4.0"
enable_cache: true
suites:
- "trusty"
Expand Down
2 changes: 1 addition & 1 deletion contrib/gitian-descriptors/gitian-osx.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: "dynamic-osx-2.4.3.0"
name: "dynamic-osx-2.4.4.0"
enable_cache: true
suites:
- "trusty"
Expand Down
2 changes: 1 addition & 1 deletion contrib/gitian-descriptors/gitian-win.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: "dynamic-2.4.3.0"
name: "dynamic-2.4.4.0"
enable_cache: true
suites:
- "trusty"
Expand Down
4 changes: 2 additions & 2 deletions doc/build-debian.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ in the getinfo-output. If the numbers match, the installation is completed.
```
dynamic-cli getinfo
{
"version": 2040000,
"protocolversion": 71000,
"version": 2040400,
"protocolversion": 71050,
"walletversion": 204000,
"balance": 0.00000000,
"privatesend_balance": 0.00000000,
Expand Down
1 change: 0 additions & 1 deletion src/bdap/bdap.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ static constexpr unsigned int MAX_SIGNATURE_LENGTH = 65; // https://bitco
static constexpr unsigned int MAX_PRIVATE_DATA_LENGTH = 512; // Pay per byte for hosting on chain
static constexpr unsigned int MAX_NUMBER_CHECKPOINTS = 25; // Pay per byte for hosting on chain
static constexpr unsigned int MAX_CHECKPOINT_HASH_LENGTH = 64;
static constexpr unsigned int SECONDS_PER_DAY = 86400; // Number of seconds per day.
static constexpr unsigned int DHT_HEX_PUBLIC_KEY_LENGTH = 64; // Ed25519 pubkeys are 32 bytes and 64 bytes when hex encoded.
static constexpr unsigned int MAX_BDAP_LINK_MESSAGE = 256;
static constexpr unsigned int MAX_BDAP_SIGNATURE_PROOF = 90; // TODO (bdap): Update to 65 or use MAX_SIGNATURE_LENGTH when you start a new chain.
Expand Down
1 change: 1 addition & 0 deletions src/bdap/domainentrydb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include "coins.h"
#include "bdap/utils.h"
#include "utilmoneystr.h"
#include "utiltime.h"
#include "validation.h"
#include "validationinterface.h"

Expand Down
49 changes: 0 additions & 49 deletions src/bdap/fees.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
#include "bdap/utils.h" // for GetObjectTypeString
#include "util.h" // for LogPrintf

#include <boost/date_time/posix_time/posix_time.hpp>
#include <ctime>
#include <limits>
#include <map>

Expand Down Expand Up @@ -173,53 +171,6 @@ bool GetBDAPFees(const opcodetype& opCodeAction, const opcodetype& opCodeObject,
return true;
}

int64_t AddMonthsToCurrentEpoch(const short nMonths)
{
struct std::tm epoch_date;
epoch_date.tm_hour = 0; epoch_date.tm_min = 0; epoch_date.tm_sec = 0;
epoch_date.tm_year = 70; epoch_date.tm_mon = 0; epoch_date.tm_mday = 1;

boost::gregorian::date dt = boost::gregorian::day_clock::universal_day();
short nYear = dt.year() + ((dt.month() + nMonths)/12);
short nMonth = (dt.month() + nMonths) % 12;
short nDay = dt.day();
//LogPrintf("%s -- nYear %d, nMonth %d, nDay %d\n", __func__, nYear, nMonth, nDay);
struct std::tm month_date;
month_date.tm_hour = 0; month_date.tm_min = 0; month_date.tm_sec = 0;
month_date.tm_year = nYear - 1900; month_date.tm_mon = nMonth -1; month_date.tm_mday = nDay;

int64_t seconds = (int64_t)std::difftime(std::mktime(&month_date), std::mktime(&epoch_date));

return seconds + SECONDS_PER_DAY;
}

int64_t AddMonthsToBlockTime(const uint32_t& nBlockTime, const short nMonths)
{
struct std::tm epoch_date;
epoch_date.tm_hour = 0; epoch_date.tm_min = 0; epoch_date.tm_sec = 0;
epoch_date.tm_year = 70; epoch_date.tm_mon = 0; epoch_date.tm_mday = 1;

boost::gregorian::date dt = boost::posix_time::from_time_t(nBlockTime).date();
short nYear = dt.year() + ((dt.month() + nMonths)/12);
short nMonth = (dt.month() + nMonths) % 12;
short nDay = dt.day();
//LogPrintf("%s -- nYear %d, nMonth %d, nDay %d\n", __func__, nYear, nMonth, nDay);
struct std::tm month_date;
month_date.tm_hour = 0; month_date.tm_min = 0; month_date.tm_sec = 0;
month_date.tm_year = nYear - 1900; month_date.tm_mon = nMonth -1; month_date.tm_mday = nDay;

int64_t seconds = (int64_t)std::difftime(std::mktime(&month_date), std::mktime(&epoch_date));

return seconds + SECONDS_PER_DAY;
}

uint16_t MonthsFromBlockToExpire(const uint32_t& nBlockTime, const uint64_t& nExpireTime)
{
boost::gregorian::date dtBlock = boost::posix_time::from_time_t(nBlockTime).date();
boost::gregorian::date dtExpire = boost::posix_time::from_time_t(nExpireTime).date();
return (uint16_t)((dtExpire.year() - dtBlock.year())*12 + dtExpire.month() - dtBlock.month());
}

bool ExtractAmountsFromTx(const CTransactionRef& ptx, CAmount& dataAmount, CAmount& opAmount)
{
bool fDataFound = false, fOpFound = false;
Expand Down
3 changes: 0 additions & 3 deletions src/bdap/fees.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@ class CFeeItem {
};

bool GetBDAPFees(const opcodetype& opCodeAction, const opcodetype& opCodeObject, const BDAP::ObjectType objType, const uint16_t nMonths, CAmount& monthlyFee, CAmount& oneTimeFee, CAmount& depositFee);
int64_t AddMonthsToCurrentEpoch(const short nMonths);
int64_t AddMonthsToBlockTime(const uint32_t& nBlockTime, const short nMonths);
uint16_t MonthsFromBlockToExpire(const uint32_t& nBlockTime, const uint64_t& nExpireTime);
bool ExtractAmountsFromTx(const CTransactionRef& ptx, CAmount& dataAmount, CAmount& opAmount);

#endif // DYNAMIC_BDAP_FEES_H
2 changes: 1 addition & 1 deletion src/clientversion.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
//! These need to be macros, as clientversion.cpp's and dynamic*-res.rc's voodoo requires it
#define CLIENT_VERSION_MAJOR 2
#define CLIENT_VERSION_MINOR 4
#define CLIENT_VERSION_REVISION 3
#define CLIENT_VERSION_REVISION 4
#define CLIENT_VERSION_BUILD 0

//! Set to true for release, false for prerelease or test build
Expand Down
2 changes: 1 addition & 1 deletion src/dynode-payments.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ static const int DNPAYMENTS_SIGNATURES_TOTAL = 20;
// V1 - Last protocol version before update
// V2 - Newest protocol version
static const int MIN_DYNODE_PAYMENT_PROTO_VERSION_1 = 70900;
static const int MIN_DYNODE_PAYMENT_PROTO_VERSION_2 = 71000;
static const int MIN_DYNODE_PAYMENT_PROTO_VERSION_2 = 71050; // Only Dynodes > v2.4.4.0 will get paid after Spork 10 activation

extern CCriticalSection cs_vecPayees;
extern CCriticalSection cs_mapDynodeBlocks;
Expand Down
2 changes: 1 addition & 1 deletion src/dynodeman.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
/** Dynode manager */
CDynodeMan dnodeman;

const std::string CDynodeMan::SERIALIZATION_VERSION_STRING = "CDynodeMan-Version-3";
const std::string CDynodeMan::SERIALIZATION_VERSION_STRING = "CDynodeMan-Version-4";
const int CDynodeMan::LAST_PAID_SCAN_BLOCKS = 100;

struct CompareLastPaidBlock {
Expand Down
36 changes: 15 additions & 21 deletions src/qt/bdapaccounttablemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@
#include "bdappage.h"
#include "guiconstants.h"
#include "guiutil.h"
#include "sync.h"
#include "validation.h" // for cs_main
#include "rpc/client.h"
#include "rpc/register.h"
#include "rpc/server.h"
#include "rpc/client.h"
#include "sync.h"
#include "utiltime.h"
#include "validation.h" // for cs_main

#include <QDebug>
#include <QList>
Expand Down Expand Up @@ -101,16 +102,7 @@ class BdapAccountTablePriv

inputtable->clearContents();
inputtable->setRowCount(0);
inputtable->setColumnCount(0);
inputtable->setSortingEnabled(true);
inputtable->setColumnCount(3);
inputtable->setColumnWidth(0, COMMONNAME_COLWIDTH); //Common Name (fixed)
inputtable->setColumnWidth(1, FULLPATH_COLWIDTH); //Object Full Path (fixed)
//inputtable->setColumnWidth(2, 175);

inputtable->setHorizontalHeaderItem(0, new QTableWidgetItem(QObject::tr("Common Name")));
inputtable->setHorizontalHeaderItem(1, new QTableWidgetItem(QObject::tr("Object Full Path")));
inputtable->setHorizontalHeaderItem(2, new QTableWidgetItem(QObject::tr("Expiration Date")));

//Parse results and populate QWidgetTable
for (size_t i {0} ; i < result.size() ; ++i) {
Expand Down Expand Up @@ -153,7 +145,7 @@ class BdapAccountTablePriv

std::string statusString = "Records found: " + std::to_string(recordsFound);

statusDisplay->setText(QObject::tr(statusString.c_str()));
statusDisplay->setText(std::to_string(recordsFound).c_str());

} //refreshAccounts

Expand All @@ -176,15 +168,17 @@ BdapAccountTableModel::BdapAccountTableModel(BdapPage* parent) : QAbstractTableM
bdapPage(parent),
timer(0)
{

currentIndex = bdapPage->getCurrentIndex();
userTable = bdapPage->getUserTable();
groupTable = bdapPage->getGroupTable();
userStatus = bdapPage->getUserStatus();
groupStatus = bdapPage->getGroupStatus();


columns << tr("Common Name") << tr("Object Full Path") << tr("Expiration Date");
userStatus = bdapPage->getNumRecordsFound();
groupStatus = bdapPage->getNumRecordsFound();
userTable->setColumnWidth(0, COMMONNAME_COLWIDTH); //Common Name (fixed)
userTable->setColumnWidth(1, FULLPATH_COLWIDTH); //Object Full Path (fixed)
userTable->setColumnWidth(2, 175);
groupTable->setColumnWidth(0, COMMONNAME_COLWIDTH); //Common Name (fixed)
groupTable->setColumnWidth(1, FULLPATH_COLWIDTH); //Object Full Path (fixed)
groupTable->setColumnWidth(2, 175);
priv.reset(new BdapAccountTablePriv());
// default to unsorted
priv->sortColumn = -1;
Expand Down Expand Up @@ -279,7 +273,7 @@ void BdapAccountTableModel::refreshUsers()
searchUserPath = bdapPage->getPathUserSearch();

Q_EMIT layoutAboutToBeChanged();
priv->refreshAccounts(userTable,userStatus,myUsersChecked,searchUserCommon,searchUserPath);
priv->refreshAccounts(userTable, userStatus, myUsersChecked, searchUserCommon, searchUserPath);
Q_EMIT layoutChanged();
}

Expand All @@ -290,7 +284,7 @@ void BdapAccountTableModel::refreshGroups()
searchGroupPath = bdapPage->getPathGroupSearch();

Q_EMIT layoutAboutToBeChanged();
priv->refreshAccounts(groupTable,groupStatus,myGroupsChecked,searchGroupCommon,searchGroupPath);
priv->refreshAccounts(groupTable, groupStatus, myGroupsChecked, searchGroupCommon, searchGroupPath);
Q_EMIT layoutChanged();
}

Expand Down
Loading

0 comments on commit 1c9c322

Please sign in to comment.