mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-20 13:37:28 +02:00
Reject dust amounts during validation
Replaces the validation check for "amount == 0" with an isDust check, so very small output amounts are caught before the wallet is unlocked, a transaction is created, etc.
This commit is contained in:
parent
b986663ccd
commit
57d80467f1
3 changed files with 22 additions and 14 deletions
|
|
@ -148,6 +148,14 @@ bool parseBitcoinURI(QString uri, SendCoinsRecipient *out)
|
|||
return parseBitcoinURI(uriInstance, out);
|
||||
}
|
||||
|
||||
bool isDust(const QString& address, qint64 amount)
|
||||
{
|
||||
CTxDestination dest = CBitcoinAddress(address.toStdString()).Get();
|
||||
CScript script; script.SetDestination(dest);
|
||||
CTxOut txOut(amount, script);
|
||||
return txOut.IsDust(CTransaction::nMinRelayTxFee);
|
||||
}
|
||||
|
||||
QString HtmlEscape(const QString& str, bool fMultiLine)
|
||||
{
|
||||
#if QT_VERSION < 0x050000
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue