Skip to content

Commit

Permalink
Merge pull request #15 from coolblock/master
Browse files Browse the repository at this point in the history
Rollback to v0.12.1.8
  • Loading branch information
coolblock committed Jan 4, 2019
2 parents 55cda38 + 1cf518a commit a0d81ab
Show file tree
Hide file tree
Showing 15 changed files with 68 additions and 120 deletions.
2 changes: 1 addition & 1 deletion configure.ac
Expand Up @@ -3,7 +3,7 @@ AC_PREREQ([2.60])
define(_CLIENT_VERSION_MAJOR, 0)
define(_CLIENT_VERSION_MINOR, 12)
define(_CLIENT_VERSION_REVISION, 1)
define(_CLIENT_VERSION_BUILD, 9)
define(_CLIENT_VERSION_BUILD, 8)
define(_CLIENT_VERSION_IS_RELEASE, true)
define(_COPYRIGHT_YEAR, 2018)
AC_INIT([Vivo Core],[_CLIENT_VERSION_MAJOR._CLIENT_VERSION_MINOR._CLIENT_VERSION_REVISION],[https://github.com/vivocoin/vivo/issues],[vivocore])
Expand Down
2 changes: 1 addition & 1 deletion qa/rpc-tests/test_framework/mininode.py
Expand Up @@ -35,7 +35,7 @@
import vivo_hash

BIP0031_VERSION = 60000
MY_VERSION = 70209 # current MIN_PEER_PROTO_VERSION
MY_VERSION = 70206 # current MIN_PEER_PROTO_VERSION
MY_SUBVERSION = b"/python-mininode-tester:0.0.2/"

MAX_INV_SZ = 50000
Expand Down
Binary file modified share/pixmaps/nsis-wizard.bmp
Binary file not shown.
27 changes: 20 additions & 7 deletions src/chainparams.cpp
Expand Up @@ -116,8 +116,12 @@ class CMainParams : public CChainParams {
pchMessageStart[1] = 0x42;
pchMessageStart[2] = 0x5b;
pchMessageStart[3] = 0xa7;
vAlertPubKey = ParseHex("04213196463a1b3d9cc2e353a6dc721d992e4177f8988a16a41665e36d1ef78ebce5ccbe66c393e90ab8447e88767242ccfa520eb6c0c1ba2a471b803ee0b2d680");
nDefaultPort = 12845;

//vAlertPubKey = ParseHex("04213196463a1b3d9cc2e353a6dc721d992e4177f8988a16a41665e36d1ef78ebce5ccbe66c393e90ab8447e88767242ccfa520eb6c0c1ba2a471b803ee0b2d680");
vAlertPubKey = ParseHex("0476a1ada6f2c9b5ad0a61b1abfc58ed684cf67466d4e519f0a27161dd25f85560dccb309e39a6fdd2e91fb8f6e808b59f3c4044bff4df4d41b35d441c75938f4f");


nDefaultPort = 12845;
nMaxTipAge = 6 * 60 * 60; // ~144 blocks behind -> 2 x fork detection time, was 24 * 60 * 60 in bitcoin
nPruneAfterHeight = 100000;

Expand Down Expand Up @@ -153,9 +157,13 @@ class CMainParams : public CChainParams {

nPoolMaxTransactions = 3;
nFulfilledRequestExpireTime = 60*60; // fulfilled requests expire in 1 hour
strSporkPubKey = "04b86b64c7573319f5cfbb188b0961ba6e6f92030c356ff942ba80488df92b8ecb8e3fefb7820c3243fd2a2d4c7e0cb5af2859302bd0fe4da8a7e5a996065e9cf6";
strMasternodePaymentsPubKey = "04b86b64c7573319f5cfbb188b0961ba6e6f92030c356ff942ba80488df92b8ecb8e3fefb7820c3243fd2a2d4c7e0cb5af2859302bd0fe4da8a7e5a996065e9cf6";
//strSporkPubKey = "04b86b64c7573319f5cfbb188b0961ba6e6f92030c356ff942ba80488df92b8ecb8e3fefb7820c3243fd2a2d4c7e0cb5af2859302bd0fe4da8a7e5a996065e9cf6";
//strMasternodePaymentsPubKey = "04b86b64c7573319f5cfbb188b0961ba6e6f92030c356ff942ba80488df92b8ecb8e3fefb7820c3243fd2a2d4c7e0cb5af2859302bd0fe4da8a7e5a996065e9cf6";

strSporkPubKey = "04075cbd8aca7ac8bf628fee499242d99daa7eea51d34a223e96cf489fd3b83088dd96d536aeec4d4252a46a29becb7b9e74b49bcea010092840d62fb0f3383bf8";
strMasternodePaymentsPubKey = "04075cbd8aca7ac8bf628fee499242d99daa7eea51d34a223e96cf489fd3b83088dd96d536aeec4d4252a46a29becb7b9e74b49bcea010092840d62fb0f3383bf8";


checkpointData = (CCheckpointData) {
boost::assign::map_list_of
( 0, uint256S("0x00000f6be3e151f9082a2b82c2916192a791090015b80979934a45d625460d62"))
Expand Down Expand Up @@ -217,7 +225,9 @@ class CTestNetParams : public CChainParams {
pchMessageStart[1] = 0x24;
pchMessageStart[2] = 0xb5;
pchMessageStart[3] = 0x7a;
vAlertPubKey = ParseHex("0476a1ada6f2c9b5ad0a61b1abfc58ed684cf67466d4e519f0a27161dd25f85560dccb309e39a6fdd2e91fb8f6e808b59f3c4044bff4df4d41b35d441c75938f4f");
//vAlertPubKey = ParseHex("0476a1ada6f2c9b5ad0a61b1abfc58ed684cf67466d4e519f0a27161dd25f85560dccb309e39a6fdd2e91fb8f6e808b59f3c4044bff4df4d41b35d441c75938f4f");
vAlertPubKey = ParseHex("04213196463a1b3d9cc2e353a6dc721d992e4177f8988a16a41665e36d1ef78ebce5ccbe66c393e90ab8447e88767242ccfa520eb6c0c1ba2a471b803ee0b2d680");

nDefaultPort = 13845;
nMaxTipAge = 0x7fffffff; // allow mining on top of old blocks for testnet
nPruneAfterHeight = 1000;
Expand Down Expand Up @@ -254,9 +264,12 @@ class CTestNetParams : public CChainParams {

nPoolMaxTransactions = 3;
nFulfilledRequestExpireTime = 5*60; // fulfilled requests expire in 5 minutes
strSporkPubKey = "04075cbd8aca7ac8bf628fee499242d99daa7eea51d34a223e96cf489fd3b83088dd96d536aeec4d4252a46a29becb7b9e74b49bcea010092840d62fb0f3383bf8";
strMasternodePaymentsPubKey = "04075cbd8aca7ac8bf628fee499242d99daa7eea51d34a223e96cf489fd3b83088dd96d536aeec4d4252a46a29becb7b9e74b49bcea010092840d62fb0f3383bf8";
//strSporkPubKey = "04075cbd8aca7ac8bf628fee499242d99daa7eea51d34a223e96cf489fd3b83088dd96d536aeec4d4252a46a29becb7b9e74b49bcea010092840d62fb0f3383bf8";
//strMasternodePaymentsPubKey = "04075cbd8aca7ac8bf628fee499242d99daa7eea51d34a223e96cf489fd3b83088dd96d536aeec4d4252a46a29becb7b9e74b49bcea010092840d62fb0f3383bf8";

strSporkPubKey = "04b86b64c7573319f5cfbb188b0961ba6e6f92030c356ff942ba80488df92b8ecb8e3fefb7820c3243fd2a2d4c7e0cb5af2859302bd0fe4da8a7e5a996065e9cf6";
strMasternodePaymentsPubKey = "04b86b64c7573319f5cfbb188b0961ba6e6f92030c356ff942ba80488df92b8ecb8e3fefb7820c3243fd2a2d4c7e0cb5af2859302bd0fe4da8a7e5a996065e9cf6";

checkpointData = (CCheckpointData) {
boost::assign::map_list_of
( 0, uint256S("0x00000f6be3e151f9082a2b82c2916192a791090015b80979934a45d625460d62")),
Expand Down
39 changes: 26 additions & 13 deletions src/chainparamsseeds.h
@@ -1,5 +1,5 @@
#ifndef VIVO_CHAINPARAMSSEEDS_H
#define VIVO_CHAINPARAMSSEEDS_H
#ifndef BITCOIN_CHAINPARAMSSEEDS_H
#define BITCOIN_CHAINPARAMSSEEDS_H
/**
* List of fixed seed nodes for the vivo network
* AUTOGENERATED by contrib/seeds/generate-seeds.py
Expand All @@ -8,18 +8,31 @@
* IPv4 as well as onion addresses are wrapped inside a IPv6 address accordingly.
*/
static SeedSpec6 pnSeed6_main[] = {
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x2d,0x4c,0xa9,0xd6}, 12845},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x95,0xf8,0x06,0x4d}, 12845},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x90,0xca,0x57,0x8c}, 12845},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x90,0xca,0x75,0x8f}, 12845},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xcf,0xf6,0x65,0x76}, 12845},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x2d,0x20,0x54,0x4f}, 12845},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xcf,0xf6,0x6f,0x75}, 12845},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x95,0x1c,0x53,0x01}, 12845},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x8c,0x52,0x20,0xde}, 12845}
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x68,0x83,0xa0,0xd5}, 12845},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x68,0xc8,0x43,0x69}, 12845},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x5f,0x4d,0x62,0x89}, 12845},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x2d,0x20,0x46,0xad}, 12845},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x6b,0xac,0xa5,0xbd}, 12845},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x6b,0xac,0x19,0x62}, 12845},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x2e,0x24,0x24,0xaf}, 12845},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x6b,0xac,0x19,0x63}, 12845},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x50,0xd0,0xe1,0x7f}, 12845},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x34,0xb2,0x18,0xab}, 12845},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x0d,0x50,0x40,0x64}, 12845},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x0d,0x51,0xcb,0xe0}, 12845},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x50,0xd0,0xe5,0xaa}, 12845},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xbc,0x78,0xf8,0x80}, 12845},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x23,0xc5,0x56,0xd3}, 12845},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x05,0xc4,0x01,0x32}, 12845}
};

