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

Commit 023a395

Browse files
authored
Merge pull request #1970 from OpenBazaar/doublenegative
(#1803) Fix double negative bug in refundAddressTransaction
2 parents 345e4b1 + 25a567c commit 023a395

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

core/utils.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,15 @@ func (n *OpenBazaarNode) BuildTransactionRecords(contract *pb.RicardianContract,
7373
if val.Cmp(big.NewInt(0)) < 0 {
7474
refundRecord = new(pb.TransactionRecord)
7575
refundRecord.Txid = rec.Txid
76-
refundRecord.BigValue = "-" + rec.BigValue
76+
refundRecord.BigValue = rec.BigValue
7777
refundRecord.Currency = rec.Currency
7878
refundRecord.Confirmations = rec.Confirmations
7979
refundRecord.Height = rec.Height
8080
refundRecord.Timestamp = rec.Timestamp
81+
82+
if !strings.HasPrefix(refundRecord.BigValue, "-") {
83+
refundRecord.BigValue = "-" + refundRecord.BigValue
84+
}
8185
break
8286
}
8387
}

0 commit comments

Comments
 (0)