Skip to content

Commit

Permalink
Update version to 1.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
BitCannaGlobal committed Sep 2, 2021
1 parent 3181e06 commit 81e57aa
Show file tree
Hide file tree
Showing 14 changed files with 228 additions and 277 deletions.
4 changes: 2 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ dnl require autoconf 2.60 (AS_ECHO/AS_ECHO_N)
AC_PREREQ([2.60])
define(_CLIENT_VERSION_MAJOR, 1)
define(_CLIENT_VERSION_MINOR, 0)
define(_CLIENT_VERSION_REVISION, 2)
define(_CLIENT_VERSION_REVISION, 3)
define(_CLIENT_VERSION_BUILD, 0)
define(_CLIENT_VERSION_IS_RELEASE, true)
define(_COPYRIGHT_YEAR, 2020)
define(_COPYRIGHT_YEAR, 2021)
AC_INIT([BitCanna],[_CLIENT_VERSION_MAJOR._CLIENT_VERSION_MINOR._CLIENT_VERSION_REVISION],[www.bitcanna.io],[bitcanna])
AC_CONFIG_SRCDIR([src/main.cpp])
AC_CONFIG_HEADERS([src/config/bitcanna-config.h])
Expand Down
51 changes: 18 additions & 33 deletions src/activemasternode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ void CActiveMasternode::ManageStatus() {

//send to all peers
if (!Dseep(errorMessage)) {
LogPrintf("CActiveMasternode::ManageStatus() - Error on Ping: %s", errorMessage.c_str());
LogPrintf("CActiveMasternode::ManageStatus() - Error on Ping: %s\n", errorMessage.c_str());
}
}

Expand Down Expand Up @@ -141,13 +141,8 @@ bool CActiveMasternode::StopMasterNode(std::string& errorMessage) {

// Send stop dseep to network for any masternode
bool CActiveMasternode::StopMasterNode(CTxIn vin, CService service, CKey keyMasternode, CPubKey pubKeyMasternode, std::string& errorMessage) {
if(status == MASTERNODE_STOPPED || status == MASTERNODE_NOT_PROCESSED) {
errorMessage = "masternode is not in a running status";
LogPrintf("CActiveMasternode::Dseep() - Error: %s\n", errorMessage.c_str());
return false;
}
pwalletMain->UnlockCoin(vin.prevout);
return Dseep(vin, service, keyMasternode, pubKeyMasternode, errorMessage, true);
return Dseep(vin, service, keyMasternode, pubKeyMasternode, errorMessage, true);
}

bool CActiveMasternode::Dseep(std::string& errorMessage) {
Expand Down Expand Up @@ -188,24 +183,12 @@ bool CActiveMasternode::Dseep(CTxIn vin, CService service, CKey keyMasternode, C
return false;
}

CTxIn mnVinToBroadcast;

// Update Last Seen timestamp in masternode list
bool found = false;
BOOST_FOREACH(CMasterNode& mn, vecMasternodes) {
uint256 hash(uint256(mn.vin.prevout.hash).ToString().c_str());

if (!pwalletMain->mapWallet.count(hash)) {
LogPrintf("CActiveMasternode::Dseep() - Error: Invalid or non-wallet transaction id\n");
continue;
}

if(mn.vin == vin) {
for (CMasterNode& mn : vecMasternodes) {
if (mn.vin == vin) {
found = true;
mnVinToBroadcast = mn.vin;
if(stop) {
mn.Disable();
}
mn.UpdateLastSeen();
}
}

Expand All @@ -220,7 +203,7 @@ bool CActiveMasternode::Dseep(CTxIn vin, CService service, CKey keyMasternode, C

//send to all peers
LogPrintf("CActiveMasternode::Dseep() - SendDarkSendElectionEntryPing vin = %s\n", vin.ToString().c_str());
SendDarkSendElectionEntryPing(mnVinToBroadcast, vchMasterNodeSignature, masterNodeSignatureTime, stop);
SendDarkSendElectionEntryPing(vin, vchMasterNodeSignature, masterNodeSignatureTime, stop);

return true;
}
Expand Down Expand Up @@ -300,19 +283,11 @@ bool CActiveMasternode::Register(CTxIn vin, CService service, CKey keyCollateral
if(mn.vin == vin)
found = true;

if(!found) {
if (!found) {
LogPrintf("CActiveMasternode::Register() - Adding to masternode list service: %s - vin: %s\n", service.ToString().c_str(), vin.ToString().c_str());
CMasterNode mn(service, vin, pubKeyCollateralAddress, vchMasterNodeSignature, masterNodeSignatureTime, pubKeyMasternode, PROTOCOL_VERSION);
mn.UpdateLastSeen(masterNodeSignatureTime);
pwalletMain->LockCoin(vin.prevout);
vecMasternodes.push_back(mn);
BOOST_FOREACH(CMasternodeConfig::CMasternodeEntry& mne, masternodeConfig.getEntries()) {
if(mne.getIp() == service.ToString()) {
LogPrintf("CActiveMasternode::Register() - %s - vin: %s\n", mne.getIp(), vin.ToString());
mne.setVin(vin);
break;
}
}
}

//send to all peers
Expand All @@ -337,7 +312,17 @@ bool CActiveMasternode::GetMasterNodeVin(CTxIn& vin, CPubKey& pubkey, CKey& secr
if(!strTxHash.empty()) {
// Let's find it
uint256 txHash(strTxHash);
int outputIndex = boost::lexical_cast<int>(strOutputIndex);
int outputIndex = 0;
try
{
outputIndex = std::stoi(strOutputIndex.c_str());
}
catch (const std::exception& e)
{
LogPrintf("%s: %s on strOutputIndex\n", __func__, e.what());
return false;
}

bool found = false;
BOOST_FOREACH(COutput& out, possibleCoins) {
if(out.tx->GetHash() == txHash && out.i == outputIndex) {
Expand Down
4 changes: 2 additions & 2 deletions src/chainparamsseeds.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ static SeedSpec6 pnSeed6_main[] = {
};

static SeedSpec6 pnSeed6_test[] = {
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc3,0xc9,0x01,0xe6}, 27170}

};
#endif // BITCOIN_CHAINPARAMSSEEDS_H
#endif // BITCOIN_CHAINPARAMSSEEDS_H
11 changes: 4 additions & 7 deletions src/crypter.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,15 +151,12 @@ class CCryptoKeyStore : public CBasicKeyStore
}

bool IsLocked() const
{
if (!IsCrypted())
return false;
bool result;
{
LOCK(cs_KeyStore);
result = vMasterKey.empty();
if (!IsCrypted()) {
return false;
}
return result;
LOCK(cs_KeyStore);
return vMasterKey.empty();
}

bool Lock();
Expand Down
2 changes: 1 addition & 1 deletion src/instantx.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "uint256.h"
#include "uint256.h"
#include "sync.h"
#include "net.h"
#include "key.h"
Expand Down
Loading

0 comments on commit 81e57aa

Please sign in to comment.