mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 20:12:57 +01:00
Sort recipients in SendCoins dialog via BIP69 rule (#2546)
This commit is contained in:
parent
5830353373
commit
18cd5965cc
@ -254,6 +254,11 @@ void SendCoinsDialog::on_sendButton_clicked()
|
||||
return;
|
||||
}
|
||||
|
||||
// apply BIP69
|
||||
if (bBIP69Enabled) {
|
||||
std::sort(recipients.begin(), recipients.end(), CompareSendCoinsRecipientBIP69());
|
||||
}
|
||||
|
||||
QString strFunds = tr("using") + " <b>" + tr("anonymous funds") + "</b>";
|
||||
QString strFee = "";
|
||||
recipients[0].inputType = ONLY_DENOMINATED;
|
||||
|
@ -101,6 +101,15 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
// same as CompareOutputBIP69 in primitives/transaction.h
|
||||
struct CompareSendCoinsRecipientBIP69
|
||||
{
|
||||
inline bool operator()(const SendCoinsRecipient& a, const SendCoinsRecipient& b) const
|
||||
{
|
||||
return a.amount < b.amount || (a.amount == b.amount && a.address < b.address);
|
||||
}
|
||||
};
|
||||
|
||||
/** Interface to Bitcoin wallet from Qt view code. */
|
||||
class WalletModel : public QObject
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user