Fix PSBT deserialization of 0-input transactions

0-input transactions can be ambiguously deserialized as being witness
transactions. Since the unsigned transaction is never serialized as
a witness transaction as it has no witnesses, we should always
deserialize it as a non-witness transaction and set the serialization
flags as such.

Also always serialize the unsigned transaction as a non-witness transaction.
This commit is contained in:
Andrew Chow
2018-08-13 14:59:31 -07:00
parent f87d0a9d75
commit 43811e6338
3 changed files with 8 additions and 3 deletions

View File

@@ -61,6 +61,7 @@ public:
int GetVersion() const { return nVersion; }
int GetType() const { return nType; }
size_t size() const { return stream->size(); }
};
template<typename S>