Fix isOwn flag for mempool transactions
This commit is contained in:
parent
a282cde045
commit
fad284a425
@ -923,6 +923,7 @@ func (w *Worker) GetAddress(address string, page int, txsOnPage int, option Acco
|
|||||||
if option == AccountDetailsTxidHistory {
|
if option == AccountDetailsTxidHistory {
|
||||||
txids = append(txids, tx.Txid)
|
txids = append(txids, tx.Txid)
|
||||||
} else if option >= AccountDetailsTxHistoryLight {
|
} else if option >= AccountDetailsTxHistoryLight {
|
||||||
|
setIsOwnAddress(tx, address)
|
||||||
txs = append(txs, tx)
|
txs = append(txs, tx)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -454,6 +454,7 @@ func (s *PublicServer) parseTemplates() []*template.Template {
|
|||||||
"formatAmount": s.formatAmount,
|
"formatAmount": s.formatAmount,
|
||||||
"formatAmountWithDecimals": formatAmountWithDecimals,
|
"formatAmountWithDecimals": formatAmountWithDecimals,
|
||||||
"setTxToTemplateData": setTxToTemplateData,
|
"setTxToTemplateData": setTxToTemplateData,
|
||||||
|
"isOwnAddress": isOwnAddress,
|
||||||
"toJSON": toJSON,
|
"toJSON": toJSON,
|
||||||
}
|
}
|
||||||
var createTemplate func(filenames ...string) *template.Template
|
var createTemplate func(filenames ...string) *template.Template
|
||||||
@ -552,6 +553,11 @@ func setTxToTemplateData(td *TemplateData, tx *api.Tx) *TemplateData {
|
|||||||
return td
|
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) {
|
func (s *PublicServer) explorerTx(w http.ResponseWriter, r *http.Request) (tpl, *TemplateData, error) {
|
||||||
var tx *api.Tx
|
var tx *api.Tx
|
||||||
var err error
|
var err error
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user