17 for (
auto& txin : tx1.vin) {
19 txin.scriptWitness.SetNull();
21 for (
auto& txin : tx2.vin) {
23 txin.scriptWitness.SetNull();
30 return state<TxStateInMempool>();
53 if (
auto* conf = state<TxStateConfirmed>()) {
54 lookup_block(conf->confirmed_block_hash, conf->confirmed_block_height,
m_state);
55 }
else if (
auto* conf = state<TxStateBlockConflicted>()) {
56 lookup_block(conf->conflicting_block_hash, conf->conflicting_block_height,
m_state);
71 const auto& [tx_pair, inserted] =
m_txs.emplace(new_tx->GetWitnessHash(), std::move(new_tx));
75 const auto& [wtxid, tx] = *tx_pair;
77 if (new_state.index() !=
m_state.index()) {
79 if (state<TxStateConfirmed>()) {
#define Assert(val)
Identity function.
#define Assume(val)
Assume is the identity function.
Serialized script, used inside transaction inputs and outputs.
The basic transaction that is broadcasted on the network and contained in blocks.
Interface giving clients (wallet processes, maybe other analysis tools in the future) ability to acce...
virtual bool findBlock(const uint256 &hash, const FoundBlock &block={})=0
Return whether node has the block and optionally return block metadata or contents.
Helper for findBlock to selectively return pieces of block data.
A transaction with a bunch of additional info that only the owner cares about.
const Txid & GetHash() const LIFETIMEBOUND
bool IsEquivalentTo(const CWalletTx &tx) const
True if only scriptSigs are different.
std::map< Wtxid, CTransactionRef > m_txs
void updateState(interfaces::Chain &chain)
Update transaction state when attaching to a chain, filling in heights of conflicted and confirmed bl...
unsigned int nTimeReceived
time received by this node
bool Update(CTransactionRef tx, const TxState &new_state)
int64_t GetTxTime() const
CTransactionRef GetTx() const
void RecomputeCanonical()
Set m_canonical_wtxid to the best variant under the unconfirmed rule (witnessed preferred,...
unsigned int nTimeSmart
Stable timestamp that never changes, and reflects the order a transaction was added to the wallet.
static int32_t GetTransactionWeight(const CTransaction &tx)
std::variant< TxStateConfirmed, TxStateInMempool, TxStateBlockConflicted, TxStateInactive, TxStateUnrecognized > TxState
All possible CWalletTx states.
static int TxStateSerializedIndex(const TxState &state)
Get TxState serialized block index. Inverse of TxStateInterpretSerialized.
static uint256 TxStateSerializedBlockHash(const TxState &state)
Get TxState serialized block hash. Inverse of TxStateInterpretSerialized.
std::shared_ptr< const CTransaction > CTransactionRef
A mutable version of CTransaction.
State of transaction not confirmed or conflicting with a known block and not in the mempool.