func (cl *OpencxRPC) GetDepositAddress(args GetDepositAddressArgs, reply *GetDepositAddressReply) (err error) {

	// e = h(asset)
	sha3 := sha3.New256()
	sha3.Write([]byte(args.Asset))
	e := sha3.Sum(nil)

	pubkey, _, err := koblitz.RecoverCompact(koblitz.S256(), args.Signature, e)
	if err != nil {
		err = fmt.Errorf("Error verifying order, invalid signature: \n%s", err)
		return
	}

	cl.Server.LockIngests()
	if reply.Address, err = cl.Server.OpencxDB.GetDepositAddress(pubkey, args.Asset); err != nil {
		// gotta put these here cause if it errors out then oops just locked everything
		cl.Server.UnlockIngests()
		err = fmt.Errorf("Error with getdepositaddress command: \n%s", err)
		return
	}
	cl.Server.UnlockIngests()

	return
}
// GetDepositAddress is the RPC Interface for GetDepositAddress
GetDepositAddress is the RPC Interface for GetDepositAddress
// GetDepositAddress is the RPC Interface for GetDepositAddress
func (cl *OpencxRPC) GetDepositAddress(args GetDepositAddressArgs, reply *GetDepositAddressReply) (err error) {
	sha3 := sha3.New256()
	sha3.Write([]byte(args.Asset))
	e := sha3.Sum(nil)
	pubkey, _, err := koblitz.RecoverCompact(koblitz.S256(), args.Signature, e)
	if err != nil {
		err = fmt.Errorf("Error verifying order, invalid signature: \n%s", err)
		return
	}
	cl.Server.LockIngests()
	if reply.Address, err = cl.Server.OpencxDB.GetDepositAddress(pubkey, args.Asset); err != nil {
		cl.Server.UnlockIngests()
		err = fmt.Errorf("Error with getdepositaddress command: \n%s", err)
		return
	}
	cl.Server.UnlockIngests()
	return
}
func ( cl * OpencxRPC ) GetDepositAddress ( args GetDepositAddressArgs , reply * GetDepositAddressReply ) ( err error ) { sha3 := sha3 . New256 ( ) sha3 . Write ( [ ] byte ( args . Asset ) ) e := sha3 . Sum ( nil ) pubkey , _ , err := koblitz . RecoverCompact ( koblitz . S256 ( ) , args . Signature , e ) if err != nil { err = fmt . Errorf ( " \n " , err ) return } cl . Server . LockIngests ( ) if reply . Address , err = cl . Server . OpencxDB . GetDepositAddress ( pubkey , args . Asset ) ; err != nil { cl . Server . UnlockIngests ( ) err = fmt . Errorf ( " \n " , err ) return } cl . Server . UnlockIngests ( ) return }
GetDepositAddress is the RPC Interface for GetDepositAddress
GetDepositAddress is the RPC Interface for GetDepositAddress
// e = h(asset) // gotta put these here cause if it errors out then oops just locked everything