File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed
main/scala/fr/acinq/eclair/wire/protocol Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -309,6 +309,7 @@ object OfferTypes {
309309 def validate (records : TlvStream [OfferTlv ]): Either [InvalidTlvPayload , Offer ] = {
310310 if (records.get[OfferDescription ].isEmpty && records.get[OfferAmount ].nonEmpty) return Left (MissingRequiredTlv (UInt64 (10 )))
311311 if (records.get[OfferNodeId ].isEmpty && records.get[OfferPaths ].forall(_.paths.isEmpty)) return Left (MissingRequiredTlv (UInt64 (22 )))
312+ if (records.get[OfferCurrency ].nonEmpty && records.get[OfferAmount ].isEmpty) return Left (MissingRequiredTlv (UInt64 (8 )))
312313 if (records.unknown.exists(! isOfferTlv(_))) return Left (ForbiddenTlv (records.unknown.find(! isOfferTlv(_)).get.tag))
313314 Right (Offer (records))
314315 }
Original file line number Diff line number Diff line change 578578 "valid" : false ,
579579 "bolt12" : " lno1pqpzwyqkyypwa3eyt44h6txtxquqh7lz5djge4afgfjn7k4rgrkuag0jsd5xvxg"
580580 },
581+ {
582+ "description" : " Missing offer_amount with offer_currency" ,
583+ "valid" : false ,
584+ "bolt12" : " lno1qcp4256ypgx9getnwss8vetrw3hhyuckyypwa3eyt44h6txtxquqh7lz5djge4afgfjn7k4rgrkuag0jsd5xvxg"
585+ },
581586 {
582587 "description" : " Missing offer_issuer_id and no offer_path" ,
583588 "valid" : false ,
You can’t perform that action at this time.
0 commit comments