From 6bee7541d6c744dda9c9e0562d9c333cd3da6dc5 Mon Sep 17 00:00:00 2001 From: cryptozoidberg Date: Mon, 28 Dec 2020 23:45:16 +0100 Subject: [PATCH] very first draft for transaction in/outs for atomics --- src/currency_core/currency_basic.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/src/currency_core/currency_basic.h b/src/currency_core/currency_basic.h index 8ac26a6f..4acf9a9f 100644 --- a/src/currency_core/currency_basic.h +++ b/src/currency_core/currency_basic.h @@ -223,6 +223,21 @@ namespace currency END_SERIALIZE() }; + struct txin_to_htlc + { + crypto::hash hltc_origin; + txout_v key_offset; + crypto::key_image k_image; // double spending protection + std::vector etc_details; //this flag used when TX_FLAG_SIGNATURE_MODE_SEPARATE flag is set, point to which amount of outputs(starting from zero) used in signature + + BEGIN_SERIALIZE_OBJECT() + FIELD(hltc_origin) + FIELD(key_offset) + VARINT_FIELD(k_image) + FIELD(etc_details) + END_SERIALIZE() + }; + struct txin_multisig { uint64_t amount; @@ -249,6 +264,21 @@ namespace currency END_SERIALIZE() }; + struct txout_htlc + { + crypto::hash htlc_hash; + uint8_t flags; //select type of the hash, may be some extra info in future + uint64_t expiration; + crypto::public_key pkey; + + BEGIN_SERIALIZE_OBJECT() + FIELD(htlc_hash) + FIELD(flags) + VARINT_FIELD(expiration) + FIELD(pkey) + END_SERIALIZE() + }; + typedef boost::variant txin_v; typedef boost::variant txout_target_v;