Skip to content

Commit

Permalink
New reward model, misc fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
BitCanna committed Oct 2, 2019
1 parent 4ef5502 commit b061e72
Show file tree
Hide file tree
Showing 28 changed files with 361 additions and 265 deletions.
6 changes: 3 additions & 3 deletions doc/release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

BitCanna version *version* is now available from:

<https://github.com/216k155/bitcanna/releases>
<https://github.com/BitCannaGlobal/BCNA/releases>

This is a new major version release, including various bug fixes and
performance improvements, as well as updated translations.

Please report bugs using the issue tracker at github:

<https://github.com/216k155/bitcanna/issues>
<https://github.com/BitCannaGlobal/BCNA/issues>

Mandatory Update
==============
Expand Down Expand Up @@ -87,4 +87,4 @@ Thanks to everyone who directly contributed to this release:
- amirabrams
- presstab

As well as everyone that helped translating on [Transifex](https://www.transifex.com/projects/p/216k155-translations/).
As well as everyone that helped translating on [Transifex]().
128 changes: 0 additions & 128 deletions doc/release-notes/release-notes-4.0.0.md

This file was deleted.

6 changes: 3 additions & 3 deletions doc/release-process.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ If you're using the automated script (found in [contrib/gitian-build.sh](/contri
Check out the source code in the following directory hierarchy.

cd /path/to/your/toplevel/build
git clone https://github.com/216k155/gitian.sigs.git
git clone https://github.com/216k155/bitcanna-detached-sigs.git
git clone https://github.com/BitCannaGlobal/gitian.sigs.git
git clone https://github.com/BitCannaGlobal/bitcanna-detached-sigs.git
git clone https://github.com/devrandom/gitian-builder.git
git clone https://github.com/216k155/bitcanna.git
git clone https://github.com/BitCannaGlobal/bitcanna.git

### BCNA maintainers/release engineers, suggestion for writing release notes

Expand Down
4 changes: 2 additions & 2 deletions doc/translation_process.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Transifex is setup to monitor the GitHub repo for updates, and when code contain

Multiple language support is critical in assisting BCNA's global adoption, and growth. One of BCNA's greatest strengths is cross-border money transfers, any help making that easier is greatly appreciated.

See the [Transifex BCNA project](https://www.transifex.com/216k155/216k155-translations/) to assist in translations.
See the [Transifex BCNA project] to assist in translations.

### Writing code with translations
We use automated scripts to help extract translations in both Qt, and non-Qt source files. It is rarely necessary to manually edit the files in `src/qt/locale/`. The translation source files must adhere to the following format:
Expand Down Expand Up @@ -43,7 +43,7 @@ git commit
### Creating a Transifex account
Visit the [Transifex Signup](https://www.transifex.com/signup/) page to create an account. Take note of your username and password, as they will be required to configure the command-line tool.

You can find the BCNA translation project at [https://www.transifex.com/216k155/216k155-translations/](https://www.transifex.com/216k155/216k155-translations/).
You can find the BCNA translation project at []().

### Installing the Transifex client command-line tool
The client it used to fetch updated translations. If you are having problems, or need more details, see [http://docs.transifex.com/developer/client/setup](http://docs.transifex.com/developer/client/setup)
Expand Down
2 changes: 1 addition & 1 deletion src/chainparams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ class CMainParams : public CChainParams
nStartMasternodePayments = 1563801980; // 22/07/2019

nStakingRoundPeriod = 120; // 2 minutes a round
nStakingInterval = 28;
nStakingInterval = 30;
nStakingMinAge = 10 * 60; // TODO maybe will have to increase
}

Expand Down
2 changes: 1 addition & 1 deletion src/chainparams.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class CChainParams
std::string DarksendPoolDummyAddress() const { return strDarksendPoolDummyAddress; }
int64_t StartMasternodePayments() const { return nStartMasternodePayments; }
int64_t StakingRoundPeriod() const { return nStakingRoundPeriod; }
int64_t StakingInterval() const { return nStakingInterval; }
int64_t StakingInterval(int nHeight) const { return (nHeight > 256963) ? nStakingInterval : 28; }
int64_t StakingMinAge() const { return nStakingMinAge; }
CBaseChainParams::Network NetworkID() const { return networkID; }

Expand Down
69 changes: 22 additions & 47 deletions src/darksend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -388,8 +388,8 @@ void ProcessDarksend(CNode* pfrom, const std::string& strCommand, CDataStream& v

vector<CTxIn> sigs;
vRecv >> sigs;

bool success = false;
std::atomic<bool> success(false);
int count = 0;

LogPrintf(" -- sigs count %d %d\n", (int)sigs.size(), count);
Expand Down Expand Up @@ -1521,6 +1521,7 @@ bool CDarkSendPool::DoAutomaticDenominating(bool fDryRun, bool ready)
LOCK(cs_vNodes);
BOOST_FOREACH(CNode* pnode, vNodes)
{
if (!pnode) continue;
if((CNetAddr)pnode->addr != (CNetAddr)submittedToMasternode) continue;

std::string strReason;
Expand Down Expand Up @@ -1582,6 +1583,7 @@ bool CDarkSendPool::DoAutomaticDenominating(bool fDryRun, bool ready)
LOCK(cs_vNodes);
BOOST_FOREACH(CNode* pnode, vNodes)
{
if (!pnode) continue;
if((CNetAddr)pnode->addr != (CNetAddr)vecMasternodes[i].addr) continue;

std::string strReason;
Expand Down Expand Up @@ -2087,8 +2089,10 @@ bool CDarksendQueue::Relay()

LOCK(cs_vNodes);
BOOST_FOREACH(CNode* pnode, vNodes){
// always relay to everyone
pnode->PushMessage("dsq", (*this));
if (pnode) {
// always relay to everyone
pnode->PushMessage("dsq", (*this));
}
}

return true;
Expand Down Expand Up @@ -2131,51 +2135,22 @@ void ThreadCheckDarkSendPool()
//LogPrintf("ThreadCheckDarkSendPool::check timeout\n");
darkSendPool.CheckTimeout();

if(c % 60 == 0){
LOCK(cs_main);
/*
cs_main is required for doing masternode.Check because something
is modifying the coins view without a mempool lock. It causes
segfaults from this code without the cs_main lock.
*/
{

LOCK(cs_masternodes);
vector<CMasterNode>::iterator it = vecMasternodes.begin();
//check them separately
while(it != vecMasternodes.end()){
(*it).Check();
++it;
}

int count = vecMasternodes.size();
int i = 0;


//remove inactive
it = vecMasternodes.begin();
while(it != vecMasternodes.end()){
LogPrintf("Activity: %s:%d\n", (*it).addr.ToString().c_str(), (*it).enabled);
if((*it).enabled == 4 || (*it).enabled == 3){
LogPrintf("Removing inactive masternode %s\n", (*it).addr.ToString().c_str());
it = vecMasternodes.erase(it);
} else {
++it;
}
}

BOOST_FOREACH(CMasterNode mn, vecMasternodes) {

if(mn.addr.IsRFC1918()) continue; //local network
if(mn.IsEnabled()) {
if(fDebug) LogPrintf("Sending masternode entry - %s \n", mn.addr.ToString().c_str());
BOOST_FOREACH(CNode* pnode, vNodes) {
pnode->PushMessage("dsee", mn.vin, mn.addr, mn.sig, mn.now, mn.pubkey, mn.pubkey2, count, i, mn.lastTimeSeen, mn.protocolVersion);
if (c % 60 == 0) {
{
LOCK(cs_masternodes);
vector<CMasterNode>::iterator it = vecMasternodes.begin();
//check them separately
while(it != vecMasternodes.end()) {
LogPrintf("Activity: %s:%d\n", (*it).addr.ToString().c_str(), (*it).enabled);
(*it).Check();
if ((*it).enabled == 4 || (*it).enabled == 3) {
LogPrintf("Removing inactive masternode %s\n", (*it).addr.ToString().c_str());
it = vecMasternodes.erase(it);
} else {
++it;
}
}
i++;
}
}

masternodePayments.CleanPaymentList();
CleanTransactionLocksList();
Expand All @@ -2188,7 +2163,7 @@ void ThreadCheckDarkSendPool()
LOCK(cs_vNodes);
BOOST_FOREACH(CNode* pnode, vNodes)
{
if (pnode->nVersion >= darkSendPool.MIN_PEER_PROTO_VERSION) {
if (pnode && pnode->nVersion >= darkSendPool.MIN_PEER_PROTO_VERSION) {

//keep track of who we've asked for the list
if(pnode->HasFulfilledRequest("mnsync")) continue;
Expand Down
9 changes: 6 additions & 3 deletions src/instantx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ void ProcessInstantX(CNode* pfrom, const std::string& strCommand, CDataStream& v
vInv.push_back(inv);
LOCK(cs_vNodes);
BOOST_FOREACH(CNode* pnode, vNodes)
pnode->PushMessage("inv", vInv);
if (pnode)
pnode->PushMessage("inv", vInv);

DoConsensusVote(tx, nBlockHeight);

Expand Down Expand Up @@ -161,7 +162,8 @@ void ProcessInstantX(CNode* pfrom, const std::string& strCommand, CDataStream& v
vInv.push_back(inv);
LOCK(cs_vNodes);
BOOST_FOREACH(CNode* pnode, vNodes)
pnode->PushMessage("inv", vInv);
if (pnode)
pnode->PushMessage("inv", vInv);

}

Expand Down Expand Up @@ -298,7 +300,8 @@ void DoConsensusVote(CTransaction& tx, int64_t nBlockHeight)
vInv.push_back(inv);
LOCK(cs_vNodes);
BOOST_FOREACH(CNode* pnode, vNodes){
pnode->PushMessage("inv", vInv);
if (pnode)
pnode->PushMessage("inv", vInv);
}

}
Expand Down
Loading

0 comments on commit b061e72

Please sign in to comment.