check txid (hash0 length argument, must be 64
This commit is contained in:
parent
5c5c4b882f
commit
86a76a96cb
|
@ -234,6 +234,9 @@ func (s *lwdStreamer) GetTreeState(ctx context.Context, id *walletrpc.BlockID) (
|
||||||
// by the zcashd 'getrawtransaction' RPC.
|
// by the zcashd 'getrawtransaction' RPC.
|
||||||
func (s *lwdStreamer) GetTransaction(ctx context.Context, txf *walletrpc.TxFilter) (*walletrpc.RawTransaction, error) {
|
func (s *lwdStreamer) GetTransaction(ctx context.Context, txf *walletrpc.TxFilter) (*walletrpc.RawTransaction, error) {
|
||||||
if txf.Hash != nil {
|
if txf.Hash != nil {
|
||||||
|
if len(txf.Hash) != 32 {
|
||||||
|
return nil, errors.New("Transaction ID has invalid length")
|
||||||
|
}
|
||||||
leHashStringJSON, err := json.Marshal(hex.EncodeToString(parser.Reverse(txf.Hash)))
|
leHashStringJSON, err := json.Marshal(hex.EncodeToString(parser.Reverse(txf.Hash)))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
Loading…
Reference in New Issue