diff --git a/COPYING b/COPYING index 6e9ff50323e9f..b8eb409e7827c 100644 --- a/COPYING +++ b/COPYING @@ -1,6 +1,6 @@ -Copyright (c) 2009-2016 Bitcoin Developers -Copyright (c) 2011-2016 Litecoin Developers -Copyright (c) 2013-2016 Florincoin Developers +Copyright (c) 2009-2017 Bitcoin Developers +Copyright (c) 2011-2017 Litecoin Developers +Copyright (c) 2013-2017 Florincoin Developers Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/configure.ac b/configure.ac index 730ea0bf3064f..c50ae8280618d 100644 --- a/configure.ac +++ b/configure.ac @@ -3,9 +3,9 @@ AC_PREREQ([2.60]) define(_CLIENT_VERSION_MAJOR, 0) define(_CLIENT_VERSION_MINOR, 10) define(_CLIENT_VERSION_REVISION, 4) -define(_CLIENT_VERSION_BUILD, 0) +define(_CLIENT_VERSION_BUILD, 6) define(_CLIENT_VERSION_IS_RELEASE, true) -define(_COPYRIGHT_YEAR, 2016) +define(_COPYRIGHT_YEAR, 2017) AC_INIT([Florincoin Core],[_CLIENT_VERSION_MAJOR._CLIENT_VERSION_MINOR._CLIENT_VERSION_REVISION._CLIENT_VERSION_BUILD],[info@florincoin.org],[florincoin]) AC_CONFIG_SRCDIR([src/main.cpp]) AC_CONFIG_HEADERS([src/config/bitcoin-config.h]) diff --git a/src/chainparams.cpp b/src/chainparams.cpp index 1fc41127eff87..b6777252763bd 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -71,11 +71,16 @@ static Checkpoints::MapCheckpoints mapCheckpoints = (696454, uint256("0x8cfb75684405e22f8f69522ec11f1e5206758e37f25db13880548f69fe6f1976")) (955000, uint256("0xb5517a50aee6af59eb0ab4ee3262bcbaf3f6672b9301cdd3302e4bab491e7526")) (1505017, uint256("0xd38b306850bb26a5c98400df747d4391bb4e359e95e20dc79b50063ed3c5bfa7")) + (1678879, uint256("0x1e874e2852e8dfb3553f0e6c02dcf70e9f5697effa31385d25a3c88fe26676fc")) + (1678909, uint256("0x4c5a1040e337a542e6717904c8346bd72151fc34c390dff7b5cf23dcedc5058a")) + (1679162, uint256("0xb32c64fb80a4196ff3e1be883db10629e1d7cd27c00ef0b5d1fe54af481fc10f")) + (1796633, uint256("0xc2da8b936a7f2c0de02aa0c6c45f3d971ebad78655255a945b0e60b62f27d445")) + (2094558, uint256("0x946616c88286f32bfac15868456d87a86f8611e1f9b56594b81e46831ce43f81")) ; static const Checkpoints::CCheckpointData data = { &mapCheckpoints, - 1449731549, // * UNIX timestamp of last checkpoint block - 1993612, // * total number of transactions between genesis and last checkpoint + 1488680849, // * UNIX timestamp of last checkpoint block + 2660400, // * total number of transactions between genesis and last checkpoint // (the tx=... number in the SetBestChain debug.log lines) 2160.0 // * estimated number of transactions per day after checkpoint }; @@ -201,6 +206,12 @@ class CMainParams : public CChainParams { vSeeds.push_back(CDNSSeedData("seed2.florincoin.com", "seed2.florincoin.com")); vSeeds.push_back(CDNSSeedData("seed3.florincoin.com", "seed3.florincoin.com")); vSeeds.push_back(CDNSSeedData("seed4.florincoin.com", "seed4.florincoin.com")); + vSeeds.push_back(CDNSSeedData("nyc2.entertheblockchain.com", "nyc2.entertheblockchain.com")); + vSeeds.push_back(CDNSSeedData("sf1.entertheblockchain.com", "sf1.entertheblockchain.com")); + vSeeds.push_back(CDNSSeedData("am2.entertheblockchain.com", "am2.entertheblockchain.com")); + vSeeds.push_back(CDNSSeedData("sgp.entertheblockchain.com", "sgp.entertheblockchain.com")); + vSeeds.push_back(CDNSSeedData("ind.entertheblockchain.com", "ind.entertheblockchain.com")); + vSeeds.push_back(CDNSSeedData("de.entertheblockchain.com", "de.entertheblockchain.com")); base58Prefixes[PUBKEY_ADDRESS] = list_of(35); base58Prefixes[SCRIPT_ADDRESS] = list_of(8); diff --git a/src/clientversion.h b/src/clientversion.h index 258e85be1c3ea..6bbbf9a41f558 100644 --- a/src/clientversion.h +++ b/src/clientversion.h @@ -17,7 +17,7 @@ #define CLIENT_VERSION_MAJOR 0 #define CLIENT_VERSION_MINOR 10 #define CLIENT_VERSION_REVISION 4 -#define CLIENT_VERSION_BUILD 0 +#define CLIENT_VERSION_BUILD 6 //! Set to true for release, false for prerelease or test build #define CLIENT_VERSION_IS_RELEASE true @@ -26,7 +26,7 @@ * Copyright year (2009-this) * Todo: update this when changing our copyright comments in the source */ -#define COPYRIGHT_YEAR 2016 +#define COPYRIGHT_YEAR 2017 #endif //HAVE_CONFIG_H @@ -38,7 +38,7 @@ #define DO_STRINGIZE(X) #X //! Copyright string used in Windows .rc files -#define COPYRIGHT_STR "2009-" STRINGIZE(COPYRIGHT_YEAR) " The Bitcoin Core Developers" +#define COPYRIGHT_STR "2009-" STRINGIZE(COPYRIGHT_YEAR) " The Bitcoin, Litecoin and Florincoin Developers" /** * bitcoind-res.rc includes this file, but it cannot cope with real c++ code. diff --git a/src/main.cpp b/src/main.cpp index 632756ba48b4a..21842a7af299a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3688,8 +3688,9 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, } // Disconnect certain incompatible clients - const char *badSubVers[] = { "/potcoinseeder", "/reddcoinseeder", "/worldcoinseeder" }; - for (int x = 0; x < 3; x++) + const char *badSubVers[] = { "/potcoinseeder", "/reddcoinseeder", "/worldcoinseeder", + "/Satoshi:0.8." }; + for (int x = 0; x < 4; x++) { if (pfrom->cleanSubVer.find(badSubVers[x], 0) == 0) { diff --git a/src/qt/forms/helpmessagedialog.ui b/src/qt/forms/helpmessagedialog.ui index bbd0c556010e0..4c0367a09265a 100644 --- a/src/qt/forms/helpmessagedialog.ui +++ b/src/qt/forms/helpmessagedialog.ui @@ -16,7 +16,7 @@ - Litecoin Core - Command-line options + Florincoin Core - Command-line options diff --git a/src/qt/forms/intro.ui b/src/qt/forms/intro.ui index 5c118b92a8908..772332364ff28 100644 --- a/src/qt/forms/intro.ui +++ b/src/qt/forms/intro.ui @@ -20,7 +20,7 @@ QLabel { font-style:italic; } - Welcome to Litecoin Core. + Welcome to Florincoin Core. true @@ -46,7 +46,7 @@ - As this is the first time the program is launched, you can choose where Litecoin Core will store its data. + As this is the first time the program is launched, you can choose where Florincoin Core will store its data. true @@ -56,7 +56,7 @@ - Litecoin Core will download and store a copy of the Litecoin block chain. At least %1GB of data will be stored in this directory, and it will grow over time. The wallet will also be stored in this directory. + Florincoin Core will download and store a copy of the Florincoin block chain. At least %1GB of data will be stored in this directory, and it will grow over time. The wallet will also be stored in this directory. true diff --git a/src/qt/forms/optionsdialog.ui b/src/qt/forms/optionsdialog.ui index 1cc2693fbe9a2..b415f57ad9ee3 100644 --- a/src/qt/forms/optionsdialog.ui +++ b/src/qt/forms/optionsdialog.ui @@ -30,10 +30,10 @@ - Automatically start Litecoin after logging in to the system. + Automatically start Florincoin after logging in to the system. - &Start Litecoin on system login + &Start Florincoin on system login @@ -189,7 +189,7 @@ - Automatically open the Litecoin client port on the router. This only works when your router supports UPnP and it is enabled. + Automatically open the Florincoin client port on the router. This only works when your router supports UPnP and it is enabled. Map port using &UPnP @@ -209,7 +209,7 @@ - Connect to the Litecoin network through a SOCKS5 proxy. + Connect to the Florincoin network through a SOCKS5 proxy. &Connect through SOCKS5 proxy (default proxy): @@ -375,7 +375,7 @@ - The user interface language can be set here. This setting will take effect after restarting Litecoin. + The user interface language can be set here. This setting will take effect after restarting Florincoin. diff --git a/src/qt/forms/overviewpage.ui b/src/qt/forms/overviewpage.ui index 360790bd85ba7..b8f928ad29919 100644 --- a/src/qt/forms/overviewpage.ui +++ b/src/qt/forms/overviewpage.ui @@ -64,7 +64,7 @@ WhatsThisCursor - The displayed information may be out of date. Your wallet automatically synchronizes with the Litecoin network after a connection is established, but this process has not completed yet. + The displayed information may be out of date. Your wallet automatically synchronizes with the Florincoin network after a connection is established, but this process has not completed yet. QLabel { color: red; } @@ -436,7 +436,7 @@ WhatsThisCursor - The displayed information may be out of date. Your wallet automatically synchronizes with the Litecoin network after a connection is established, but this process has not completed yet. + The displayed information may be out of date. Your wallet automatically synchronizes with the Florincoin network after a connection is established, but this process has not completed yet. QLabel { color: red; } diff --git a/src/qt/forms/receivecoinsdialog.ui b/src/qt/forms/receivecoinsdialog.ui index 4a1d712f63abb..25fd18cdc8098 100644 --- a/src/qt/forms/receivecoinsdialog.ui +++ b/src/qt/forms/receivecoinsdialog.ui @@ -48,7 +48,7 @@ - An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Litecoin network. + An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Florincoin network. &Message: @@ -71,7 +71,7 @@ - An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Litecoin network. + An optional message to attach to the payment request, which will be displayed when the request is opened. Note: The message will not be sent with the payment over the Florincoin network. diff --git a/src/qt/forms/rpcconsole.ui b/src/qt/forms/rpcconsole.ui index 7efb7fddc9c47..46cc50c40100c 100644 --- a/src/qt/forms/rpcconsole.ui +++ b/src/qt/forms/rpcconsole.ui @@ -331,7 +331,7 @@ - Open the Litecoin debug log file from the current data directory. This can take a few seconds for large log files. + Open the Florincoin debug log file from the current data directory. This can take a few seconds for large log files. &Open diff --git a/src/qt/forms/sendcoinsdialog.ui b/src/qt/forms/sendcoinsdialog.ui index b2f7335300101..90639f9c92d0d 100644 --- a/src/qt/forms/sendcoinsdialog.ui +++ b/src/qt/forms/sendcoinsdialog.ui @@ -904,7 +904,7 @@ - Paying only the minimum fee is just fine as long as there is less transaction volume than space in the blocks. But be aware that this can end up in a never confirming transaction once there is more demand for litecoin transactions than the network can process. + Paying only the minimum fee is just fine as long as there is less transaction volume than space in the blocks. But be aware that this can end up in a never confirming transaction once there is more demand for florincoin transactions than the network can process. @@ -917,7 +917,7 @@ true - Paying only the minimum fee is just fine as long as there is less transaction volume than space in the blocks. But be aware that this can end up in a never confirming transaction once there is more demand for litecoin transactions than the network can process. + Paying only the minimum fee is just fine as long as there is less transaction volume than space in the blocks. But be aware that this can end up in a never confirming transaction once there is more demand for florincoin transactions than the network can process. (read the tooltip) diff --git a/src/qt/forms/sendcoinsentry.ui b/src/qt/forms/sendcoinsentry.ui index 0b2e3ceb55913..299ddbaece5a2 100644 --- a/src/qt/forms/sendcoinsentry.ui +++ b/src/qt/forms/sendcoinsentry.ui @@ -51,7 +51,7 @@ - The Litecoin address to send the payment to + The Florincoin address to send the payment to @@ -154,7 +154,7 @@ - A message that was attached to the litecoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Litecoin network. + A message that was attached to the florincoin: URI which will be stored with the transaction for your reference. Note: This message will not be sent over the Florincoin network. Qt::PlainText diff --git a/src/qt/forms/signverifymessagedialog.ui b/src/qt/forms/signverifymessagedialog.ui index 58a6a60578252..7fc7c794a2cc4 100644 --- a/src/qt/forms/signverifymessagedialog.ui +++ b/src/qt/forms/signverifymessagedialog.ui @@ -48,7 +48,7 @@ - The Litecoin address to sign the message with + The Florincoin address to sign the message with @@ -152,7 +152,7 @@ - Sign the message to prove you own this Litecoin address + Sign the message to prove you own this Florincoin address Sign &Message @@ -258,7 +258,7 @@ - The Litecoin address the message was signed with + The Florincoin address the message was signed with @@ -295,7 +295,7 @@ - Verify the message to ensure it was signed with the specified Litecoin address + Verify the message to ensure it was signed with the specified Florincoin address Verify &Message diff --git a/src/qt/res/icons/bitcoin.icns b/src/qt/res/icons/bitcoin.icns index 2195aaf461d23..6603df1b8af1f 100644 Binary files a/src/qt/res/icons/bitcoin.icns and b/src/qt/res/icons/bitcoin.icns differ diff --git a/src/qt/res/icons/bitcoin.ico b/src/qt/res/icons/bitcoin.ico index de1a368298639..315e61dee767e 100644 Binary files a/src/qt/res/icons/bitcoin.ico and b/src/qt/res/icons/bitcoin.ico differ diff --git a/src/qt/res/icons/bitcoin.png b/src/qt/res/icons/bitcoin.png index d6a04f15a5b5e..023a2f91f47ff 100644 Binary files a/src/qt/res/icons/bitcoin.png and b/src/qt/res/icons/bitcoin.png differ diff --git a/src/qt/res/icons/bitcoin_testnet.png b/src/qt/res/icons/bitcoin_testnet.png index 9d8e0729e4030..185aa3e7769d4 100644 Binary files a/src/qt/res/icons/bitcoin_testnet.png and b/src/qt/res/icons/bitcoin_testnet.png differ diff --git a/src/qt/res/images/about.png b/src/qt/res/images/about.png index 9bccc63057fd8..0ea0d33283a99 100644 Binary files a/src/qt/res/images/about.png and b/src/qt/res/images/about.png differ diff --git a/src/qt/res/images/splash.png b/src/qt/res/images/splash.png index 4e94c6dff7e7a..0cb944b90bb95 100644 Binary files a/src/qt/res/images/splash.png and b/src/qt/res/images/splash.png differ diff --git a/src/qt/res/images/splash_testnet.png b/src/qt/res/images/splash_testnet.png index e4bf63ee91fa5..5b1af042f1577 100644 Binary files a/src/qt/res/images/splash_testnet.png and b/src/qt/res/images/splash_testnet.png differ diff --git a/src/qt/res/images/wallet_bgcoin.png b/src/qt/res/images/wallet_bgcoin.png index 8de82870d8a74..38e62c27f5993 100644 Binary files a/src/qt/res/images/wallet_bgcoin.png and b/src/qt/res/images/wallet_bgcoin.png differ diff --git a/src/qt/res/src/bitcoin.svg b/src/qt/res/src/bitcoin.svg index 21df98bc099a8..50dcb0511db4b 100644 --- a/src/qt/res/src/bitcoin.svg +++ b/src/qt/res/src/bitcoin.svg @@ -1,153 +1,125 @@ - - - -image/svg+xml \ No newline at end of file + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + diff --git a/src/qt/splashscreen.cpp b/src/qt/splashscreen.cpp index 299eb361359c3..38d01694ed0f9 100644 --- a/src/qt/splashscreen.cpp +++ b/src/qt/splashscreen.cpp @@ -25,7 +25,7 @@ SplashScreen::SplashScreen(Qt::WindowFlags f, const NetworkStyle *networkStyle) { // set reference point, paddings int paddingRight = 190; - int paddingRightCopyright = 220; + int paddingRightCopyright = 270; int paddingTop = 170; int paddingCopyrightTop = 70; int titleCopyrightVSpace = 14; @@ -34,8 +34,8 @@ SplashScreen::SplashScreen(Qt::WindowFlags f, const NetworkStyle *networkStyle) // define text to place QString versionText = QString("Version %1").arg(QString::fromStdString(FormatFullVersion())); - QString copyrightText1 = QChar(0xA9)+QString(" 2009-%1 ").arg(COPYRIGHT_YEAR) + QString(tr("The Bitcoin Core developers")); - QString copyrightText2 = QChar(0xA9)+QString(" 2011-%1 ").arg(COPYRIGHT_YEAR) + QString(tr("The Florincoin Core developers")); + QString copyrightText1 = QChar(0xA9)+QString(" 2009-%1 ").arg(COPYRIGHT_YEAR) + QString(tr("The Bitcoin Core developers")); + QString copyrightText2 = QChar(0xA9)+QString(" 2011-%1 ").arg(COPYRIGHT_YEAR) + QString(tr("The Litecoin and Florincoin developers")); QString titleAddText = networkStyle->getTitleAddText(); QString font = QApplication::font().toString(); diff --git a/src/qt/transactiondesc.cpp b/src/qt/transactiondesc.cpp index 1efad8259bb6d..755924d4e4371 100644 --- a/src/qt/transactiondesc.cpp +++ b/src/qt/transactiondesc.cpp @@ -240,6 +240,12 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx, TransactionReco if (wtx.mapValue.count("comment") && !wtx.mapValue["comment"].empty()) strHTML += "
" + tr("Comment") + ":
" + GUIUtil::HtmlEscape(wtx.mapValue["comment"], true) + "
"; + // + // Transaction comment + // + if (!wtx.strTxComment.empty()) + strHTML += "" + tr("Transaction comment") + ":
" + wtx.strTxComment.c_str() + "
"; + strHTML += "" + tr("Transaction ID") + ": " + TransactionRecord::formatSubTxId(wtx.GetHash(), rec->idx) + "
"; // Message from normal bitcoin:URI (bitcoin:123...?message=example) diff --git a/src/qt/transactionrecord.cpp b/src/qt/transactionrecord.cpp index 5278c8673a2ce..bf42cce9204d7 100644 --- a/src/qt/transactionrecord.cpp +++ b/src/qt/transactionrecord.cpp @@ -36,6 +36,11 @@ QList TransactionRecord::decomposeTransaction(const CWallet * CAmount nDebit = wtx.GetDebit(ISMINE_ALL); CAmount nNet = nCredit - nDebit; uint256 hash = wtx.GetHash(); + std::string txcomment = ""; + if (!wtx.strTxComment.empty()) + { + txcomment = wtx.strTxComment; + } std::map mapValue = wtx.mapValue; if (nNet > 0 || wtx.IsCoinBase()) @@ -52,6 +57,7 @@ QList TransactionRecord::decomposeTransaction(const CWallet * CTxDestination address; sub.idx = parts.size(); // sequence number sub.credit = txout.nValue; + sub.txcomment = txcomment; sub.involvesWatchAddress = mine == ISMINE_WATCH_ONLY; if (ExtractDestination(txout.scriptPubKey, address) && IsMine(*wallet, address)) { @@ -71,7 +77,8 @@ QList TransactionRecord::decomposeTransaction(const CWallet * sub.type = TransactionRecord::Generated; } - parts.append(sub); + if (sub.credit != 0) + parts.append(sub); } } } @@ -100,7 +107,7 @@ QList TransactionRecord::decomposeTransaction(const CWallet * CAmount nChange = wtx.GetChange(); parts.append(TransactionRecord(hash, nTime, TransactionRecord::SendToSelf, "", - -(nDebit - nChange), nCredit - nChange)); + -(nDebit - nChange), nCredit - nChange, txcomment)); parts.last().involvesWatchAddress = involvesWatchAddress; // maybe pass to TransactionRecord as constructor argument } else if (fAllFromMe) @@ -115,6 +122,7 @@ QList TransactionRecord::decomposeTransaction(const CWallet * const CTxOut& txout = wtx.vout[nOut]; TransactionRecord sub(hash, nTime); sub.idx = parts.size(); + sub.txcomment = txcomment; sub.involvesWatchAddress = involvesWatchAddress; if(wallet->IsMine(txout)) @@ -147,7 +155,8 @@ QList TransactionRecord::decomposeTransaction(const CWallet * } sub.debit = -nValue; - parts.append(sub); + if (sub.debit != 0) + parts.append(sub); } } else @@ -155,7 +164,7 @@ QList TransactionRecord::decomposeTransaction(const CWallet * // // Mixed debit transaction, can't break down payees // - parts.append(TransactionRecord(hash, nTime, TransactionRecord::Other, "", nNet, 0)); + parts.append(TransactionRecord(hash, nTime, TransactionRecord::Other, "", nNet, 0, txcomment)); parts.last().involvesWatchAddress = involvesWatchAddress; } } diff --git a/src/qt/transactionrecord.h b/src/qt/transactionrecord.h index e26453cda474b..2267b339c4de4 100644 --- a/src/qt/transactionrecord.h +++ b/src/qt/transactionrecord.h @@ -83,21 +83,22 @@ class TransactionRecord static const int RecommendedNumConfirmations = 6; TransactionRecord(): - hash(), time(0), type(Other), address(""), debit(0), credit(0), idx(0) + hash(), time(0), type(Other), address(""), debit(0), credit(0), txcomment(""), idx(0) { } TransactionRecord(uint256 hash, qint64 time): hash(hash), time(time), type(Other), address(""), debit(0), - credit(0), idx(0) + credit(0), txcomment(""), idx(0) { } TransactionRecord(uint256 hash, qint64 time, Type type, const std::string &address, - const CAmount& debit, const CAmount& credit): + const CAmount& debit, const CAmount& credit, + const std::string &txcomment): hash(hash), time(time), type(type), address(address), debit(debit), credit(credit), - idx(0) + txcomment(txcomment), idx(0) { } @@ -114,6 +115,7 @@ class TransactionRecord std::string address; CAmount debit; CAmount credit; + std::string txcomment; /**@}*/ /** Subtransaction index, for sort key */ diff --git a/src/qt/transactiontablemodel.cpp b/src/qt/transactiontablemodel.cpp index 79cb4a629661b..183c0e39225ce 100644 --- a/src/qt/transactiontablemodel.cpp +++ b/src/qt/transactiontablemodel.cpp @@ -31,6 +31,7 @@ static int column_alignments[] = { Qt::AlignLeft|Qt::AlignVCenter, /* date */ Qt::AlignLeft|Qt::AlignVCenter, /* type */ Qt::AlignLeft|Qt::AlignVCenter, /* address */ + Qt::AlignLeft|Qt::AlignVCenter, /* tx-comment */ Qt::AlignRight|Qt::AlignVCenter /* amount */ }; @@ -226,7 +227,7 @@ TransactionTableModel::TransactionTableModel(CWallet* wallet, WalletModel *paren priv(new TransactionTablePriv(wallet, this)), fProcessingQueuedTransactions(false) { - columns << QString() << QString() << tr("Date") << tr("Type") << tr("Address") << BitcoinUnits::getAmountColumnTitle(walletModel->getOptionsModel()->getDisplayUnit()); + columns << QString() << QString() << tr("Date") << tr("Type") << tr("Address") << tr("Transaction Comment") << BitcoinUnits::getAmountColumnTitle(walletModel->getOptionsModel()->getDisplayUnit()); priv->refreshWallet(); connect(walletModel->getOptionsModel(), SIGNAL(displayUnitChanged(int)), this, SLOT(updateDisplayUnit())); @@ -406,6 +407,23 @@ QString TransactionTableModel::formatTxToAddress(const TransactionRecord *wtx, b } } +QString TransactionTableModel::formatTxComment(const TransactionRecord *wtx, bool tooltip) const +{ + switch(wtx->type) + { + case TransactionRecord::RecvFromOther: + case TransactionRecord::RecvWithAddress: + case TransactionRecord::SendToAddress: + case TransactionRecord::SendToOther: + case TransactionRecord::SendToSelf: + return QString::fromStdString(wtx->txcomment); + case TransactionRecord::Generated: + return ""; + default: + return tr("(n/a)"); + } +} + QVariant TransactionTableModel::addressColor(const TransactionRecord *wtx) const { // Show addresses without label in a less visible color @@ -492,6 +510,8 @@ QString TransactionTableModel::formatTooltip(const TransactionRecord *rec) const rec->type==TransactionRecord::SendToAddress || rec->type==TransactionRecord::RecvWithAddress) { tooltip += QString(" ") + formatTxToAddress(rec, true); + if (rec->txcomment.length() > 0) + tooltip += QString("\n") + formatTxComment(rec, true); } return tooltip; } @@ -524,6 +544,8 @@ QVariant TransactionTableModel::data(const QModelIndex &index, int role) const return formatTxType(rec); case ToAddress: return formatTxToAddress(rec, false); + case TxComment: + return formatTxComment(rec, false); case Amount: return formatTxAmount(rec, true, BitcoinUnits::separatorAlways); } @@ -542,6 +564,8 @@ QVariant TransactionTableModel::data(const QModelIndex &index, int role) const return (rec->involvesWatchAddress ? 1 : 0); case ToAddress: return formatTxToAddress(rec, true); + case TxComment: + return formatTxComment(rec, false); case Amount: return qint64(rec->credit + rec->debit); } @@ -621,6 +645,8 @@ QVariant TransactionTableModel::headerData(int section, Qt::Orientation orientat return tr("Whether or not a watch-only address is involved in this transaction."); case ToAddress: return tr("Destination address of transaction."); + case TxComment: + return tr("Transaction comment."); case Amount: return tr("Amount removed from or added to balance."); } diff --git a/src/qt/transactiontablemodel.h b/src/qt/transactiontablemodel.h index cfefe4cf193ec..63d6d0f4155ba 100644 --- a/src/qt/transactiontablemodel.h +++ b/src/qt/transactiontablemodel.h @@ -32,7 +32,8 @@ class TransactionTableModel : public QAbstractTableModel Date = 2, Type = 3, ToAddress = 4, - Amount = 5 + TxComment = 5, + Amount = 6 }; /** Roles to get specific information from a transaction row. @@ -91,6 +92,7 @@ class TransactionTableModel : public QAbstractTableModel QString formatTxType(const TransactionRecord *wtx) const; QString formatTxToAddress(const TransactionRecord *wtx, bool tooltip) const; QString formatTxAmount(const TransactionRecord *wtx, bool showUnconfirmed=true, BitcoinUnits::SeparatorStyle separators=BitcoinUnits::separatorStandard) const; + QString formatTxComment(const TransactionRecord *wtx, bool tooltip) const; QString formatTooltip(const TransactionRecord *rec) const; QVariant txStatusDecoration(const TransactionRecord *wtx) const; QVariant txWatchonlyDecoration(const TransactionRecord *wtx) const; diff --git a/src/qt/transactionview.cpp b/src/qt/transactionview.cpp index d15397387218f..6db758830ed46 100644 --- a/src/qt/transactionview.cpp +++ b/src/qt/transactionview.cpp @@ -198,6 +198,8 @@ void TransactionView::setModel(WalletModel *model) transactionView->setColumnWidth(TransactionTableModel::Watchonly, WATCHONLY_COLUMN_WIDTH); transactionView->setColumnWidth(TransactionTableModel::Date, DATE_COLUMN_WIDTH); transactionView->setColumnWidth(TransactionTableModel::Type, TYPE_COLUMN_WIDTH); + transactionView->setColumnWidth(TransactionTableModel::ToAddress, ADDRESS_COLUMN_WIDTH); + transactionView->setColumnWidth(TransactionTableModel::TxComment, TXCOMMENT_COLUMN_WIDTH); transactionView->setColumnWidth(TransactionTableModel::Amount, AMOUNT_MINIMUM_COLUMN_WIDTH); columnResizingFixer = new GUIUtil::TableViewLastColumnResizingFixer(transactionView, AMOUNT_MINIMUM_COLUMN_WIDTH, MINIMUM_COLUMN_WIDTH); @@ -505,7 +507,7 @@ void TransactionView::focusTransaction(const QModelIndex &idx) void TransactionView::resizeEvent(QResizeEvent* event) { QWidget::resizeEvent(event); - columnResizingFixer->stretchColumnWidth(TransactionTableModel::ToAddress); + columnResizingFixer->stretchColumnWidth(TransactionTableModel::TxComment); } // Need to override default Ctrl+C action for amount as default behaviour is just to copy DisplayRole text diff --git a/src/qt/transactionview.h b/src/qt/transactionview.h index be6989adee291..36c131e846e1e 100644 --- a/src/qt/transactionview.h +++ b/src/qt/transactionview.h @@ -53,7 +53,9 @@ class TransactionView : public QWidget WATCHONLY_COLUMN_WIDTH = 23, DATE_COLUMN_WIDTH = 120, TYPE_COLUMN_WIDTH = 120, + ADDRESS_COLUMN_WIDTH = 240, AMOUNT_MINIMUM_COLUMN_WIDTH = 120, + TXCOMMENT_COLUMN_WIDTH = 120, MINIMUM_COLUMN_WIDTH = 23 }; diff --git a/src/rpcwallet.cpp b/src/rpcwallet.cpp index 3c8141059624a..f2c31002c2282 100644 --- a/src/rpcwallet.cpp +++ b/src/rpcwallet.cpp @@ -359,6 +359,7 @@ Value sendtoaddress(const Array& params, bool fHelp) "4. \"comment-to\" (string, optional) A comment to store the name of the person or organization \n" " to which you're sending the transaction. This is not part of the \n" " transaction, just kept in your wallet.\n" + "5. \"tx-comment\" (string, optional) A transaction comment. This comment is stored in the blockchain and is public.\n" "\nResult:\n" "\"transactionid\" (string) The transaction id.\n" "\nExamples:\n" @@ -802,6 +803,7 @@ Value sendfrom(const Array& params, bool fHelp) "6. \"comment-to\" (string, optional) An optional comment to store the name of the person or organization \n" " to which you're sending the transaction. This is not part of the transaction, \n" " it is just kept in your wallet.\n" + "7. \"tx-comment\" (string, optional) A transaction comment. This comment is stored in the blockchain and is public.\n" "\nResult:\n" "\"transactionid\" (string) The transaction id.\n" "\nExamples:\n" @@ -868,6 +870,7 @@ Value sendmany(const Array& params, bool fHelp) " }\n" "3. minconf (numeric, optional, default=1) Only use the balance confirmed at least this many times.\n" "4. \"comment\" (string, optional) A comment\n" + "5. \"tx-comment\" (string, optional) A transaction comment. This comment is stored in the blockchain and is public.\n" "\nResult:\n" "\"transactionid\" (string) The transaction id for the send. Only 1 transaction is created regardless of \n" " the number of addresses.\n" diff --git a/src/script/script.cpp b/src/script/script.cpp index b879d72d6b963..fec190d2364e4 100644 --- a/src/script/script.cpp +++ b/src/script/script.cpp @@ -154,7 +154,7 @@ const char* GetOpName(opcodetype opcode) case OP_INVALIDOPCODE : return "OP_INVALIDOPCODE"; // Note: - // The template matching params OP_SMALLDATA/etc are defined in opcodetype enum + // The template matching params OP_SMALLINTEGER/etc are defined in opcodetype enum // as kind of implementation hack, they are *NOT* real opcodes. If found in real // Script, just let the default: case deal with them. @@ -220,9 +220,8 @@ bool CScript::IsPayToScriptHash() const this->at(22) == OP_EQUAL); } -bool CScript::IsPushOnly() const +bool CScript::IsPushOnly(const_iterator pc) const { - const_iterator pc = begin(); while (pc < end()) { opcodetype opcode; @@ -238,6 +237,11 @@ bool CScript::IsPushOnly() const return true; } +bool CScript::IsPushOnly() const +{ + return this->IsPushOnly(begin()); +} + std::string CScript::ToString() const { std::string str; diff --git a/src/script/script.h b/src/script/script.h index 54d98a0786006..0b8b495cedc70 100644 --- a/src/script/script.h +++ b/src/script/script.h @@ -165,7 +165,6 @@ enum opcodetype // template matching params - OP_SMALLDATA = 0xf9, OP_SMALLINTEGER = 0xfa, OP_PUBKEYS = 0xfb, OP_PUBKEYHASH = 0xfd, @@ -586,6 +585,7 @@ class CScript : public std::vector bool IsPayToScriptHash() const; /** Called by IsStandardTx and P2SH/BIP62 VerifyScript (which makes it consensus-critical). */ + bool IsPushOnly(const_iterator pc) const; bool IsPushOnly() const; /** diff --git a/src/script/standard.cpp b/src/script/standard.cpp index 6e2c465c865e3..682743c4809a1 100644 --- a/src/script/standard.cpp +++ b/src/script/standard.cpp @@ -51,13 +51,10 @@ bool Solver(const CScript& scriptPubKey, txnouttype& typeRet, vector= 1 && scriptPubKey[0] == OP_RETURN && scriptPubKey.IsPushOnly(scriptPubKey.begin()+1)) { + typeRet = TX_NULL_DATA; + return true; + } + // Scan templates const CScript& script1 = scriptPubKey; BOOST_FOREACH(const PAIRTYPE(txnouttype, CScript)& tplate, mTemplates) @@ -140,12 +147,6 @@ bool Solver(const CScript& scriptPubKey, txnouttype& typeRet, vector nMaxDatacarrierBytes) - break; - } else if (opcode1 != opcode2 || vch1 != vch2) { // Others must match exactly @@ -195,7 +196,9 @@ bool IsStandard(const CScript& scriptPubKey, txnouttype& whichType) return false; if (m < 1 || m > n) return false; - } + } else if (whichType == TX_NULL_DATA && + (scriptPubKey.size() > nMaxDatacarrierBytes)) + return false; return whichType != TX_NONSTANDARD; } diff --git a/src/script/standard.h b/src/script/standard.h index 3f75905d5ccd4..00d42fb29b4c8 100644 --- a/src/script/standard.h +++ b/src/script/standard.h @@ -25,7 +25,7 @@ class CScriptID : public uint160 CScriptID(const uint160& in) : uint160(in) {} }; -static const unsigned int MAX_OP_RETURN_RELAY = 80; //! bytes +static const unsigned int MAX_OP_RETURN_RELAY = 83; //! bytes (+1 for OP_RETURN, +2 for the pushdata opcodes) extern unsigned nMaxDatacarrierBytes; /** diff --git a/src/wallet.cpp b/src/wallet.cpp index a5bbe1bfa7a41..d4f44db29967e 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -1491,6 +1491,24 @@ bool CWallet::CreateTransaction(const vector >& vecSend, else reservekey.ReturnKey(); + // Florin: + // Add OP_RETURN vout containing transaction comment hash + // 1000 byte penalty for "dust" output + if (txNew.strTxComment.length() > 0) + { + uint256 msghash = Hash(txNew.strTxComment.begin(), txNew.strTxComment.end()); + std::vector opdata; + opdata.insert(opdata.end(), (unsigned char)'F'); + opdata.insert(opdata.end(), (unsigned char)'L'); + opdata.insert(opdata.end(), (unsigned char)'O'); + opdata.insert(opdata.end(), (unsigned char)'M'); + opdata.insert(opdata.end(), msghash.begin(), msghash.end()); + CScript scrout = CScript() << OP_RETURN << opdata; + CTxOut txmsgTxOut(0, scrout); + txNew.vout.push_back(txmsgTxOut); + nBytesPenalty += 1000; + } + // Fill vin BOOST_FOREACH(const PAIRTYPE(const CWalletTx*,unsigned int)& coin, setCoins) txNew.vin.push_back(CTxIn(coin.first->GetHash(),coin.second));