mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-12 16:47:58 +02:00
refactor: Convert RPCs and merkleblock from uint256 to Txid
This commit is contained in:
@@ -322,10 +322,10 @@ static RPCHelpMan getrawtransaction()
|
||||
const NodeContext& node = EnsureAnyNodeContext(request.context);
|
||||
ChainstateManager& chainman = EnsureChainman(node);
|
||||
|
||||
uint256 hash = ParseHashV(request.params[0], "parameter 1");
|
||||
auto txid{Txid::FromUint256(ParseHashV(request.params[0], "parameter 1"))};
|
||||
const CBlockIndex* blockindex = nullptr;
|
||||
|
||||
if (hash == chainman.GetParams().GenesisBlock().hashMerkleRoot) {
|
||||
if (txid.ToUint256() == chainman.GetParams().GenesisBlock().hashMerkleRoot) {
|
||||
// Special exception for the genesis block coinbase transaction
|
||||
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "The genesis block coinbase is not considered an ordinary transaction and cannot be retrieved");
|
||||
}
|
||||
@@ -348,7 +348,7 @@ static RPCHelpMan getrawtransaction()
|
||||
}
|
||||
|
||||
uint256 hash_block;
|
||||
const CTransactionRef tx = GetTransaction(blockindex, node.mempool.get(), hash, hash_block, chainman.m_blockman);
|
||||
const CTransactionRef tx = GetTransaction(blockindex, node.mempool.get(), txid, hash_block, chainman.m_blockman);
|
||||
if (!tx) {
|
||||
std::string errmsg;
|
||||
if (blockindex) {
|
||||
|
||||
Reference in New Issue
Block a user