diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/chainparams.cpp | 12 | ||||
| -rw-r--r-- | src/main.h | 18 | ||||
| -rw-r--r-- | src/qt/paymentrequest.proto | 17 | ||||
| -rw-r--r-- | src/qt/paymentserver.cpp | 11 |
4 files changed, 30 insertions, 28 deletions
diff --git a/src/chainparams.cpp b/src/chainparams.cpp index c98a4b7e4..3720dc6c7 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -37,9 +37,9 @@ public: // Blocks 0 - 144999 are conventional difficulty calculation consensus.nSubsidyHalvingInterval = 100000; - consensus.nMajorityEnforceBlockUpgrade = 750; - consensus.nMajorityRejectBlockOutdated = 950; - consensus.nMajorityWindow = 1000; + consensus.nMajorityEnforceBlockUpgrade = 1500; + consensus.nMajorityRejectBlockOutdated = 1900; + consensus.nMajorityWindow = 2000; consensus.powLimit = uint256S("0x00000fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); // ~uint256(0) >> 20; consensus.nPowTargetTimespan = 4 * 60 * 60; // pre-digishield: 4 hours consensus.nPowTargetSpacing = 60; // 1 minute @@ -181,9 +181,9 @@ public: consensus.fDigishieldDifficultyCalculation = false; consensus.fPowAllowMinDifficultyBlocks = true; consensus.fPowAllowDigishieldMinDifficultyBlocks = false; - consensus.nMajorityEnforceBlockUpgrade = 51; - consensus.nMajorityRejectBlockOutdated = 75; - consensus.nMajorityWindow = 100; + consensus.nMajorityEnforceBlockUpgrade = 501; + consensus.nMajorityRejectBlockOutdated = 750; + consensus.nMajorityWindow = 1000; consensus.fStrictChainId = false; consensus.nHeightEffective = 0; consensus.fAllowLegacyBlocks = true; diff --git a/src/main.h b/src/main.h index d09540aa4..d656526c6 100644 --- a/src/main.h +++ b/src/main.h @@ -131,17 +131,17 @@ extern bool fPruneMode; /** Number of MiB of block files that we're trying to stay below. */ extern uint64_t nPruneTarget; /** Block files containing a block-height within MIN_BLOCKS_TO_KEEP of chainActive.Tip() will not be pruned. */ -static const signed int MIN_BLOCKS_TO_KEEP = 288; +static const signed int MIN_BLOCKS_TO_KEEP = 1440; -// Require that user allocate at least 550MB for block & undo files (blk???.dat and rev???.dat) -// At 1MB per block, 288 blocks = 288MB. -// Add 15% for Undo data = 331MB -// Add 20% for Orphan block rate = 397MB -// We want the low water mark after pruning to be at least 397 MB and since we prune in +// Require that user allocate at least 2,200MB for block & undo files (blk???.dat and rev???.dat) +// At 1MB per block, 1,440 blocks = 1,440MB. +// Add 15% for Undo data = 1,656MB +// Add 20% for Orphan block rate = 1,987MB +// We want the low water mark after pruning to be at least 1,987 MB and since we prune in // full block file chunks, we need the high water mark which triggers the prune to be -// one 128MB block file + added 15% undo data = 147MB greater for a total of 545MB -// Setting the target to > than 550MB will make it likely we can respect the target. -static const signed int MIN_DISK_SPACE_FOR_BLOCK_FILES = 550 * 1024 * 1024; +// one 128MB block file + added 15% undo data = 147MB greater for a total of 2,134MB +// Setting the target to > than 2,200MB will make it likely we can respect the target. +static const uint64_t MIN_DISK_SPACE_FOR_BLOCK_FILES = 2200ULL * 1024 * 1024; /** Register with a network node to receive its signals */ void RegisterNodeSignals(CNodeSignals& nodeSignals); diff --git a/src/qt/paymentrequest.proto b/src/qt/paymentrequest.proto index b2281c4c7..964d6e173 100644 --- a/src/qt/paymentrequest.proto +++ b/src/qt/paymentrequest.proto @@ -1,22 +1,23 @@ // -// Simple Bitcoin Payment Protocol messages +// Simple Dogecoin Payment Protocol messages +// Derived fromthe Bitcoin Payment Protocol // // Use fields 100+ for extensions; -// to avoid conflicts, register extensions at: -// https://en.bitcoin.it/wiki/Payment_Request +// to avoid conflicts, register extensions via pull-req at: +// https://github.com/dogecoin/dips // package payments; -option java_package = "org.bitcoin.protocols.payments"; +option java_package = "com.dogecoin.protocols.payments"; option java_outer_classname = "Protos"; -// Generalized form of "send payment to this/these bitcoin addresses" +// Generalized form of "send payment to this/these dogecoin addresses" message Output { - optional uint64 amount = 1 [default = 0]; // amount is integer-number-of-satoshis - required bytes script = 2; // usually one of the standard Script forms + optional uint64 amount = 1 [default = 0]; // amount is integer-number-of-satoshis + required bytes script = 2; // usually one of the standard Script forms } message PaymentDetails { - optional string network = 1 [default = "main"]; // "main" or "test" + optional string genesis = 1 [default = "1a91e3dace36e2be3bf030a65679fe821aa1d6ef92e7c9902eb318182c355691"]; // Hash of the network genesis block repeated Output outputs = 2; // Where payment should be sent required uint64 time = 3; // Timestamp; when payment request created optional uint64 expires = 4; // Timestamp; when this request should be considered invalid diff --git a/src/qt/paymentserver.cpp b/src/qt/paymentserver.cpp index 09e9949b1..6e4206e6f 100644 --- a/src/qt/paymentserver.cpp +++ b/src/qt/paymentserver.cpp @@ -241,11 +241,11 @@ void PaymentServer::ipcParseCommandLine(int argc, char* argv[]) PaymentRequestPlus request; if (readPaymentRequestFromFile(arg, request)) { - if (request.getDetails().network() == "main") + if (request.getDetails().genesis() == "1a91e3dace36e2be3bf030a65679fe821aa1d6ef92e7c9902eb318182c355691") { SelectParams(CBaseChainParams::MAIN); } - else if (request.getDetails().network() == "test") + else if (request.getDetails().genesis() == "bb0a78264637406b6360aad926284d544d7049f45189db5664f3c4d07350559e") { SelectParams(CBaseChainParams::TESTNET); } @@ -770,12 +770,13 @@ void PaymentServer::handlePaymentACK(const QString& paymentACKMsg) bool PaymentServer::verifyNetwork(const payments::PaymentDetails& requestDetails) { - bool fVerified = requestDetails.network() == Params().NetworkIDString(); + Consensus::Params consensus = Params().GetConsensus(0); + bool fVerified = requestDetails.genesis() == consensus.hashGenesisBlock.GetHex(); if (!fVerified) { qWarning() << QString("PaymentServer::%1: Payment request network \"%2\" doesn't match client network \"%3\".") .arg(__func__) - .arg(QString::fromStdString(requestDetails.network())) - .arg(QString::fromStdString(Params().NetworkIDString())); + .arg(QString::fromStdString(requestDetails.genesis())) + .arg(QString::fromStdString(consensus.hashGenesisBlock.GetHex())); } return fVerified; } |