Verify rawtx

This commit is contained in:
adityapk00 2021-04-19 13:48:05 -07:00 committed by Larry Ruane
parent bdaac63f3e
commit d1a48e7d2d
1 changed files with 5 additions and 0 deletions

View File

@ -288,6 +288,11 @@ func (s *lwdStreamer) SendTransaction(ctx context.Context, rawtx *walletrpc.RawT
// Result: // Result:
// "hex" (string) The transaction hash in hex // "hex" (string) The transaction hash in hex
// Verify rawtx
if rawtx == nil || rawtx.Data == nil {
return nil, errors.New("Bad transaction data")
}
// Construct raw JSON-RPC params // Construct raw JSON-RPC params
params := make([]json.RawMessage, 1) params := make([]json.RawMessage, 1)
txJSON, err := json.Marshal(hex.EncodeToString(rawtx.Data)) txJSON, err := json.Marshal(hex.EncodeToString(rawtx.Data))