mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-06 10:42:46 +01:00
Replace direct use of 0 with SetNull and IsNull
Replace x=0 with .SetNull(), x==0 with IsNull(), x!=0 with !IsNull(). Replace uses of uint256(0) with uint256().
This commit is contained in:
@@ -89,7 +89,7 @@ void TxToJSON(const CTransaction& tx, const uint256 hashBlock, Object& entry)
|
||||
}
|
||||
entry.push_back(Pair("vout", vout));
|
||||
|
||||
if (hashBlock != 0) {
|
||||
if (!hashBlock.IsNull()) {
|
||||
entry.push_back(Pair("blockhash", hashBlock.GetHex()));
|
||||
BlockMap::iterator mi = mapBlockIndex.find(hashBlock);
|
||||
if (mi != mapBlockIndex.end() && (*mi).second) {
|
||||
@@ -178,7 +178,7 @@ Value getrawtransaction(const Array& params, bool fHelp)
|
||||
fVerbose = (params[1].get_int() != 0);
|
||||
|
||||
CTransaction tx;
|
||||
uint256 hashBlock = 0;
|
||||
uint256 hashBlock;
|
||||
if (!GetTransaction(hash, tx, hashBlock, true))
|
||||
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "No information available about transaction");
|
||||
|
||||
@@ -438,7 +438,7 @@ Value decoderawtransaction(const Array& params, bool fHelp)
|
||||
throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "TX decode failed");
|
||||
|
||||
Object result;
|
||||
TxToJSON(tx, 0, result);
|
||||
TxToJSON(tx, uint256(), result);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user