ames: prevent crashes when corking an alien flow

The +on-cork handler asserts that the peer is known to us. This is the
incorrect behaviour, because it will crash when corking a flow to a peer
that is still an %alien. This can happen, for instance, when making a
gall subscription for the first time and then corking it before the
alien naturalises.
This commit is contained in:
Liam Fitzgerald 2022-11-01 15:50:10 +10:00
parent 7940dd442b
commit 26aac7581a

View File

@ -1778,8 +1778,9 @@
|= =ship
^+ event-core
=/ ship-state (~(get by peers.ames-state) ship)
::
?> ?=([~ %known *] ship-state)
:: XX: should go in alien-agenda maybe?
?. ?=([~ %known *] ship-state)
event-core
=/ =peer-state +.u.ship-state
=/ =channel [[our ship] now channel-state -.peer-state]
::