# We should not have the 'in_active_chain' flag when we don't provide a block
gottx=self.nodes[0].getrawtransaction(tx,True)
assert_equal(gottx['txid'],tx)
assert'in_active_chain'notingottx
# We should not get the tx if we provide an unrelated block
assert_raises_rpc_error(-5,"No such transaction found",self.nodes[0].getrawtransaction,tx,True,block2)
# An invalid block hash should raise the correct errors
assert_raises_rpc_error(-8,"parameter 3 must be hexadecimal",self.nodes[0].getrawtransaction,tx,True,True)
assert_raises_rpc_error(-8,"parameter 3 must be hexadecimal",self.nodes[0].getrawtransaction,tx,True,"foobar")
assert_raises_rpc_error(-8,"parameter 3 must be of length 64",self.nodes[0].getrawtransaction,tx,True,"abcd1234")
assert_raises_rpc_error(-5,"Block hash not found",self.nodes[0].getrawtransaction,tx,True,"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")