Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions internal/rpc/jsonrpc/methods.go
Original file line number Diff line number Diff line change
Expand Up @@ -4344,7 +4344,6 @@ func (s *Server) ticketInfo(ctx context.Context, icmd any) (any, error) {

start := wallet.NewBlockIdentifierFromHeight(*cmd.StartHeight)
end := wallet.NewBlockIdentifierFromHeight(-1)
tmptx := new(wire.MsgTx)
err := w.GetTickets(ctx, func(ts []*wallet.TicketSummary, h *wire.BlockHeader) (bool, error) {
for _, t := range ts {
status := t.Status
Expand All @@ -4354,11 +4353,12 @@ func (s *Server) ticketInfo(ctx context.Context, icmd any) (any, error) {
// and the lack of a block hash.
status = wallet.TicketStatusImmature
}
err := tmptx.Deserialize(bytes.NewReader(t.Ticket.Transaction))
var tx wire.MsgTx
err := tx.Deserialize(bytes.NewReader(t.Ticket.Transaction))
if err != nil {
return false, err
}
out := tmptx.TxOut[0]
out := tx.TxOut[0]
info := types.TicketInfoResult{
Hash: t.Ticket.Hash.String(),
Cost: dcrutil.Amount(out.Value).ToCoin(),
Expand Down
1 change: 1 addition & 0 deletions wallet/udb/txdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,7 @@ func readRawTxRecord(txHash *chainhash.Hash, v []byte, rec *TxRecord) error {
}
rec.Hash = *txHash
rec.Received = time.Unix(int64(byteOrder.Uint64(v)), 0)
rec.MsgTx = wire.MsgTx{}
err := rec.MsgTx.Deserialize(bytes.NewReader(v[8:]))
if err != nil {
return errors.E(errors.IO, err)
Expand Down
Loading