MCPcopy Create free account
hub / github.com/ElementsProject/elements / TxStateSerializedBlockHash

Function TxStateSerializedBlockHash

src/wallet/transaction.h:87–96  ·  view source on GitHub ↗

Get TxState serialized block hash. Inverse of TxStateInterpretSerialized.

Source from the content-addressed store, hash-verified

85
86//! Get TxState serialized block hash. Inverse of TxStateInterpretSerialized.
87static inline uint256 TxStateSerializedBlockHash(const TxState& state)
88{
89 return std::visit(util::Overloaded{
90 [](const TxStateInactive& inactive) { return inactive.abandoned ? uint256::ONE : uint256::ZERO; },
91 [](const TxStateInMempool& in_mempool) { return uint256::ZERO; },
92 [](const TxStateConfirmed& confirmed) { return confirmed.confirmed_block_hash; },
93 [](const TxStateConflicted& conflicted) { return conflicted.conflicting_block_hash; },
94 [](const TxStateUnrecognized& unrecognized) { return unrecognized.block_hash; }
95 }, state);
96}
97
98//! Get TxState serialized block index. Inverse of TxStateInterpretSerialized.
99static 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