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

Commit d218e70

Browse files
committed
Do not allow purchases if amount is lower than the wallet's dust amount
1 parent 296c3a6 commit d218e70

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)