Ejemplo n.º 1
0
// DecodeRawTransactionAsync returns an instance of a type that can be used to
// get the result of the RPC at some future time by invoking the Receive
// function on the returned instance.
//
// See DecodeRawTransaction for the blocking version and more details.
func (c *Client) DecodeRawTransactionAsync(serializedTx []byte) FutureDecodeRawTransactionResult {
	id := c.NextID()
	txHex := hex.EncodeToString(serializedTx)
	cmd, err := btcjson.NewDecodeRawTransactionCmd(id, txHex)
	if err != nil {
		return newFutureError(err)
	}

	return c.sendCmd(cmd)
}
Ejemplo n.º 2
0
// makeDecodeRawTransaction generates the cmd structure for
// decoderawtransaction commands.
func makeDecodeRawTransaction(args []interface{}) (btcjson.Cmd, error) {
	return btcjson.NewDecodeRawTransactionCmd("btcctl", args[0].(string))
}