From d94967d9589ad1fbb4c13e8e4a44d8fd4475adc1 Mon Sep 17 00:00:00 2001 From: UdjinM6 Date: Tue, 7 Jul 2015 15:47:22 +0300 Subject: [PATCH] small fixes --- src/coinbase-payee.cpp | 8 ++++---- src/instantx.cpp | 2 +- src/main.cpp | 2 +- src/masternode.h | 1 - src/primitives/transaction.h | 15 +++++++-------- src/qt/transactiondesc.cpp | 2 +- 6 files changed, 14 insertions(+), 16 deletions(-) diff --git a/src/coinbase-payee.cpp b/src/coinbase-payee.cpp index 3b65ed604..6498ff010 100644 --- a/src/coinbase-payee.cpp +++ b/src/coinbase-payee.cpp @@ -28,7 +28,7 @@ bool CCoinbasePayeeDB::Write(const CCoinbasePayee& objToSave) // serialize, checksum data up to that point, then append checksum CDataStream ssObj(SER_DISK, CLIENT_VERSION); - ssObj << strMagicMessage; // masternode cache file specific magic message + ssObj << strMagicMessage; // coinbase payee cache file specific magic message ssObj << FLATDATA(Params().MessageStart()); // network specific magic number ssObj << objToSave; uint256 hash = Hash(ssObj.begin(), ssObj.end()); @@ -102,13 +102,13 @@ CCoinbasePayeeDB::ReadResult CCoinbasePayeeDB::Read(CCoinbasePayee& objToLoad) unsigned char pchMsgTmp[4]; std::string strMagicMessageTmp; try { - // de-serialize file header (masternode cache file specific magic message) and .. + // de-serialize file header (coinbase payee cache file specific magic message) and .. ssObj >> strMagicMessageTmp; // ... verify the message matches predefined one if (strMagicMessage != strMagicMessageTmp) { - error("%s : Invalid masternode cache magic message", __func__); + error("%s : Invalid coinbase payee cache magic message", __func__); return IncorrectMagicMessage; } @@ -242,4 +242,4 @@ void CCoinbasePayee::CleanUp() ++it; } } -} \ No newline at end of file +} diff --git a/src/instantx.cpp b/src/instantx.cpp index d5a11dd5a..25f463cab 100644 --- a/src/instantx.cpp +++ b/src/instantx.cpp @@ -242,7 +242,7 @@ int64_t CreateNewLock(CTransaction tx) CTransactionLock newLock; newLock.nBlockHeight = nBlockHeight; - newLock.nExpiration = GetTime()+(60*60); //locks expire after 60 minutes (6 confirmations) + newLock.nExpiration = GetTime()+(60*60); //locks expire after 60 minutes (24 confirmations) newLock.nTimeout = GetTime()+(60*5); newLock.txHash = tx.GetHash(); mapTxLocks.insert(make_pair(tx.GetHash(), newLock)); diff --git a/src/main.cpp b/src/main.cpp index bb8c75bfc..a64f3d5f1 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1662,9 +1662,9 @@ void CheckForkWarningConditionsOnNewFork(CBlockIndex* pindexNewForkTip) // We define a condition which we should warn the user about as a fork of at least 7 blocks // who's tip is within 72 blocks (+/- 3 hours if no one mines it) of ours + // or a chain that is entirely longer than ours and invalid (note that this should be detected by both) // We use 7 blocks rather arbitrarily as it represents just under 10% of sustained network // hash rate operating on the fork. - // or a chain that is entirely longer than ours and invalid (note that this should be detected by both) // We define it this way because it allows us to only store the highest fork tip (+ base) which meets // the 7-block condition and from this always have the most-likely-to-cause-warning fork if (pfork && (!pindexBestForkTip || (pindexBestForkTip && pindexNewForkTip->nHeight > pindexBestForkTip->nHeight)) && diff --git a/src/masternode.h b/src/masternode.h index 3aca35703..89eba8e49 100644 --- a/src/masternode.h +++ b/src/masternode.h @@ -11,7 +11,6 @@ #include "util.h" #include "base58.h" #include "main.h" -#include "masternode.h" #include "timedata.h" #define MASTERNODE_NOT_PROCESSED 0 // initial state diff --git a/src/primitives/transaction.h b/src/primitives/transaction.h index 851bf7db8..af2c09738 100644 --- a/src/primitives/transaction.h +++ b/src/primitives/transaction.h @@ -143,14 +143,13 @@ public: bool IsDust(CFeeRate minRelayTxFee) const { - // "Dust" is defined in terms of CTransaction::minRelayTxFee, - // which has units satoshis-per-kilobyte. - // If you'd pay more than 1/3 in fees - // to spend something, then we consider it dust. - // A typical txout is 34 bytes big, and will - // need a CTxIn of at least 148 bytes to spend: - // so dust is a txout less than 546 satoshis - // with default minRelayTxFee. + // "Dust" is defined in terms of CTransaction::minRelayTxFee, which has units duffs-per-kilobyte. + // If you'd pay more than 1/3 in fees to spend something, then we consider it dust. + // A typical txout is 34 bytes big, and will need a CTxIn of at least 148 bytes to spend + // i.e. total is 148 + 32 = 182 bytes. Default -minrelaytxfee is 10000 duffs per kB + // and that means that fee per txout is 182 * 10000 / 1000 = 1820 duffs. + // So dust is a txout less than 1820 *3 = 5460 duffs + // with default -minrelaytxfee = minRelayTxFee = 10000 duffs per kB. size_t nSize = GetSerializeSize(SER_DISK,0)+148u; return (nValue < 3*minRelayTxFee.GetFee(nSize)); } diff --git a/src/qt/transactiondesc.cpp b/src/qt/transactiondesc.cpp index fbbd881ab..5fb1573ed 100644 --- a/src/qt/transactiondesc.cpp +++ b/src/qt/transactiondesc.cpp @@ -346,7 +346,7 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx, TransactionReco strHTML += QString::fromStdString(CBitcoinAddress(address).ToString()); } strHTML = strHTML + " " + tr("Amount") + "=" + BitcoinUnits::formatHtmlWithUnit(unit, vout.nValue); - strHTML = strHTML + " IsMine=" + (wallet->IsMine(vout) & ISMINE_SPENDABLE ? tr("true") : tr("false")) + ""; + strHTML = strHTML + " IsMine=" + (wallet->IsMine(vout) & ISMINE_SPENDABLE ? tr("true") : tr("false")); strHTML = strHTML + " IsWatchOnly=" + (wallet->IsMine(vout) & ISMINE_WATCH_ONLY ? tr("true") : tr("false")) + ""; } }