diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp index e78adbb798843..352aedafc1251 100644 --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -498,6 +498,7 @@ static void SetupUIArgs(ArgsManager& argsman) argsman.AddArg("-splash", strprintf(QObject::tr("Show splash screen on startup (default: %u)").toStdString(), DEFAULT_SPLASHSCREEN), ArgsManager::ALLOW_ANY, OptionsCategory::GUI); argsman.AddArg("-uiplatform", strprintf("Select platform to customize UI for (one of windows, macosx, other; default: %s)", BitcoinGUI::DEFAULT_UIPLATFORM), ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::GUI); argsman.AddArg("-debug-ui", "Updates the UI's stylesheets in realtime with changes made to the css files in -custom-css-dir and forces some widgets to show up which are usually only visible under certain circumstances. (default: 0)", ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::GUI); + argsman.AddArg("-allowduplicaterecipients", "Allow sending to duplicate recipient addresses in a single transaction. For testing purposes only. (default: 0)", ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::GUI); argsman.AddArg("-windowtitle=", _("Sets a window title which is appended to \"Dash Core - \"").translated, ArgsManager::ALLOW_ANY, OptionsCategory::GUI); } diff --git a/src/qt/walletmodel.cpp b/src/qt/walletmodel.cpp index 9b03c9cf9d5c2..af8bd6ec7cd51 100644 --- a/src/qt/walletmodel.cpp +++ b/src/qt/walletmodel.cpp @@ -212,6 +212,9 @@ WalletModel::SendCoinsReturn WalletModel::prepareTransaction(WalletModelTransact return TransactionCreationFailed; } + // Check if duplicate recipients are allowed (debug/testing feature) + bool fAllowDuplicateDestAddr = gArgs.GetBoolArg("-allowduplicaterecipients", false); + QSet setAddress; // Used to detect duplicates int nAddresses = 0; @@ -239,7 +242,7 @@ WalletModel::SendCoinsReturn WalletModel::prepareTransaction(WalletModelTransact total += rcp.amount; } } - if(setAddress.size() != nAddresses) + if(setAddress.size() != nAddresses && !fAllowDuplicateDestAddr) { return DuplicateAddress; }