diff --git a/api/worker.go b/api/worker.go index 198079d8..07057110 100644 --- a/api/worker.go +++ b/api/worker.go @@ -923,6 +923,7 @@ func (w *Worker) GetAddress(address string, page int, txsOnPage int, option Acco if option == AccountDetailsTxidHistory { txids = append(txids, tx.Txid) } else if option >= AccountDetailsTxHistoryLight { + setIsOwnAddress(tx, address) txs = append(txs, tx) } } diff --git a/server/public.go b/server/public.go index 293931da..125c273a 100644 --- a/server/public.go +++ b/server/public.go @@ -454,6 +454,7 @@ func (s *PublicServer) parseTemplates() []*template.Template { "formatAmount": s.formatAmount, "formatAmountWithDecimals": formatAmountWithDecimals, "setTxToTemplateData": setTxToTemplateData, + "isOwnAddress": isOwnAddress, "toJSON": toJSON, } var createTemplate func(filenames ...string) *template.Template @@ -552,6 +553,11 @@ func setTxToTemplateData(td *TemplateData, tx *api.Tx) *TemplateData { return td } +// isOwnAddress returns true if the address is the one that is being shown in the explorer +func isOwnAddress(td *TemplateData, a string) bool { + return a == td.AddrStr +} + func (s *PublicServer) explorerTx(w http.ResponseWriter, r *http.Request) (tpl, *TemplateData, error) { var tx *api.Tx var err error