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

Commit f5a9784

Browse files
committed
chash fixes
1 parent c7df05b commit f5a9784

File tree

6 files changed

+13
-13
lines changed

6 files changed

+13
-13
lines changed

api/jsonapi.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3371,7 +3371,7 @@ func (i *jsonAPIHandler) POSTBumpFee(w http.ResponseWriter, r *http.Request) {
33713371
}
33723372
var wal wallet.Wallet
33733373
for _, w := range i.node.Multiwallet {
3374-
_, err := w.GetTransaction(*txHash)
3374+
_, err := w.GetTransaction(txHash.String())
33753375
if err == nil {
33763376
wal = w
33773377
break
@@ -3381,7 +3381,7 @@ func (i *jsonAPIHandler) POSTBumpFee(w http.ResponseWriter, r *http.Request) {
33813381
ErrorResponse(w, http.StatusBadRequest, "transaction not found in any wallet")
33823382
return
33833383
}
3384-
newTxid, err := wal.BumpFee(*txHash)
3384+
newTxid, err := wal.BumpFee(txHash.String())
33853385
if err != nil {
33863386
if err == spvwallet.BumpFeeAlreadyConfirmedError {
33873387
ErrorResponse(w, http.StatusBadRequest, err.Error())
@@ -3405,7 +3405,7 @@ func (i *jsonAPIHandler) POSTBumpFee(w http.ResponseWriter, r *http.Request) {
34053405
return
34063406
}
34073407
if err := i.node.Datastore.TxMetadata().Put(repo.Metadata{
3408-
Txid: newTxid.String(),
3408+
Txid: newTxid,
34093409
Address: "",
34103410
Memo: fmt.Sprintf("Fee bump of %s", txid),
34113411
OrderId: "",
@@ -3429,7 +3429,7 @@ func (i *jsonAPIHandler) POSTBumpFee(w http.ResponseWriter, r *http.Request) {
34293429
ErrorResponse(w, http.StatusInternalServerError, err.Error())
34303430
return
34313431
}
3432-
txn, err := wal.GetTransaction(*newTxid)
3432+
txn, err := wal.GetTransaction(newTxid)
34333433
if err != nil {
34343434
ErrorResponse(w, http.StatusInternalServerError, err.Error())
34353435
return
@@ -3439,7 +3439,7 @@ func (i *jsonAPIHandler) POSTBumpFee(w http.ResponseWriter, r *http.Request) {
34393439

34403440
t := repo.NewAPITime(txn.Timestamp)
34413441
resp := &response{
3442-
Txid: newTxid.String(),
3442+
Txid: newTxid,
34433443
ConfirmedBalance: &repo.CurrencyValue{Currency: defn, Amount: &confirmed.Value},
34443444
UnconfirmedBalance: &repo.CurrencyValue{Currency: defn, Amount: &unconfirmed.Value},
34453445
Amount: amt0,

core/disputes.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ func (n *OpenBazaarNode) verifyEscrowFundsAreDisputeable(contract *pb.RicardianC
176176
log.Errorf("Nil NewHashFromStr(%s)", r.Txid)
177177
return false
178178
}
179-
actualConfirmations, _, err := wal.GetConfirmations(*hash)
179+
actualConfirmations, _, err := wal.GetConfirmations(hash.String())
180180
if err != nil {
181181
log.Errorf("Failed GetConfirmations(%s): %s", hash.String(), err.Error())
182182
return false

core/refunds.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ func (n *OpenBazaarNode) RefundOrder(contract *pb.RicardianContract, records []*
102102
return err
103103
}
104104
txinfo := new(pb.Refund_TransactionInfo)
105-
txinfo.Txid = txid.String()
105+
txinfo.Txid = txid
106106
txinfo.BigValue = outValue.String()
107107
txinfo.ValueCurrency = contract.BuyerOrder.Payment.AmountCurrency
108108
refundMsg.RefundTransaction = txinfo

core/spend.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ func (n *OpenBazaarNode) Spend(args *SpendRequest) (*SpendResponse, error) {
115115
}
116116
}
117117

118-
txn, err := wal.GetTransaction(*txid)
118+
txn, err := wal.GetTransaction(txid)
119119
if err != nil {
120120
log.Errorf("get txn failed : %v", err.Error())
121121
return nil, fmt.Errorf("failed retrieving new wallet balance: %s", err)
@@ -146,7 +146,7 @@ func (n *OpenBazaarNode) Spend(args *SpendRequest) (*SpendResponse, error) {
146146
}
147147

148148
if err := n.Datastore.TxMetadata().Put(repo.Metadata{
149-
Txid: txid.String(),
149+
Txid: txid,
150150
Address: toAddress,
151151
Memo: memo,
152152
OrderId: args.OrderID,
@@ -163,7 +163,7 @@ func (n *OpenBazaarNode) Spend(args *SpendRequest) (*SpendResponse, error) {
163163
}
164164

165165
return &SpendResponse{
166-
Txid: txid.String(),
166+
Txid: txid,
167167
ConfirmedBalance: confirmed.Value.String(),
168168
UnconfirmedBalance: unconfirmed.Value.String(),
169169
Currency: &defn,

core/utils.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ func (n *OpenBazaarNode) BuildTransactionRecords(contract *pb.RicardianContract,
5252
if err != nil {
5353
return paymentRecords, nil, err
5454
}
55-
confirmations, height, err := wal.GetConfirmations(*ch)
55+
confirmations, height, err := wal.GetConfirmations(ch.String())
5656
if err != nil {
5757
return paymentRecords, nil, err
5858
}
@@ -93,7 +93,7 @@ func (n *OpenBazaarNode) BuildTransactionRecords(contract *pb.RicardianContract,
9393
if err != nil {
9494
return paymentRecords, refundRecord, err
9595
}
96-
confirmations, height, err := wal.GetConfirmations(*ch)
96+
confirmations, height, err := wal.GetConfirmations(ch.String())
9797
if err != nil {
9898
return paymentRecords, refundRecord, nil
9999
}

net/service/handlers.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1979,7 +1979,7 @@ func (service *OpenBazaarService) handleOrderPayment(peer peer.ID, pmes *pb.Mess
19791979
}
19801980

19811981
log.Debugf("retrieving %s transaction %s", paymentDetails.Coin, chash.String())
1982-
txn, err := wal.GetTransaction(*chash)
1982+
txn, err := wal.GetTransaction(chash.String())
19831983
if err != nil {
19841984
return nil, err
19851985
}

0 commit comments

Comments
 (0)