binary/reflect handles JSON

This commit is contained in:
Jae Kwon
2015-01-05 14:04:42 -08:00
parent 13ca6fb241
commit d4e9b747d3
6 changed files with 499 additions and 170 deletions

View File

@ -2,7 +2,6 @@ package rpc
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
@ -31,10 +30,7 @@ func MempoolHandler(w http.ResponseWriter, r *http.Request) {
ReturnJSON(API_ERROR, Fmt("Error broadcasting transaction: %v", err))
}
jsonBytes, err := json.MarshalIndent(tx, "", " ")
if err != nil {
panic(err)
}
jsonBytes := JSONBytes(tx)
fmt.Println(">>", string(jsonBytes))
ReturnJSON(API_OK, Fmt("Broadcasted tx: %X", tx))