Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions doc/swifttx.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
##SwiftTX Technical Information
##SwiftX Technical Information

SwiftTX has been integrated into the Core Daemon in two ways:
SwiftX has been integrated into the Core Daemon in two ways:
* "push" notifications (ZMQ and `-swifttxnotify` cmd-line/config option);
* RPC commands.

####ZMQ

When a "Transaction Lock" occurs the hash of the related transaction is broadcasted through ZMQ using both the `zmqpubrawtxlock` and `zmqpubhashtxlock` channels.

* `zmqpubrawtxlock`: publishes the raw transaction when locked via SwiftTX
* `zmqpubhashtxlock`: publishes the transaction hash when locked via SwiftTX
* `zmqpubrawtxlock`: publishes the raw transaction when locked via SwiftX
* `zmqpubhashtxlock`: publishes the transaction hash when locked via SwiftX

This mechanism has been integrated into Bitcore-Node-PIVX which allows for notification to be broadcast through Insight API in one of two ways:
* WebSocket: [https://github.com/PIVX-Project/insight-api-pivx#web-socket-api](https://github.com/PIVX-Project/insight-api-pivx#web-socket-api)
* API: [https://github.com/PIVX-Project/insight-api-pivx#swifttx-transactions](https://github.com/PIVX-Project/insight-api-pivx#swifttx-transactions)

####Command line option

When a wallet SwiftTX transaction is successfully locked a shell command provided in this option is executed (`%s` in `<cmd>` is replaced by TxID):
When a wallet SwiftX transaction is successfully locked a shell command provided in this option is executed (`%s` in `<cmd>` is replaced by TxID):

```
-swifttxnotify=<cmd>
Expand All @@ -39,20 +39,20 @@ This value can be overridden by passing the following argument to the PIVX Core
-swifttxdepth=<n>
```

The key thing to understand is that this value indicates the number of "confirmations" a successful Transaction Lock represents. When Wallet RPC commands are performed (such as `listsinceblock`) this attribute is taken into account when returning information about the transaction. The value in `confirmations` field you see through RPC is showing the number of `"Blockchain Confirmations" + "SwiftTX Depth"` (assuming the funds were sent via SwiftTX).
The key thing to understand is that this value indicates the number of "confirmations" a successful Transaction Lock represents. When Wallet RPC commands are performed (such as `listsinceblock`) this attribute is taken into account when returning information about the transaction. The value in `confirmations` field you see through RPC is showing the number of `"Blockchain Confirmations" + "SwiftX Depth"` (assuming the funds were sent via SwiftX).

There is also a field named `bcconfirmations`. The value in this field represents the total number of `"Blockchain Confirmations"` for a given transaction without taking into account whether it was SwiftTX or not.
There is also a field named `bcconfirmations`. The value in this field represents the total number of `"Blockchain Confirmations"` for a given transaction without taking into account whether it was SwiftX or not.

**Examples**
* SwiftTX transaction just occurred:
* SwiftX transaction just occurred:
* confirmations: 5
* bcconfirmations: 0
* SwiftTX transaction received one confirmation from blockchain:
* SwiftX transaction received one confirmation from blockchain:
* confirmations: 6
* bcconfirmations: 1
* non-SwiftTX transaction just occurred:
* non-SwiftX transaction just occurred:
* confirmations: 0
* bcconfirmations: 0
* non-SwiftTX transaction received one confirmation from blockchain:
* non-SwiftX transaction received one confirmation from blockchain:
* confirmations: 1
* bcconfirmations: 1
12 changes: 6 additions & 6 deletions src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -406,10 +406,10 @@ std::string HelpMessage(HelpMessageMode mode)
strUsage += HelpMessageGroup(_("ZeroMQ notification options:"));
strUsage += HelpMessageOpt("-zmqpubhashblock=<address>", _("Enable publish hash block in <address>"));
strUsage += HelpMessageOpt("-zmqpubhashtx=<address>", _("Enable publish hash transaction in <address>"));
strUsage += HelpMessageOpt("-zmqpubhashtxlock=<address>", _("Enable publish hash transaction (locked via SwiftTX) in <address>"));
strUsage += HelpMessageOpt("-zmqpubhashtxlock=<address>", _("Enable publish hash transaction (locked via SwiftX) in <address>"));
strUsage += HelpMessageOpt("-zmqpubrawblock=<address>", _("Enable publish raw block in <address>"));
strUsage += HelpMessageOpt("-zmqpubrawtx=<address>", _("Enable publish raw transaction in <address>"));
strUsage += HelpMessageOpt("-zmqpubrawtxlock=<address>", _("Enable publish raw transaction (locked via SwiftTX) in <address>"));
strUsage += HelpMessageOpt("-zmqpubrawtxlock=<address>", _("Enable publish raw transaction (locked via SwiftX) in <address>"));
#endif

strUsage += HelpMessageGroup(_("Debugging/Testing options:"));
Expand All @@ -427,7 +427,7 @@ std::string HelpMessage(HelpMessageMode mode)
strUsage += HelpMessageOpt("-stopafterblockimport", strprintf(_("Stop running after importing blocks from disk (default: %u)"), 0));
strUsage += HelpMessageOpt("-sporkkey=<privkey>", _("Enable spork administration functionality with the appropriate private key."));
}
string debugCategories = "addrman, alert, bench, coindb, db, lock, rand, rpc, selectcoins, tor, mempool, net, proxy, pivx, (obfuscation, swifttx, masternode, mnpayments, mnbudget, zero)"; // Don't translate these and qt below
string debugCategories = "addrman, alert, bench, coindb, db, lock, rand, rpc, selectcoins, tor, mempool, net, proxy, pivx, (obfuscation, swiftx, masternode, mnpayments, mnbudget, zero)"; // Don't translate these and qt below
if (mode == HMM_BITCOIN_QT)
debugCategories += ", qt";
strUsage += HelpMessageOpt("-debug=<category>", strprintf(_("Output debugging information (default: %u, supplying <category> is optional)"), 0) + ". " +
Expand Down Expand Up @@ -457,7 +457,7 @@ std::string HelpMessage(HelpMessageMode mode)
}
strUsage += HelpMessageOpt("-shrinkdebugfile", _("Shrink debug.log file on client startup (default: 1 when no -debug)"));
strUsage += HelpMessageOpt("-testnet", _("Use the test network"));
strUsage += HelpMessageOpt("-litemode=<n>", strprintf(_("Disable all PIVX specific functionality (Masternodes, Obfuscation, SwiftTX, Budgeting) (0-1, default: %u)"), 0));
strUsage += HelpMessageOpt("-litemode=<n>", strprintf(_("Disable all PIVX specific functionality (Masternodes, Zerocoin, SwiftX, Budgeting) (0-1, default: %u)"), 0));

#ifdef ENABLE_WALLET
strUsage += HelpMessageGroup(_("Staking options:"));
Expand Down Expand Up @@ -486,8 +486,8 @@ std::string HelpMessage(HelpMessageMode mode)
// strUsage += " -anonymizepivxamount=<n> " + strprintf(_("Keep N PIV anonymized (default: %u)"), 0) + "\n";
// strUsage += " -liquidityprovider=<n> " + strprintf(_("Provide liquidity to Obfuscation by infrequently mixing coins on a continual basis (0-100, default: %u, 1=very frequent, high fees, 100=very infrequent, low fees)"), 0) + "\n";

strUsage += HelpMessageGroup(_("SwiftTX options:"));
strUsage += HelpMessageOpt("-enableswifttx=<n>", strprintf(_("Enable swifttx, show confirmations for locked transactions (bool, default: %s)"), "true"));
strUsage += HelpMessageGroup(_("SwiftX options:"));
strUsage += HelpMessageOpt("-enableswifttx=<n>", strprintf(_("Enable SwiftX, show confirmations for locked transactions (bool, default: %s)"), "true"));
strUsage += HelpMessageOpt("-swifttxdepth=<n>", strprintf(_("Show N confirmations for a successfully locked transaction (0-9999, default: %u)"), nSwiftTXDepth));

strUsage += HelpMessageGroup(_("Node relay options:"));
Expand Down
2 changes: 1 addition & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3383,7 +3383,7 @@ bool DisconnectBlocksAndReprocess(int blocks)
/*
DisconnectBlockAndInputs

Remove conflicting blocks for successful SwiftTX transaction locks
Remove conflicting blocks for successful SwiftX transaction locks
This should be very rare (Probably will never happen)
*/
// ***TODO*** clean up here
Expand Down
6 changes: 3 additions & 3 deletions src/qt/forms/sendcoinsdialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,7 @@
<x>0</x>
<y>0</y>
<width>830</width>
<height>95</height>
<height>113</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2" stretch="0,1">
Expand Down Expand Up @@ -1406,7 +1406,7 @@
</size>
</property>
<property name="text">
<string>SwiftTX</string>
<string>SwiftX</string>
</property>
</widget>
</item>
Expand Down Expand Up @@ -1460,7 +1460,7 @@
</resources>
<connections/>
<buttongroups>
<buttongroup name="groupCustomFee"/>
<buttongroup name="groupFee"/>
<buttongroup name="groupCustomFee"/>
</buttongroups>
</ui>
12 changes: 6 additions & 6 deletions src/qt/pivxstrings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@ QT_TRANSLATE_NOOP("pivx-core", ""
"Delete all wallet transactions and only recover those parts of the "
"blockchain through -rescan on startup"),
QT_TRANSLATE_NOOP("pivx-core", ""
"Disable all PIVX specific functionality (Masternodes, Obfuscation, SwiftTX, "
"Disable all PIVX specific functionality (Masternodes, Obfuscation, SwiftX, "
"Budgeting) (0-1, default: %u)"),
QT_TRANSLATE_NOOP("pivx-core", ""
"Distributed under the MIT software license, see the accompanying file "
"COPYING or <http://www.opensource.org/licenses/mit-license.php>."),
QT_TRANSLATE_NOOP("pivx-core", ""
"Enable spork administration functionality with the appropriate private key."),
QT_TRANSLATE_NOOP("pivx-core", ""
"Enable swifttx, show confirmations for locked transactions (bool, default: "
"Enable SwiftX, show confirmations for locked transactions (bool, default: "
"%s)"),
QT_TRANSLATE_NOOP("pivx-core", ""
"Enter regression test mode, which uses a special chain in which blocks can "
Expand Down Expand Up @@ -154,7 +154,7 @@ QT_TRANSLATE_NOOP("pivx-core", ""
QT_TRANSLATE_NOOP("pivx-core", ""
"Support filtering of blocks and transaction with bloom filters (default: %u)"),
QT_TRANSLATE_NOOP("pivx-core", ""
"SwiftTX requires inputs with at least 6 confirmations, you might need to "
"SwiftX requires inputs with at least 6 confirmations, you might need to "
"wait a few minutes and try again."),
QT_TRANSLATE_NOOP("pivx-core", ""
"This is a pre-release test build - use at your own risk - do not use for "
Expand Down Expand Up @@ -268,10 +268,10 @@ QT_TRANSLATE_NOOP("pivx-core", "Do you want to rebuild the block database now?")
QT_TRANSLATE_NOOP("pivx-core", "Done loading"),
QT_TRANSLATE_NOOP("pivx-core", "Enable automatic Zerocoin minting (0-1, default: %u)"),
QT_TRANSLATE_NOOP("pivx-core", "Enable publish hash block in <address>"),
QT_TRANSLATE_NOOP("pivx-core", "Enable publish hash transaction (locked via SwiftTX) in <address>"),
QT_TRANSLATE_NOOP("pivx-core", "Enable publish hash transaction (locked via SwiftX) in <address>"),
QT_TRANSLATE_NOOP("pivx-core", "Enable publish hash transaction in <address>"),
QT_TRANSLATE_NOOP("pivx-core", "Enable publish raw block in <address>"),
QT_TRANSLATE_NOOP("pivx-core", "Enable publish raw transaction (locked via SwiftTX) in <address>"),
QT_TRANSLATE_NOOP("pivx-core", "Enable publish raw transaction (locked via SwiftX) in <address>"),
QT_TRANSLATE_NOOP("pivx-core", "Enable publish raw transaction in <address>"),
QT_TRANSLATE_NOOP("pivx-core", "Enable staking functionality (0-1, default: %u)"),
QT_TRANSLATE_NOOP("pivx-core", "Enable the client to act as a masternode (0-1, default: %u)"),
Expand Down Expand Up @@ -421,7 +421,7 @@ QT_TRANSLATE_NOOP("pivx-core", "Stop running after importing blocks from disk (d
QT_TRANSLATE_NOOP("pivx-core", "Submitted following entries to masternode: %u / %d"),
QT_TRANSLATE_NOOP("pivx-core", "Submitted to masternode, waiting for more entries ( %u / %d ) %s"),
QT_TRANSLATE_NOOP("pivx-core", "Submitted to masternode, waiting in queue %s"),
QT_TRANSLATE_NOOP("pivx-core", "SwiftTX options:"),
QT_TRANSLATE_NOOP("pivx-core", "SwiftX options:"),
QT_TRANSLATE_NOOP("pivx-core", "Synchronization failed"),
QT_TRANSLATE_NOOP("pivx-core", "Synchronization finished"),
QT_TRANSLATE_NOOP("pivx-core", "Synchronization pending..."),
Expand Down
2 changes: 1 addition & 1 deletion src/qt/sendcoinsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ void SendCoinsDialog::on_sendButton_clicked()
if (ui->checkSwiftTX->isChecked()) {
recipients[0].useSwiftTX = true;
strFunds += " ";
strFunds += tr("and SwiftTX");
strFunds += tr("and SwiftX");
} else {
recipients[0].useSwiftTX = false;
}
Expand Down
16 changes: 8 additions & 8 deletions src/qt/transactiondesc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,30 +42,30 @@ QString TransactionDesc::FormatTxStatus(const CWalletTx& wtx)
if (nDepth < 0)
return tr("conflicted");
else if (GetAdjustedTime() - wtx.nTimeReceived > 2 * 60 && wtx.GetRequestCount() == 0)
return tr("%1/offline (verified via swifttx)").arg(nDepth);
return tr("%1/offline (verified via SwiftX)").arg(nDepth);
else if (nDepth < 6)
return tr("%1/confirmed (verified via swifttx)").arg(nDepth);
return tr("%1/confirmed (verified via SwiftX)").arg(nDepth);
else
return tr("%1 confirmations (verified via swifttx)").arg(nDepth);
return tr("%1 confirmations (verified via SwiftX)").arg(nDepth);
} else {
if (!wtx.IsTransactionLockTimedOut()) {
int nDepth = wtx.GetDepthInMainChain();
if (nDepth < 0)
return tr("conflicted");
else if (GetAdjustedTime() - wtx.nTimeReceived > 2 * 60 && wtx.GetRequestCount() == 0)
return tr("%1/offline (SwiftTX verification in progress - %2 of %3 signatures)").arg(nDepth).arg(signatures).arg(SWIFTTX_SIGNATURES_TOTAL);
return tr("%1/offline (SwiftX verification in progress - %2 of %3 signatures)").arg(nDepth).arg(signatures).arg(SWIFTTX_SIGNATURES_TOTAL);
else if (nDepth < 6)
return tr("%1/confirmed (SwiftTX verification in progress - %2 of %3 signatures )").arg(nDepth).arg(signatures).arg(SWIFTTX_SIGNATURES_TOTAL);
return tr("%1/confirmed (SwiftX verification in progress - %2 of %3 signatures )").arg(nDepth).arg(signatures).arg(SWIFTTX_SIGNATURES_TOTAL);
else
return tr("%1 confirmations (SwiftTX verification in progress - %2 of %3 signatures)").arg(nDepth).arg(signatures).arg(SWIFTTX_SIGNATURES_TOTAL);
return tr("%1 confirmations (SwiftX verification in progress - %2 of %3 signatures)").arg(nDepth).arg(signatures).arg(SWIFTTX_SIGNATURES_TOTAL);
} else {
int nDepth = wtx.GetDepthInMainChain();
if (nDepth < 0)
return tr("conflicted");
else if (GetAdjustedTime() - wtx.nTimeReceived > 2 * 60 && wtx.GetRequestCount() == 0)
return tr("%1/offline (SwiftTX verification failed)").arg(nDepth);
return tr("%1/offline (SwiftX verification failed)").arg(nDepth);
else if (nDepth < 6)
return tr("%1/confirmed (SwiftTX verification failed)").arg(nDepth);
return tr("%1/confirmed (SwiftX verification failed)").arg(nDepth);
else
return tr("%1 confirmations").arg(nDepth);
}
Expand Down
4 changes: 2 additions & 2 deletions src/qt/walletmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ WalletModel::SendCoinsReturn WalletModel::prepareTransaction(WalletModelTransact


if (recipients[0].useSwiftTX && total > GetSporkValue(SPORK_5_MAX_VALUE) * COIN) {
emit message(tr("Send Coins"), tr("SwiftTX doesn't support sending values that high yet. Transactions are currently limited to %1 PIV.").arg(GetSporkValue(SPORK_5_MAX_VALUE)),
emit message(tr("Send Coins"), tr("SwiftX doesn't support sending values that high yet. Transactions are currently limited to %1 PIV.").arg(GetSporkValue(SPORK_5_MAX_VALUE)),
CClientUIInterface::MSG_ERROR);
return TransactionCreationFailed;
}
Expand All @@ -316,7 +316,7 @@ WalletModel::SendCoinsReturn WalletModel::prepareTransaction(WalletModelTransact
transaction.setTransactionFee(nFeeRequired);

if (recipients[0].useSwiftTX && newTx->GetValueOut() > GetSporkValue(SPORK_5_MAX_VALUE) * COIN) {
emit message(tr("Send Coins"), tr("SwiftTX doesn't support sending values that high yet. Transactions are currently limited to %1 PIV.").arg(GetSporkValue(SPORK_5_MAX_VALUE)),
emit message(tr("Send Coins"), tr("SwiftX doesn't support sending values that high yet. Transactions are currently limited to %1 PIV.").arg(GetSporkValue(SPORK_5_MAX_VALUE)),
CClientUIInterface::MSG_ERROR);
return TransactionCreationFailed;
}
Expand Down
Loading