static SeedSpec6 pnSeed6_test[] = {

{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x34,0xb2,0x18,0xab}, 12845},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x0d,0x50,0x40,0x64}, 12845},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x0d,0x51,0xcb,0xe0}, 12845},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x50,0xd0,0xe5,0xaa}, 12845},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xbc,0x78,0xf8,0x80}, 12845},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x23,0xc5,0x56,0xd3}, 12845},
{{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x05,0xc4,0x01,0x32}, 12845}
};
#endif // VIVO_CHAINPARAMSSEEDS_H
#endif // BITCOIN_CHAINPARAMSSEEDS_H
12 changes: 3 additions & 9 deletions src/main.cpp
Expand Up @@ -5267,21 +5267,15 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
CAddress addrFrom;
uint64_t nNonce = 1;
vRecv >> pfrom->nVersion >> pfrom->nServices >> nTime >> addrMe;
//if (pfrom->nVersion < MIN_PEER_PROTO_VERSION)

if ((pfrom->nVersion < 70209 && chainActive.Tip()->nHeight >= BLOCKS_AFTER_5000_COLLATERAL_CHANGE ) || (pfrom->nVersion < 70206 && chainActive.Tip()->nHeight < BLOCKS_AFTER_5000_COLLATERAL_CHANGE))
if (pfrom->nVersion < MIN_PEER_PROTO_VERSION)
{
// disconnect from peers older than this proto version
LogPrintf("peer=%d using obsolete version %i; disconnecting\n", pfrom->id, pfrom->nVersion);
LogPrintf("peer=%d using obsolete version %i; disconnecting\n", pfrom->id, pfrom->nVersion);
pfrom->PushMessage(NetMsgType::REJECT, strCommand, REJECT_OBSOLETE,
strprintf("Version must be %d or greater", MIN_PEER_PROTO_VERSION));
pfrom->fDisconnect = true;
return false;
} else {

LogPrintf("peer=%d using NOT obsolete - is version %i; ALLOWING connecting\n", pfrom->id, pfrom->nVersion);
LogPrintf("height is: %d\n", chainActive.Tip()->nHeight);
}
}

