Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ BITCOIN_WIN_INSTALLER=$(PACKAGE)-$(PACKAGE_VERSION)-win$(WINDOWS_BITS)-setup$(EX
empty :=
space := $(empty) $(empty)

OSX_APP=INDINODE-Qt.app
OSX_APP=IndiNode-Qt.app
OSX_VOLNAME = $(subst $(space),-,$(PACKAGE_NAME))
OSX_DMG = $(OSX_VOLNAME).dmg
OSX_BACKGROUND_SVG=background.svg
Expand Down Expand Up @@ -86,7 +86,7 @@ $(OSX_APP)/Contents/Resources/bitcoin.icns: $(OSX_INSTALLER_ICONS)
$(MKDIR_P) $(@D)
$(INSTALL_DATA) $< $@

$(OSX_APP)/Contents/MacOS/INDINODE-Qt: $(BITCOIN_QT_BIN)
$(OSX_APP)/Contents/MacOS/IndiNode-Qt: $(BITCOIN_QT_BIN)
$(MKDIR_P) $(@D)
STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $< $@

Expand All @@ -96,7 +96,7 @@ $(OSX_APP)/Contents/Resources/Base.lproj/InfoPlist.strings:

OSX_APP_BUILT=$(OSX_APP)/Contents/PkgInfo $(OSX_APP)/Contents/Resources/empty.lproj \
$(OSX_APP)/Contents/Resources/bitcoin.icns $(OSX_APP)/Contents/Info.plist \
$(OSX_APP)/Contents/MacOS/INDINODE-Qt $(OSX_APP)/Contents/Resources/Base.lproj/InfoPlist.strings
$(OSX_APP)/Contents/MacOS/IndiNode-Qt $(OSX_APP)/Contents/Resources/Base.lproj/InfoPlist.strings

osx_volname:
echo $(OSX_VOLNAME) >$@
Expand All @@ -121,7 +121,7 @@ $(APP_DIST_DIR)/Applications:
@rm -f $@
@cd $(@D); $(LN_S) /Applications $(@F)

$(APP_DIST_EXTRAS): $(APP_DIST_DIR)/$(OSX_APP)/Contents/MacOS/INDINODE-Qt
$(APP_DIST_EXTRAS): $(APP_DIST_DIR)/$(OSX_APP)/Contents/MacOS/IndiNode-Qt

$(OSX_DMG): $(APP_DIST_EXTRAS)
$(GENISOIMAGE) -no-cache-inodes -D -l -probe -V "$(OSX_VOLNAME)" -no-pad -r -dir-mode 0755 -apple -o $@ dist
Expand All @@ -136,7 +136,7 @@ $(APP_DIST_DIR)/.background/$(OSX_BACKGROUND_IMAGE): $(OSX_BACKGROUND_IMAGE_DPIF
$(APP_DIST_DIR)/.DS_Store: $(OSX_DSSTORE_GEN)
$(PYTHON) $< "$@" "$(OSX_VOLNAME)"

$(APP_DIST_DIR)/$(OSX_APP)/Contents/MacOS/INDINODE-Qt: $(OSX_APP_BUILT) $(OSX_PACKAGING)
$(APP_DIST_DIR)/$(OSX_APP)/Contents/MacOS/IndiNode-Qt: $(OSX_APP_BUILT) $(OSX_PACKAGING)
INSTALLNAMETOOL=$(INSTALLNAMETOOL) OTOOL=$(OTOOL) STRIP=$(STRIP) $(PYTHON) $(OSX_DEPLOY_SCRIPT) $(OSX_APP) -translations-dir=$(QT_TRANSLATION_DIR) -add-qt-tr $(OSX_QT_TRANSLATIONS) -verbose 2

deploydir: $(APP_DIST_EXTRAS)
Expand Down
10 changes: 5 additions & 5 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ BITCOIN_CLI_BIN = $(top_builddir)/src/$(BITCOIN_CLI_NAME)$(EXEEXT)
BITCOIN_WIN_INSTALLER = $(PACKAGE)-$(PACKAGE_VERSION)-win$(WINDOWS_BITS)-setup$(EXEEXT)
empty :=
space := $(empty) $(empty)
OSX_APP = INDINODE-Qt.app
OSX_APP = IndiNode-Qt.app
OSX_VOLNAME = $(subst $(space),-,$(PACKAGE_NAME))
OSX_DMG = $(OSX_VOLNAME).dmg
OSX_BACKGROUND_SVG = background.svg
Expand Down Expand Up @@ -520,7 +520,7 @@ COVERAGE_INFO = baseline_filtered_combined.info baseline.info block_test.info \

OSX_APP_BUILT = $(OSX_APP)/Contents/PkgInfo $(OSX_APP)/Contents/Resources/empty.lproj \
$(OSX_APP)/Contents/Resources/bitcoin.icns $(OSX_APP)/Contents/Info.plist \
$(OSX_APP)/Contents/MacOS/INDINODE-Qt $(OSX_APP)/Contents/Resources/Base.lproj/InfoPlist.strings
$(OSX_APP)/Contents/MacOS/IndiNode-Qt $(OSX_APP)/Contents/Resources/Base.lproj/InfoPlist.strings

@BUILD_DARWIN_FALSE@APP_DIST_DIR = $(top_builddir)/dist
@BUILD_DARWIN_FALSE@APP_DIST_EXTRAS = $(APP_DIST_DIR)/.background/$(OSX_BACKGROUND_IMAGE) $(APP_DIST_DIR)/.DS_Store $(APP_DIST_DIR)/Applications
Expand Down Expand Up @@ -1058,7 +1058,7 @@ $(OSX_APP)/Contents/Resources/bitcoin.icns: $(OSX_INSTALLER_ICONS)
$(MKDIR_P) $(@D)
$(INSTALL_DATA) $< $@

$(OSX_APP)/Contents/MacOS/INDINODE-Qt: $(BITCOIN_QT_BIN)
$(OSX_APP)/Contents/MacOS/IndiNode-Qt: $(BITCOIN_QT_BIN)
$(MKDIR_P) $(@D)
STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $< $@

Expand All @@ -1085,7 +1085,7 @@ osx_volname:
@BUILD_DARWIN_FALSE@ @rm -f $@
@BUILD_DARWIN_FALSE@ @cd $(@D); $(LN_S) /Applications $(@F)

@BUILD_DARWIN_FALSE@$(APP_DIST_EXTRAS): $(APP_DIST_DIR)/$(OSX_APP)/Contents/MacOS/INDINODE-Qt
@BUILD_DARWIN_FALSE@$(APP_DIST_EXTRAS): $(APP_DIST_DIR)/$(OSX_APP)/Contents/MacOS/IndiNode-Qt

@BUILD_DARWIN_FALSE@$(OSX_DMG): $(APP_DIST_EXTRAS)
@BUILD_DARWIN_FALSE@ $(GENISOIMAGE) -no-cache-inodes -D -l -probe -V "$(OSX_VOLNAME)" -no-pad -r -dir-mode 0755 -apple -o $@ dist
Expand All @@ -1099,7 +1099,7 @@ osx_volname:
@BUILD_DARWIN_FALSE@$(APP_DIST_DIR)/.DS_Store: $(OSX_DSSTORE_GEN)
@BUILD_DARWIN_FALSE@ $(PYTHON) $< "$@" "$(OSX_VOLNAME)"

@BUILD_DARWIN_FALSE@$(APP_DIST_DIR)/$(OSX_APP)/Contents/MacOS/INDINODE-Qt: $(OSX_APP_BUILT) $(OSX_PACKAGING)
@BUILD_DARWIN_FALSE@$(APP_DIST_DIR)/$(OSX_APP)/Contents/MacOS/IndiNode-Qt: $(OSX_APP_BUILT) $(OSX_PACKAGING)
@BUILD_DARWIN_FALSE@ INSTALLNAMETOOL=$(INSTALLNAMETOOL) OTOOL=$(OTOOL) STRIP=$(STRIP) $(PYTHON) $(OSX_DEPLOY_SCRIPT) $(OSX_APP) -translations-dir=$(QT_TRANSLATION_DIR) -add-qt-tr $(OSX_QT_TRANSLATIONS) -verbose 2

@BUILD_DARWIN_FALSE@deploydir: $(APP_DIST_EXTRAS)
Expand Down
4 changes: 2 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
dnl require autoconf 2.60 (AS_ECHO/AS_ECHO_N)
AC_PREREQ([2.60])
define(_CLIENT_VERSION_MAJOR, 1)
define(_CLIENT_VERSION_MINOR, 2)
define(_CLIENT_VERSION_MINOR, 3)
define(_CLIENT_VERSION_REVISION, 0)
define(_CLIENT_VERSION_BUILD, 0)
define(_CLIENT_VERSION_IS_RELEASE, true)
Expand Down Expand Up @@ -109,7 +109,7 @@ AC_ARG_ENABLE([upnp-default],
AC_ARG_ENABLE(tests,
AS_HELP_STRING([--enable-tests],[compile tests (default is yes)]),
[use_tests=$enableval],
[use_tests=yes])
[use_tests=no])

AC_ARG_WITH([comparison-tool],
AS_HELP_STRING([--with-comparison-tool],[path to java comparison tool (requires --enable-tests)]),
Expand Down
2 changes: 1 addition & 1 deletion doc/build-osx.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ Creating a release build
------------------------
You can ignore this section if you are building `indinoded` for your own use.

indinoded/indinode-cli binaries are not included in the indinode-Qt.app bundle.
indinoded/indinode-cli binaries are not included in the IndiNode-Qt.app bundle.

If you are building `indinoded` or `indinode-qt` for others, your build machine should be set up
as follows for maximum compatibility:
Expand Down
2 changes: 1 addition & 1 deletion src/activemasternode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ vector<COutput> CActiveMasternode::SelectCoinsMasternode()

// Filter
BOOST_FOREACH (const COutput& out, vCoins) {
if (out.tx->vout[out.i].nValue == 200000 * COIN) { //exactly
if (out.tx->vout[out.i].nValue == GetMstrNodCollateral(chainActive.Height()) * COIN) { //exactly
filteredCoins.push_back(out);
}
}
Expand Down
6 changes: 2 additions & 4 deletions src/chainparams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,8 @@ class CMainParams : public CChainParams
vFixedSeeds.clear();
vSeeds.clear();

vSeeds.push_back(CDNSSeedData("149.28.16.126", "149.28.16.126"));
vSeeds.push_back(CDNSSeedData("149.28.158.146", "149.28.158.146"));
vSeeds.push_back(CDNSSeedData("149.28.158.224", "149.28.158.224"));
vSeeds.push_back(CDNSSeedData("149.28.158.213", "149.28.158.213"));
vSeeds.push_back(CDNSSeedData("149.28.208.172", "149.28.208.172"));
vSeeds.push_back(CDNSSeedData("45.77.213.145", "45.77.213.145"));

base58Prefixes[PUBKEY_ADDRESS] = std::vector<unsigned char>(1, 75);
base58Prefixes[SCRIPT_ADDRESS] = std::vector<unsigned char>(1, 80);
Expand Down
2 changes: 1 addition & 1 deletion src/clientversion.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

//! These need to be macros, as clientversion.cpp's and indinode*-res.rc's voodoo requires it
#define CLIENT_VERSION_MAJOR 1
#define CLIENT_VERSION_MINOR 2
#define CLIENT_VERSION_MINOR 3
#define CLIENT_VERSION_REVISION 0
#define CLIENT_VERSION_BUILD 0

Expand Down
85 changes: 78 additions & 7 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ CCriticalSection cs_main;
BlockMap mapBlockIndex;
map<uint256, uint256> mapProofOfStake;
set<pair<COutPoint, unsigned int> > setStakeSeen;
map<COutPoint, int> mapStakeSpent;
map<unsigned int, unsigned int> mapHashedBlocks;
CChain chainActive;
CBlockIndex* pindexBestHeader = NULL;
Expand Down Expand Up @@ -2125,16 +2126,12 @@ int64_t GetBlockValue(int nHeight)
nSubsidy = 150000000 * COIN;
} else if (nHeight < 100001) {
nSubsidy = 10 * COIN;
} else if (nHeight < 518400) {
} else if (nHeight < 400000) {
nSubsidy = 2500 * COIN;
} else if (nHeight < 1036800) {
nSubsidy = 750 * COIN;
} else if (nHeight < 1555200) {
nSubsidy = 350 * COIN;
} else {
nSubsidy = 150 * COIN;
nSubsidy = 250 * COIN;
}

// Check if we reached the coin max supply.
int64_t nMoneySupply = chainActive.Tip()->nMoneySupply;

Expand Down Expand Up @@ -2534,6 +2531,8 @@ bool DisconnectBlock(CBlock& block, CValidationState& state, CBlockIndex* pindex
if (coins->vout.size() < out.n + 1)
coins->vout.resize(out.n + 1);
coins->vout[out.n] = undo.txout;
// erase the spent input
mapStakeSpent.erase(out);
}
}
}
Expand Down Expand Up @@ -3007,6 +3006,29 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin
if (fTxIndex)
if (!pblocktree->WriteTxIndex(vPos))
return state.Abort("Failed to write transaction index");

// add new entries
for (const CTransaction tx: block.vtx) {
if (tx.IsCoinBase() || tx.IsZerocoinSpend())
continue;
for (const CTxIn in: tx.vin) {
LogPrint("map", "mapStakeSpent: Insert %s | %u\n", in.prevout.ToString(), pindex->nHeight);
mapStakeSpent.insert(std::make_pair(in.prevout, pindex->nHeight));
}
}


// delete old entries
for (auto it = mapStakeSpent.begin(); it != mapStakeSpent.end();) {
if (it->second < pindex->nHeight - Params().MaxReorganizationDepth()) {
LogPrint("map", "mapStakeSpent: Erase %s | %u\n", it->first.ToString(), it->second);
it = mapStakeSpent.erase(it);
}
else {
it++;
}
}


// add this block to the view's block chain
view.SetBestBlock(pindex->GetBlockHash());
Expand Down Expand Up @@ -4173,6 +4195,55 @@ bool AcceptBlock(CBlock& block, CValidationState& state, CBlockIndex** ppindex,
}

int nHeight = pindex->nHeight;

if (block.IsProofOfStake()) {
LOCK(cs_main);

CCoinsViewCache coins(pcoinsTip);

if (!coins.HaveInputs(block.vtx[1])) {
// the inputs are spent at the chain tip so we should look at the recently spent outputs

for (CTxIn in : block.vtx[1].vin) {
auto it = mapStakeSpent.find(in.prevout);
if (it == mapStakeSpent.end()) {
return false;
}
if (it->second < pindexPrev->nHeight) {
return false;
}
}
}

// if this is on a fork
if (!chainActive.Contains(pindexPrev) && pindexPrev != NULL) {
// start at the block we're adding on to
CBlockIndex *last = pindexPrev;

// while that block is not on the main chain
while (!chainActive.Contains(last) && last != NULL) {
CBlock bl;
ReadBlockFromDisk(bl, last);
// loop through every spent input from said block
for (CTransaction t : bl.vtx) {
for (CTxIn in: t.vin) {
// loop through every spent input in the staking transaction of the new block
for (CTxIn stakeIn : block.vtx[1].vin) {
// if they spend the same input
if (stakeIn.prevout == in.prevout) {
// reject the block
return false;
}
}
}
}

// go to the parent block
last = last->pprev;
}
}
}


// Write block to history file
try {
Expand Down
12 changes: 12 additions & 0 deletions src/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,18 @@ class CValidationState;
struct CBlockTemplate;
struct CNodeStateStats;

inline int64_t GetMstrNodCollateral(int nHeight)
{
if(nHeight < 350000)
{
return 200000;
}
else
{
return 1000000;
}
}

/** Default for -blockmaxsize and -blockminsize, which control the range of sizes the mining code will create **/
static const unsigned int DEFAULT_BLOCK_MAX_SIZE = 750000;
static const unsigned int DEFAULT_BLOCK_MIN_SIZE = 0;
Expand Down
4 changes: 2 additions & 2 deletions src/masternode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ void CMasternode::Check(bool forceCheck)
if (!unitTest) {
CValidationState state;
CMutableTransaction tx = CMutableTransaction();
CTxOut vout = CTxOut(199999.99 * COIN, obfuScationPool.collateralPubKey);
CTxOut vout = CTxOut((GetMstrNodCollateral(chainActive.Height())-0.01) * COIN, obfuScationPool.collateralPubKey);
tx.vin.push_back(vin);
tx.vout.push_back(vout);

Expand Down Expand Up @@ -571,7 +571,7 @@ bool CMasternodeBroadcast::CheckInputsAndAdd(int& nDoS)

CValidationState state;
CMutableTransaction tx = CMutableTransaction();
CTxOut vout = CTxOut(199999.99 * COIN, obfuScationPool.collateralPubKey);
CTxOut vout = CTxOut((GetMstrNodCollateral(chainActive.Height())-0.01) * COIN, obfuScationPool.collateralPubKey);
tx.vin.push_back(vin);
tx.vout.push_back(vout);

Expand Down
2 changes: 1 addition & 1 deletion src/masternodeman.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -986,7 +986,7 @@ void CMasternodeMan::ProcessMessage(CNode* pfrom, std::string& strCommand, CData

CValidationState state;
CMutableTransaction tx = CMutableTransaction();
CTxOut vout = CTxOut(199999.99 * COIN, obfuScationPool.collateralPubKey);
CTxOut vout = CTxOut((GetMstrNodCollateral(chainActive.Height())-0.01) * COIN, obfuScationPool.collateralPubKey);
tx.vin.push_back(vin);
tx.vout.push_back(vout);

Expand Down
2 changes: 1 addition & 1 deletion src/obfuscation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2111,7 +2111,7 @@ bool CObfuScationSigner::IsVinAssociatedWithPubkey(CTxIn& vin, CPubKey& pubkey)
uint256 hash;
if (GetTransaction(vin.prevout.hash, txVin, hash, true)) {
BOOST_FOREACH (CTxOut out, txVin.vout) {
if (out.nValue == 200000 * COIN) {
if (out.nValue == GetMstrNodCollateral(chainActive.Height()) * COIN) {
if (out.scriptPubKey == payee2) return true;
}
}
Expand Down
12 changes: 10 additions & 2 deletions src/pow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,18 @@ unsigned int static DarkGravityWave(const CBlockIndex* pindexLast)
if (BlockLastSolved == NULL || BlockLastSolved->nHeight == 0 || BlockLastSolved->nHeight < PastBlocksMin) {
return Params().ProofOfWorkLimit().GetCompact();
}

if (pindexLast->nHeight > Params().LAST_POW_BLOCK()) {
uint256 bnTargetLimit = (~uint256(0) >> 24);
int64_t nTargetSpacing = 60;

int64_t nTargetSpacing = 60;

if (pindexLast->nHeight < 350000) {
int64_t nTargetSpacing = 60;
} else {
int64_t nTargetSpacing = 60 * 3;
}

int64_t nTargetTimespan = 60 * 40;

int64_t nActualSpacing = 0;
Expand Down
4 changes: 2 additions & 2 deletions src/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* network protocol versioning
*/

static const int PROTOCOL_VERSION = 70014;
static const int PROTOCOL_VERSION = 70015;

//! initial proto version, to be increased after version/verack negotiation
static const int INIT_PROTO_VERSION = 209;
Expand All @@ -22,7 +22,7 @@ static const int GETHEADERS_VERSION = 70000;

//! disconnect from peers older than this proto version
static const int MIN_PEER_PROTO_VERSION_BEFORE_ENFORCEMENT = 70004;
static const int MIN_PEER_PROTO_VERSION_AFTER_ENFORCEMENT = 70014;
static const int MIN_PEER_PROTO_VERSION_AFTER_ENFORCEMENT = 70015;

//! nTime field added to CAddress, starting with this version;
//! if possible, avoid requesting addresses nodes older than this
Expand Down
6 changes: 3 additions & 3 deletions src/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1625,13 +1625,13 @@ void CWallet::AvailableCoins(vector<COutput>& vCoins, bool fOnlyConfirmed, const
if (nCoinType == ONLY_DENOMINATED) {
found = IsDenominatedAmount(pcoin->vout[i].nValue);
} else if (nCoinType == ONLY_NOT10000IFMN) {
found = !(fMasterNode && pcoin->vout[i].nValue == 200000 * COIN);
found = !(fMasterNode && pcoin->vout[i].nValue == GetMstrNodCollateral(chainActive.Height()) * COIN);
} else if (nCoinType == ONLY_NONDENOMINATED_NOT10000IFMN) {
if (IsCollateralAmount(pcoin->vout[i].nValue)) continue; // do not use collateral amounts
found = !IsDenominatedAmount(pcoin->vout[i].nValue);
if (found && fMasterNode) found = pcoin->vout[i].nValue != 200000 * COIN; // do not use Hot MN funds
if (found && fMasterNode) found = pcoin->vout[i].nValue != GetMstrNodCollateral(chainActive.Height()) * COIN; // do not use Hot MN funds
} else if (nCoinType == ONLY_10000) {
found = pcoin->vout[i].nValue == 200000 * COIN;
found = pcoin->vout[i].nValue == GetMstrNodCollateral(chainActive.Height()) * COIN;
} else {
found = true;
}
Expand Down