fix GetTransaction (broken in "add GetMempool()" commit)

This commit is contained in:
Larry Ruane 2020-10-06 09:22:36 -06:00 committed by Larry Ruane
parent ac1bf8481c
commit 1906e1d1eb
1 changed files with 2 additions and 2 deletions

View File

@ -158,7 +158,7 @@ func (s *lwdStreamer) GetBlockRange(span *walletrpc.BlockRange, resp walletrpc.C
// by the zcashd 'getrawtransaction' RPC.
func (s *lwdStreamer) GetTransaction(ctx context.Context, txf *walletrpc.TxFilter) (*walletrpc.RawTransaction, error) {
if txf.Hash != nil {
leHashStringJSON, err := json.Marshal(hex.EncodeToString(txf.Hash))
leHashStringJSON, err := json.Marshal(hex.EncodeToString(parser.Reverse(txf.Hash)))
if err != nil {
common.Log.Errorf("GetTransaction: cannot encode txid: %s", err.Error())
return nil, err
@ -172,7 +172,7 @@ func (s *lwdStreamer) GetTransaction(ctx context.Context, txf *walletrpc.TxFilte
// For some reason, the error responses are not JSON
if rpcErr != nil {
common.Log.Errorf("GetTransaction error: %s", rpcErr.Error())
return nil, errors.New((strings.Split(rpcErr.Error(), ":"))[0])
return nil, rpcErr
}
// Many other fields are returned, but we need only these two.
var txinfo struct {