Changeset View
Changeset View
Standalone View
Standalone View
src/psbt.h
// Copyright (c) 2009-2019 The Bitcoin Core developers | // Copyright (c) 2009-2019 The Bitcoin Core developers | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
#ifndef BITCOIN_PSBT_H | #ifndef BITCOIN_PSBT_H | ||||
#define BITCOIN_PSBT_H | #define BITCOIN_PSBT_H | ||||
#include <attributes.h> | #include <attributes.h> | ||||
#include <node/transaction.h> | #include <node/transaction.h> | ||||
#include <optional.h> | |||||
#include <primitives/transaction.h> | #include <primitives/transaction.h> | ||||
#include <pubkey.h> | #include <pubkey.h> | ||||
#include <script/sign.h> | #include <script/sign.h> | ||||
#include <script/signingprovider.h> | #include <script/signingprovider.h> | ||||
// Magic bytes | // Magic bytes | ||||
static constexpr uint8_t PSBT_MAGIC_BYTES[5] = {'p', 's', 'b', 't', 0xff}; | static constexpr uint8_t PSBT_MAGIC_BYTES[5] = {'p', 's', 'b', 't', 0xff}; | ||||
▲ Show 20 Lines • Show All 310 Lines • ▼ Show 20 Lines | template <typename Stream> PSBTOutput(deserialize_type, Stream &s) { | ||||
Unserialize(s); | Unserialize(s); | ||||
} | } | ||||
}; | }; | ||||
/** | /** | ||||
* A version of CTransaction with the PSBT format. | * A version of CTransaction with the PSBT format. | ||||
*/ | */ | ||||
struct PartiallySignedTransaction { | struct PartiallySignedTransaction { | ||||
Optional<CMutableTransaction> tx; | std::optional<CMutableTransaction> tx; | ||||
std::vector<PSBTInput> inputs; | std::vector<PSBTInput> inputs; | ||||
std::vector<PSBTOutput> outputs; | std::vector<PSBTOutput> outputs; | ||||
std::map<std::vector<uint8_t>, std::vector<uint8_t>> unknown; | std::map<std::vector<uint8_t>, std::vector<uint8_t>> unknown; | ||||
bool IsNull() const; | bool IsNull() const; | ||||
/** | /** | ||||
* Merge psbt into this. The two psbts must have the same underlying | * Merge psbt into this. The two psbts must have the same underlying | ||||
▲ Show 20 Lines • Show All 244 Lines • Show Last 20 Lines |