Merge #669: Disallow issuance-stuffing in tx deserialization

8a3d622 Disallow issuance-stuffing in tx deserialization (Gregory Sanders)

Pull request description:

  This is not a consensus change, as "honest" serialization for size/txid purposes will not include these, and only the amounts fields are used in "balance" checking later.

Tree-SHA512: b50e42c002cf0fc8619e2a946ece34ce69133a2a196397d578ca70425f068dc74a4754b5064ee5df67df0faf898da997caeb53f15ff04904b7e6d7361d01a57f
This commit is contained in:
Gregory Sanders 2019-07-02 11:44:54 -04:00
commit 9bc016f460
No known key found for this signature in database
GPG key ID: F3F68E2D86A48FDB

View file

@ -212,6 +212,9 @@ public:
// The asset fields are deserialized only if they are present.
if (fHasAssetIssuance) {
READWRITE(assetIssuance);
if (assetIssuance.IsNull()) {
throw std::ios_base::failure("Superfluous issuance record");
}
} else if (ser_action.ForRead()) {
assetIssuance.SetNull();
}