Check for requesting items when creating an offer (#10864)

This commit is contained in:
Matt Hauff 2022-03-24 09:45:32 -07:00 committed by GitHub
parent 2eb4fdeaee
commit 06d160d0a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -94,6 +94,8 @@ class Offer:
offered_coins: Dict[bytes32, List[Coin]] = self.get_offered_coins()
if offered_coins == {}:
raise ValueError("Bundle is not offering anything")
if self.get_requested_payments() == {}:
raise ValueError("Bundle is not requesting anything")
# Verify that there are no duplicate payments
for payments in self.requested_payments.values():