Title: help on development: json-rpc, blockchain reorganization & transaction types Post by: cloudytoday on November 14, 2012, 03:54:08 PM Hi, I am trying to develop a service for bitcoins, but there are some problems. I use PHP and JSON-RPC and bitcoind.
1. If there is an error in a call to bitcoid/json-rpc, it throws an exception. For example if I try: $bitcoin->getrawtransaction("abcd"); gives: Code: Fatal error: Uncaught exception 'Exception' with message 'Unable to connect to http://xxxx:xxxx@127.0.0.1:8332/' in /.../jsonRPCClient.php:140 Code: No information available about transaction (code -5) 2. What is a good way to handle blockchain reorganization? If I accept a transaction from user, then the blockchain is reorganized? What info can I get from "bitcoind -blocknotify "cmd""? Does it tell me which blocks are now rejected, or just the hash of the newly accepted block? 3. How can I verify that transactions I receive are "normal" transactions, and reject any "non-normal". I mean, I don't want to accept transaction with locktime, or sequence. I only want normal transaction that I can freely redeem at any time. Is it enough to accept (I mean store in database) only locktime=0 and sequence=2^32-1? Or do I have to check the details of scriptPubKey too? Thanks. |