Merge fce4123242 into merged_master (Bitcoin PR #16217)

This commit is contained in:
Andrew Poelstra 2020-11-06 15:20:15 +00:00
commit 0e110f2b6e
2 changed files with 4 additions and 4 deletions

View file

@ -207,7 +207,7 @@ static UniValue getrawtransaction(const JSONRPCRequest& request)
}
errmsg = "No such transaction found in the provided block";
} else if (!g_txindex) {
errmsg = "No such mempool transaction. Use -txindex to enable blockchain transaction queries";
errmsg = "No such mempool transaction. Use -txindex or provide a block hash to enable blockchain transaction queries";
} else if (!f_txindex_ready) {
errmsg = "No such mempool transaction. Blockchain transactions are still in the process of being indexed";
} else {

View file

@ -52,11 +52,11 @@ class ConnectGenesisTest(BitcoinTestFramework):
# Test rpc getraw functionality
# Coinbase transaction is provably unspendable (OP_RETURN), so even AddCoin won't add it
assert_raises_rpc_error(-5, "No such mempool transaction. Use -txindex to enable blockchain transaction queries. Use gettransaction for wallet transactions.", self.nodes[0].getrawtransaction, coinbase_tx)
assert_raises_rpc_error(-5, "No such mempool transaction. Use -txindex to enable blockchain transaction queries. Use gettransaction for wallet transactions.", self.nodes[1].getrawtransaction, coinbase_tx)
assert_raises_rpc_error(-5, "No such mempool transaction. Use -txindex or provide a block hash to enable blockchain transaction queries. Use gettransaction for wallet transactions.", self.nodes[0].getrawtransaction, coinbase_tx)
assert_raises_rpc_error(-5, "No such mempool transaction. Use -txindex or provide a block hash to enable blockchain transaction queries. Use gettransaction for wallet transactions.", self.nodes[1].getrawtransaction, coinbase_tx)
# Issuance transaction is an OP_TRUE, so will be available to second node
assert_raises_rpc_error(-5, "No such mempool transaction. Use -txindex to enable blockchain transaction queries. Use gettransaction for wallet transactions.", self.nodes[0].getrawtransaction, issuance_tx)
assert_raises_rpc_error(-5, "No such mempool transaction. Use -txindex or provide a block hash to enable blockchain transaction queries. Use gettransaction for wallet transactions.", self.nodes[0].getrawtransaction, issuance_tx)
self.nodes[1].getrawtransaction(issuance_tx, False, self.nodes[0].getblockhash(0))
if __name__ == '__main__':