mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 14:38:29 +01:00
[validation] Replace tx index code in validation code with TxIndex.
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
#include <coins.h>
|
||||
#include <consensus/validation.h>
|
||||
#include <core_io.h>
|
||||
#include <index/txindex.h>
|
||||
#include <init.h>
|
||||
#include <keystore.h>
|
||||
#include <validation.h>
|
||||
@@ -176,10 +177,10 @@ UniValue getrawtransaction(const JSONRPCRequest& request)
|
||||
throw JSONRPCError(RPC_MISC_ERROR, "Block not available");
|
||||
}
|
||||
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";
|
||||
} else {
|
||||
errmsg = fTxIndex
|
||||
? "No such mempool or blockchain transaction"
|
||||
: "No such mempool transaction. Use -txindex to enable blockchain transaction queries";
|
||||
errmsg = "No such mempool or blockchain transaction";
|
||||
}
|
||||
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, errmsg + ". Use gettransaction for wallet transactions.");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user