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

Commit

Permalink
Fix unused inputs in tx listener
Browse files Browse the repository at this point in the history
  • Loading branch information
cpacia committed Apr 14, 2020
1 parent 43e6e33 commit 998d61e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions wallet/listeners/transaction_listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func (l *TransactionListener) getOrderDetails(orderID string, address btc.Addres
}

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

orderId, err := calcOrderId(contract.BuyerOrder)
if err != nil {
Expand Down Expand Up @@ -97,13 +97,13 @@ func (l *TransactionListener) OnTransactionReceived(cb wallet.TransactionCallbac
//contract, state, funded, records, err := l.db.Sales().GetByPaymentAddress(output.Address)
if err == nil && state != pb.OrderState_PROCESSING_ERROR {
l.processSalePayment(cb.Txid, output, contract, state, funded, records)
l.cleanupOrderState(true, output, contract, state, funded, records)
l.cleanupOrderState(true, contract, state)
continue
}
contract, state, funded, records, err = l.getOrderDetails(output.OrderID, output.Address, false)
if err == nil {
l.processPurchasePayment(cb.Txid, output, contract, state, funded, records)
l.cleanupOrderState(false, output, contract, state, funded, records)
l.cleanupOrderState(false, contract, state)
continue
}
}
Expand Down

0 comments on commit 998d61e

Please sign in to comment.