From 2422cae7e8508245dbb2122253915b1fb0666c49 Mon Sep 17 00:00:00 2001 From: luk3yx Date: Wed, 17 Jun 2020 14:50:06 +1200 Subject: [PATCH] Fix /v2/get_transactions?simple=true. --- lurkcoin/api/v2.go | 5 +++-- lurkcoin/misc.go | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lurkcoin/api/v2.go b/lurkcoin/api/v2.go index cc4c277..6d6f304 100644 --- a/lurkcoin/api/v2.go +++ b/lurkcoin/api/v2.go @@ -247,8 +247,8 @@ func addV2API(router *httprouter.Router, db lurkcoin.Database, func(r *HTTPRequest, f v2Form) (interface{}, error) { transactions := r.Server.GetPendingTransactions() if f.Get("simple") != "" { + _, exc := r.Server.GetExchangeRate(c1, false) if len(transactions) == 0 { - _, exc := r.Server.GetExchangeRate(c1, false) return exc, nil } s := func(n string) string { @@ -257,7 +257,8 @@ func addV2API(router *httprouter.Router, db lurkcoin.Database, transaction := transactions[0] // To support fragile clients (such as versions of the lurkcoin // mod that use the /v2 API), "¤" is replaced with "_". - return fmt.Sprintf("%d|%s|%s|%s", + return fmt.Sprintf("%g|%d|%s|%s|%s", + exc, transaction.GetLegacyID(), s(strings.Replace(transaction.Target, "¤", "_", -1)), transaction.ReceivedAmount.RawString(), diff --git a/lurkcoin/misc.go b/lurkcoin/misc.go index fb3cea5..bf53c21 100644 --- a/lurkcoin/misc.go +++ b/lurkcoin/misc.go @@ -35,7 +35,7 @@ import ( ) const SYMBOL = "¤" -const VERSION = "3.0.1" +const VERSION = "3.0.2" // Note that public source code is required by the AGPL const SOURCE_URL = "https://github.com/luk3yx/lurkcoin-core"