payment_identifier: regard BIP21 without address and without bolt11 invalid
This commit is contained in:
@@ -266,6 +266,10 @@ class PaymentIdentifier(Logger):
|
|||||||
self.bolt11.outputs = [PartialTxOutput.from_address_and_value(bip21_address, amount)]
|
self.bolt11.outputs = [PartialTxOutput.from_address_and_value(bip21_address, amount)]
|
||||||
except InvoiceError as e:
|
except InvoiceError as e:
|
||||||
self.logger.debug(self._get_error_from_invoiceerror(e))
|
self.logger.debug(self._get_error_from_invoiceerror(e))
|
||||||
|
elif not self.bip21.get('address'):
|
||||||
|
# no address and no bolt11, invalid
|
||||||
|
self.set_state(PaymentIdentifierState.INVALID)
|
||||||
|
return
|
||||||
self.set_state(PaymentIdentifierState.AVAILABLE)
|
self.set_state(PaymentIdentifierState.AVAILABLE)
|
||||||
elif self.parse_output(text)[0]:
|
elif self.parse_output(text)[0]:
|
||||||
scriptpubkey, is_address = self.parse_output(text)
|
scriptpubkey, is_address = self.parse_output(text)
|
||||||
|
|||||||
Reference in New Issue
Block a user