if (pfrom->nVersion == 10300)
pfrom->nVersion = 300;
Expand Down
20 changes: 5 additions & 15 deletions src/masternode.cpp
Expand Up @@ -379,7 +379,7 @@ void CMasternode::UpdateLastPaid(const CBlockIndex *pindex, int nMaxBlocksToScan
CBlock block;
if(!ReadBlockFromDisk(block, BlockReading, Params().GetConsensus())) // shouldn't really happen
continue;
//zzzzzzzzzzzzz

CAmount nMasternodePayment = GetMasternodePayment(BlockReading->nHeight, block.vtx[0].GetValueOut());

BOOST_FOREACH(CTxOut txout, block.vtx[0].vout)
Expand Down Expand Up @@ -624,18 +624,10 @@ bool CMasternodeBroadcast::CheckOutpoint(int& nDos)
LogPrint("masternode", "CMasternodeBroadcast::CheckOutpoint -- Failed to find Masternode UTXO, masternode=%s\n", vin.prevout.ToStringShort());
return false;
}

if (chainActive.Height() < BLOCKS_AFTER_5000_COLLATERAL_CHANGE) {
if(coins.vout[vin.prevout.n].nValue != 1000 * COIN) {
LogPrint("masternode", "CMasternodeBroadcast::CheckOutpoint -- Masternode UTXO should have 1000 VIVO, masternode=%s\n", vin.prevout.ToStringShort());
return false;
}
} else {
if(coins.vout[vin.prevout.n].nValue != 5000 * COIN) {
LogPrint("masternode", "CMasternodeBroadcast::CheckOutpoint -- Masternode UTXO should have 5000 VIVO, masternode=%s\n", vin.prevout.ToStringShort());
return false;
}
}
if(coins.vout[vin.prevout.n].nValue != 1000 * COIN) {
LogPrint("masternode", "CMasternodeBroadcast::CheckOutpoint -- Masternode UTXO should have 1000 VIVO, masternode=%s\n", vin.prevout.ToStringShort());
return false;
}
if(chainActive.Height() - coins.nHeight + 1 < Params().GetConsensus().nMasternodeMinimumConfirmations) {
LogPrintf("CMasternodeBroadcast::CheckOutpoint -- Masternode UTXO must have at least %d confirmations, masternode=%s\n",
Params().GetConsensus().nMasternodeMinimumConfirmations, vin.prevout.ToStringShort());
Expand Down Expand Up @@ -830,8 +822,6 @@ bool CMasternodePing::CheckAndUpdate(CMasternode* pmn, bool fFromNewBroadcast, i
BlockMap::iterator mi = mapBlockIndex.find(blockHash);
if ((*mi).second && (*mi).second->nHeight < chainActive.Height() - 24) {
LogPrintf("CMasternodePing::CheckAndUpdate -- Masternode ping is invalid, block hash is too old: masternode=%s blockHash=%s\n", vin.prevout.ToStringShort(), blockHash.ToString());
LogPrintf("ping result: mi height=%d active chain height=%d\n", (*mi).second->nHeight, chainActive.Height() );

// nDos = 1;
return false;
}
Expand Down
22 changes: 0 additions & 22 deletions src/masternodeman.cpp
Expand Up @@ -11,8 +11,6 @@
#include "masternodeman.h"
#include "netfulfilledman.h"
#include "util.h"
#include "init.h"


/** Masternode manager */
CMasternodeMan mnodeman;
Expand Down Expand Up @@ -1055,26 +1053,6 @@ void CMasternodeMan::CheckSameAddr()
sort(vSortedByAddr.begin(), vSortedByAddr.end(), CompareByAddr());

BOOST_FOREACH(CMasternode* pmn, vSortedByAddr) {

// Ban if is out of inflation control
if (pmn != NULL && chainActive.Height() >= BLOCKS_AFTER_5000_COLLATERAL_CHANGE) {
std::vector<COutput> found1kouts;
pwalletMain->AvailableCoins(found1kouts, true, NULL, false, ONLY_1000);
//check all outputs for the txid hash
std::string checkvin = pmn->vin.prevout.ToStringShort();
BOOST_FOREACH(COutput& out, found1kouts) {
std::string checkcol = out.tx->GetHash().ToString();
if (checkvin == checkcol) { //we have a match of a 1k node
vBan.push_back(pmn);
}
}
}






// check only (pre)enabled masternodes
if(!pmn->IsEnabled() && !pmn->IsPreEnabled()) continue;
// initial step
Expand Down
17 changes: 2 additions & 15 deletions src/net.cpp
Expand Up @@ -1030,8 +1030,6 @@ void ThreadSocketHandler()
{
LogPrintf("ThreadSocketHandler -- removing node: peer=%d addr=%s nRefCount=%d fNetworkNode=%d fInbound=%d fMasternode=%d\n",
pnode->id, pnode->addr.ToString(), pnode->GetRefCount(), pnode->fNetworkNode, pnode->fInbound, pnode->fMasternode);

LogPrintf("nnnn ThreadSocketHandler");

// remove from vNodes
vNodes.erase(remove(vNodes.begin(), vNodes.end(), pnode), vNodes.end());
Expand Down Expand Up @@ -2136,21 +2134,10 @@ void RelayTransaction(const CTransaction& tx, const CDataStream& ss)
}

void RelayInv(CInv &inv, const int minProtoVersion) {
int nBestHeight=g_signals.GetHeight().get_value_or(0);
//LogPrintf(" bestheight:%d ", nBestHeight );

LOCK(cs_vNodes);
BOOST_FOREACH(CNode* pnode, vNodes)
//zzzzzzz
if ( nBestHeight >= BLOCKS_AFTER_5000_COLLATERAL_CHANGE) {
if(pnode->nVersion >= minProtoVersion)
pnode->PushInventory(inv);
//LogPrintf(" push inventory (after) \n ");
} else {
if(pnode->nVersion >= 70206)
pnode->PushInventory(inv);
//LogPrintf(" push inventory (before) \n ");
}
if(pnode->nVersion >= minProtoVersion)
pnode->PushInventory(inv);
}

void CNode::RecordBytesRecv(uint64_t bytes)
Expand Down
Binary file modified src/qt/res/images/light/splash.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 3 additions & 17 deletions src/rpcmasternode.cpp
Expand Up @@ -371,26 +371,12 @@ UniValue masternode(const UniValue& params, bool fHelp)
if (strCommand == "outputs") {
// Find possible candidates
std::vector<COutput> vPossibleCoins;
std::vector<COutput> vPossibleCoinsv2;

pwalletMain->AvailableCoins(vPossibleCoins, true, NULL, false, ONLY_1000);

if (chainActive.Height() < BLOCKS_AFTER_5000_COLLATERAL_CHANGE) {
pwalletMain->AvailableCoins(vPossibleCoins, true, NULL, false, ONLY_1000);
}

pwalletMain->AvailableCoins(vPossibleCoinsv2, true, NULL, false, ONLY_5000);

UniValue obj(UniValue::VOBJ);

BOOST_FOREACH(COutput& out, vPossibleCoinsv2) {
obj.push_back(Pair(out.tx->GetHash().ToString(), strprintf("%d", out.i)));
}

BOOST_FOREACH(COutput& out, vPossibleCoins) {
obj.push_back(Pair("Warning", strprintf("The output in the line below will not be useable after block %d, 5000 will be needed for collateral:", BLOCKS_AFTER_5000_COLLATERAL_CHANGE)));
UniValue obj(UniValue::VOBJ);
BOOST_FOREACH(COutput& out, vPossibleCoins) {
obj.push_back(Pair(out.tx->GetHash().ToString(), strprintf("%d", out.i)));
}
}

return obj;

Expand Down
2 changes: 1 addition & 1 deletion src/util.h
Expand Up @@ -270,5 +270,5 @@ template <typename Callable> void TraceThread(const char* name, Callable func)
throw;
}
}
#define BLOCKS_AFTER_5000_COLLATERAL_CHANGE 330897

#endif // BITCOIN_UTIL_H
4 changes: 2 additions & 2 deletions src/version.h
Expand Up @@ -10,7 +10,7 @@
* network protocol versioning
*/

static const int PROTOCOL_VERSION = 70209;
static const int PROTOCOL_VERSION = 70206;

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

//! disconnect from peers older than this proto version
static const int MIN_PEER_PROTO_VERSION = 70209;
static const int MIN_PEER_PROTO_VERSION = 70206;

//! nTime field added to CAddress, starting with this version;
//! if possible, avoid requesting addresses nodes older than this
Expand Down
18 changes: 3 additions & 15 deletions src/wallet/wallet.cpp
Expand Up @@ -2120,8 +2120,6 @@ void CWallet::AvailableCoins(vector<COutput>& vCoins, bool fOnlyConfirmed, const
if(found && fMasterNode) found = pcoin->vout[i].nValue != 1000*COIN; // do not use Hot MN funds
} else if(nCoinType == ONLY_1000) {
found = pcoin->vout[i].nValue == 1000*COIN;
} else if(nCoinType == ONLY_5000) {
found = pcoin->vout[i].nValue == 5000*COIN;
} else if(nCoinType == ONLY_PRIVATESEND_COLLATERAL) {
found = IsCollateralAmount(pcoin->vout[i].nValue);
} else {
Expand All @@ -2131,7 +2129,7 @@ void CWallet::AvailableCoins(vector<COutput>& vCoins, bool fOnlyConfirmed, const

isminetype mine = IsMine(pcoin->vout[i]);
if (!(IsSpent(wtxid, i)) && mine != ISMINE_NO &&
(!IsLockedCoin((*it).first, i) || nCoinType == ONLY_1000 || nCoinType == ONLY_5000) &&
(!IsLockedCoin((*it).first, i) || nCoinType == ONLY_1000) &&
(pcoin->vout[i].nValue > 0 || fIncludeZeroValue) &&
(!coinControl || !coinControl->HasSelected() || coinControl->fAllowOtherInputs || coinControl->IsSelected((*it).first, i)))
vCoins.push_back(COutput(pcoin, i, nDepth,
Expand Down Expand Up @@ -2703,14 +2701,8 @@ bool CWallet::GetMasternodeVinAndKeys(CTxIn& txinRet, CPubKey& pubKeyRet, CKey&

// Find possible candidates
std::vector<COutput> vPossibleCoins;
std::vector<COutput> vPossibleCoins5k;
if (chainActive.Height() < BLOCKS_AFTER_5000_COLLATERAL_CHANGE) {
AvailableCoins(vPossibleCoins, true, NULL, false, ONLY_1000);
AvailableCoins(vPossibleCoins5k, true, NULL, false, ONLY_5000);
} else {
AvailableCoins(vPossibleCoins, true, NULL, false, ONLY_5000);
}
if(vPossibleCoins.empty() && vPossibleCoins5k.empty()) {
AvailableCoins(vPossibleCoins, true, NULL, false, ONLY_1000);
if(vPossibleCoins.empty()) {
LogPrintf("CWallet::GetMasternodeVinAndKeys -- Could not locate any valid masternode vin\n");
return false;
}
Expand All @@ -2726,10 +2718,6 @@ bool CWallet::GetMasternodeVinAndKeys(CTxIn& txinRet, CPubKey& pubKeyRet, CKey&
if(out.tx->GetHash() == txHash && out.i == nOutputIndex) // found it!
return GetVinAndKeysFromOutput(out, txinRet, pubKeyRet, keyRet);

BOOST_FOREACH(COutput& out, vPossibleCoins5k)
if(out.tx->GetHash() == txHash && out.i == nOutputIndex) // found it!
return GetVinAndKeysFromOutput(out, txinRet, pubKeyRet, keyRet);

LogPrintf("CWallet::GetMasternodeVinAndKeys -- Could not locate specified masternode vin\n");
return false;
}
Expand Down

0 comments on commit a0d81ab

Please sign in to comment.