mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-13 07:28:59 +01:00
Merge #10368: [wallet] Remove helper conversion operator from wallet
5a5e4e9 [wallet] Remove CTransaction&() helper conversion operator from wallet implementation. (Karl-Johan Alm)
Pull request description:
The `CTransaction&()` operator in `CMerkleTx` makes conversion into `CTransaction`s transparent, but was marked as to-be-removed in favor of explicitly getting the `tx` ivar, presumably as the operator can lead to ambiguous behavior and makes the code harder to follow.
This PR removes the operator and adapts callers. This includes some cases of `static_cast<CTransaction>(wtx)` → `*wtx.tx`, which is definitely an improvement.
Tree-SHA512: 95856fec7194d6a79615ea1c322abfcd6bcedf6ffd0cfa89bbdd332ce13035fa52dd4b828d20df673072dde1be64b79c513529a6f422dd5f0961ce722a32d56a
This commit is contained in:
@@ -108,7 +108,7 @@ void WalletTxToJSON(const CWalletTx& wtx, UniValue& entry)
|
||||
std::string rbfStatus = "no";
|
||||
if (confirms <= 0) {
|
||||
LOCK(mempool.cs);
|
||||
RBFTransactionState rbfState = IsRBFOptIn(wtx, mempool);
|
||||
RBFTransactionState rbfState = IsRBFOptIn(*wtx.tx, mempool);
|
||||
if (rbfState == RBF_TRANSACTIONSTATE_UNKNOWN)
|
||||
rbfStatus = "unknown";
|
||||
else if (rbfState == RBF_TRANSACTIONSTATE_REPLACEABLE_BIP125)
|
||||
@@ -2051,7 +2051,7 @@ UniValue gettransaction(const JSONRPCRequest& request)
|
||||
ListTransactions(pwallet, wtx, "*", 0, false, details, filter);
|
||||
entry.push_back(Pair("details", details));
|
||||
|
||||
std::string strHex = EncodeHexTx(static_cast<CTransaction>(wtx), RPCSerializationFlags());
|
||||
std::string strHex = EncodeHexTx(*wtx.tx, RPCSerializationFlags());
|
||||
entry.push_back(Pair("hex", strHex));
|
||||
|
||||
return entry;
|
||||
|
||||
Reference in New Issue
Block a user