Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: xishon on May 17, 2017, 11:27:29 AM



Title: Bitcoin core RPC method sendfrom is not working
Post by: xishon on May 17, 2017, 11:27:29 AM
Bitcoin core RPC method sendfrom is not working from my controller.I am running the following command from my controller

   bitcoin_cli = BitcoinCli.new
    response = bitcoin_cli.execute_function("sendfrom", "#{account.strip}", "#{address.strip}", "#{amount}")

and here is execute function

class BitcoinCli
  def initialize()
    # nothing to do
  end

 begin
    def execute_function(function_name, *params)
      result = %x{/usr/local/bin/bitcoin-cli #{function_name} #{params.join(' ')}}
    end
  rescue => e
    puts e.message
  end
end

but after executing the function the response is nil.


Title: Re: Bitcoin core RPC method sendtoaddress is not working
Post by: achow101 on May 17, 2017, 01:35:06 PM
Your parameters are in the wrong order. The command format is
Code:
sendtoaddress "address" amount ( "comment" "comment_to" subtractfeefromamount )


Title: Re: Bitcoin core RPC method sendtoaddress is not working
Post by: DannyHamilton on May 17, 2017, 02:43:07 PM
Thanks for your response.
Sorry to say but I am currently using sendfrom function.

Sorry to say, but your thread is asking about sendtoaddress function.