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

Commit 43e6e33

Browse files
committed
Fix lint issues
1 parent 3a21820 commit 43e6e33

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

repo/listing.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1560,7 +1560,7 @@ func (l *Listing) ValidateListing(testnet bool) (err error) {
15601560
if priceCurrency, err := AllCurrencies().Lookup(price.Currency.Code.String()); err != nil {
15611561
return errors.New("invalid pricing currency")
15621562
} else {
1563-
if uint(price.Currency.Divisibility) > priceCurrency.Divisibility {
1563+
if price.Currency.Divisibility > priceCurrency.Divisibility {
15641564
return errors.New("pricing currency divisibility is too large")
15651565
}
15661566
}

wallet/listeners/transaction_listener.go

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ func (l *TransactionListener) getOrderDetails(orderID string, address btc.Addres
5656
}
5757

5858
// cleanupOrderState - scan each order to ensure the state in the db matches the state of the contract stored
59-
func (l *TransactionListener) cleanupOrderState(isSale bool, txid string, output wallet.TransactionOutput, contract *pb.RicardianContract, state pb.OrderState, funded bool, records []*wallet.TransactionRecord) {
59+
func (l *TransactionListener) cleanupOrderState(isSale bool, output wallet.TransactionOutput, contract *pb.RicardianContract, state pb.OrderState, funded bool, records []*wallet.TransactionRecord) {
6060

6161
orderId, err := calcOrderId(contract.BuyerOrder)
6262
if err != nil {
@@ -67,11 +67,13 @@ func (l *TransactionListener) cleanupOrderState(isSale bool, txid string, output
6767
if contract.DisputeResolution != nil && state != pb.OrderState_DECIDED && state != pb.OrderState_RESOLVED {
6868
log.Infof("Out of sync order. Found %s and should either DECIDED be %s\n", state, pb.OrderState_RESOLVED)
6969
if isSale {
70-
l.db.Sales().Put(orderId, *contract, pb.OrderState_RESOLVED, false)
70+
err = l.db.Sales().Put(orderId, *contract, pb.OrderState_RESOLVED, false)
7171
} else {
72-
l.db.Purchases().Put(orderId, *contract, pb.OrderState_RESOLVED, false)
72+
err = l.db.Purchases().Put(orderId, *contract, pb.OrderState_RESOLVED, false)
73+
}
74+
if err != nil {
75+
log.Errorf("Error saving new order state: %s", err)
7376
}
74-
7577
}
7678
}
7779

@@ -95,13 +97,13 @@ func (l *TransactionListener) OnTransactionReceived(cb wallet.TransactionCallbac
9597
//contract, state, funded, records, err := l.db.Sales().GetByPaymentAddress(output.Address)
9698
if err == nil && state != pb.OrderState_PROCESSING_ERROR {
9799
l.processSalePayment(cb.Txid, output, contract, state, funded, records)
98-
l.cleanupOrderState(true, cb.Txid, output, contract, state, funded, records)
100+
l.cleanupOrderState(true, output, contract, state, funded, records)
99101
continue
100102
}
101103
contract, state, funded, records, err = l.getOrderDetails(output.OrderID, output.Address, false)
102104
if err == nil {
103105
l.processPurchasePayment(cb.Txid, output, contract, state, funded, records)
104-
l.cleanupOrderState(false, cb.Txid, output, contract, state, funded, records)
106+
l.cleanupOrderState(false, output, contract, state, funded, records)
105107
continue
106108
}
107109
}

0 commit comments

Comments
 (0)