Add alternate sign address to ticket search result
This commit is contained in:
parent
efa5a09820
commit
6260e4ee5b
@ -31,6 +31,7 @@ type searchResult struct {
|
||||
Hash string
|
||||
Found bool
|
||||
Ticket database.Ticket
|
||||
AltSig string
|
||||
VoteChanges map[uint32]database.VoteChangeRecord
|
||||
MaxVoteChanges int
|
||||
}
|
||||
@ -122,11 +123,24 @@ func ticketSearch(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
altSigData, err := db.AltSigData(hash)
|
||||
if err != nil {
|
||||
log.Errorf("db.AltSigData error (ticketHash=%s): %v", hash, err)
|
||||
c.String(http.StatusInternalServerError, "Error getting alt sig from db")
|
||||
return
|
||||
}
|
||||
|
||||
altSig := ""
|
||||
if altSigData != nil {
|
||||
altSig = altSigData.AltSigAddr
|
||||
}
|
||||
|
||||
c.HTML(http.StatusOK, "admin.html", gin.H{
|
||||
"SearchResult": searchResult{
|
||||
Hash: hash,
|
||||
Found: found,
|
||||
Ticket: ticket,
|
||||
AltSig: altSig,
|
||||
VoteChanges: voteChanges,
|
||||
MaxVoteChanges: cfg.MaxVoteChangeRecords,
|
||||
},
|
||||
|
||||
@ -28,6 +28,10 @@
|
||||
<th>Ticket Outcome</th>
|
||||
<td>{{ .Ticket.Outcome }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Voting WIF</th>
|
||||
<td>{{ .Ticket.VotingWIF }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Commitment Address</th>
|
||||
<td>
|
||||
@ -37,8 +41,12 @@
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Voting WIF</th>
|
||||
<td>{{ .Ticket.VotingWIF }}</td>
|
||||
<th>Alternate Signing Address</th>
|
||||
<td>
|
||||
<a href="{{ addressURL .AltSig }}">
|
||||
{{ .AltSig }}
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user