user75239: I am trying to check if a transaction is confirmed or not via RPC commands. At first I tried to use gettransaction, but it doesn't work.
Then I use getrawtransaction and decode it:
{
   "lock_time":0,
   "size":192,
   "inputs":[
      {
         "prev_out":{
            "index":1,
            "hash":"5352d8186b825128a7d4a0df0a8c105da70c81ec763209271566a512fee14cee"
         },
         "script":"483045022100fae0b1dbe08f79a92debde8f3a8e955bcff9ce928b86fb217cfd830af6937386022072386b28a288408bad05426704b55f14a4ad4bf3927ac053facda4478c467eae0121034756f0f954f40ed7dabcaa80c4212a240e4b2c1eee7532bd06cac58c173faf3f"
      }
   ],
   "version":1,
   "vin_sz":1,
   "hash":"931d220f622a9b029cea3e09ca7a9c11f3714c68f9bd272ca97cd915b518050d",
   "vout_sz":1,
   "out":[
      {
         "script_string":"OP_DUP OP_HASH160 0f14a815e42dcdff9c8239a7393b2a9a63a8b68d OP_EQUALVERIFY OP_CHECKSIG",
         "address":"12Njt85fc9Kr7s8tr3Eug4tvkZQUhcGXfz",
         "value":100000000,
         "script":"76a9140f14a815e42dcdff9c8239a7393b2a9a63a8b68d88ac"
      }
   ]
}

And I got the above result. But I don't understand what is written, how can I know if it has been confirmed without relying on Blockexplorer? 
Thanks

user74555: The decoderawtransaction RPC call oddly omits the confirmations field in the resulting JSON output. Instead of using decoderawtransaction, try this:
$ bitcoin-cli getrawtransaction <tx_id> true

(Notice the "true" at the end, which means "output as json")
This will return JSON that has a "confirmations" field in the top level of the returned object.

75239: <p>I am trying to check if a transaction is confirmed or not via RPC commands. At first I tried to use <code>gettransaction</code>, but it doesn't work.</p>

<p>Then I use <code>getrawtransaction</code> and decode it:</p>

<pre><code>{
   "lock_time":0,
   "size":192,
   "inputs":[
      {
         "prev_out":{
            "index":1,
            "hash":"5352d8186b825128a7d4a0df0a8c105da70c81ec763209271566a512fee14cee"
         },
         "script":"483045022100fae0b1dbe08f79a92debde8f3a8e955bcff9ce928b86fb217cfd830af6937386022072386b28a288408bad05426704b55f14a4ad4bf3927ac053facda4478c467eae0121034756f0f954f40ed7dabcaa80c4212a240e4b2c1eee7532bd06cac58c173faf3f"
      }
   ],
   "version":1,
   "vin_sz":1,
   "hash":"931d220f622a9b029cea3e09ca7a9c11f3714c68f9bd272ca97cd915b518050d",
   "vout_sz":1,
   "out":[
      {
         "script_string":"OP_DUP OP_HASH160 0f14a815e42dcdff9c8239a7393b2a9a63a8b68d OP_EQUALVERIFY OP_CHECKSIG",
         "address":"12Njt85fc9Kr7s8tr3Eug4tvkZQUhcGXfz",
         "value":100000000,
         "script":"76a9140f14a815e42dcdff9c8239a7393b2a9a63a8b68d88ac"
      }
   ]
}
</code></pre>

<p>And I got the above result. But I don't understand what is written, how can I know if it has been confirmed without relying on Blockexplorer? </p>

<p>Thanks</p>
 74555: <p>The <code>decoderawtransaction</code> RPC call oddly omits the <code>confirmations</code> field in the resulting JSON output. Instead of using <code>decoderawtransaction</code>, try this:</p>

<pre><code>$ bitcoin-cli getrawtransaction &lt;tx_id&gt; true
</code></pre>

<p>(Notice the "true" at the end, which means "output as json")</p>

<p>This will return JSON that has a "confirmations" field in the top level of the returned object.</p>
