Skip to content
This repository was archived by the owner on Mar 28, 2023. It is now read-only.

Commit 39a02b6

Browse files
authored
Merge pull request #1872 from OpenBazaar/dust
(#1834) Do not allow purchases if amount is lower than the wallet's dust amount
2 parents 0ac87b8 + d218e70 commit 39a02b6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

core/order.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,10 @@ func (n *OpenBazaarNode) Purchase(data *repo.PurchaseData) (orderID string, paym
162162
return "", "", retCurrency, false, err
163163
}
164164

165+
if wal.IsDust(*total) {
166+
return "", "", retCurrency, false, ErrSpendAmountIsDust
167+
}
168+
165169
payment.BigAmount = total.String()
166170

167171
contract, err = n.SignOrder(contract)

0 commit comments

Comments
 (0)