MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / TxStateSerializedBlockHash

Function TxStateSerializedBlockHash

src/wallet/transaction.h:100–109  ·  view source on GitHub ↗

Get TxState serialized block hash. Inverse of TxStateInterpretSerialized.

Source from the content-addressed store, hash-verified

98
99//! Get TxState serialized block hash. Inverse of TxStateInterpretSerialized.
100static inline uint256 TxStateSerializedBlockHash(const TxState& state)
101{
102 return std::visit(util::Overloaded{
103 [](const TxStateInactive& inactive) { return inactive.abandoned ? uint256::ONE : uint256::ZERO; },
104 [](const TxStateInMempool& in_mempool) { return uint256::ZERO; },
105 [](const TxStateConfirmed& confirmed) { return confirmed.confirmed_block_hash; },
106 [](const TxStateBlockConflicted& conflicted) { return conflicted.conflicting_block_hash; },
107 [](const TxStateUnrecognized& unrecognized) { return unrecognized.block_hash; }
108 }, state);
109}
110
111//! Get TxState serialized block index. Inverse of TxStateInterpretSerialized.
112static inline int TxStateSerializedIndex(const TxState& state)

Callers 3

SerializeMethod · 0.85
AddToWalletMethod · 0.85
BOOST_AUTO_TEST_CASEFunction · 0.85

Calls

no outgoing calls

Tested by 1

BOOST_AUTO_TEST_CASEFunction · 0.68