Open irriden opened 1 year ago
Should address #105
I think I've addressed point 2 here: 9f5be6f
Now wondering if instead of ReceiveOnly
and ReceiveSend
we should have three independent bit flags so to speak - Signer
, Receive
, Send
.
ReceiveOnly
would have Signer
and Receive
set.
ReceiveSend
would have Signer
, Send
, and Receive
set.
And if you wanted a message to be signed by any signer, you would only set Signer
.
This could help get rid of these weird cases where the signer type is set to None maybe? Haven't looked closely.
To be honest i think ReceiveOnly and ReceiveSend is simpler to understand
This passes the following test:
Two signers connected to broker. One is
ReceiveSend
, the other isReceiveOnly
.First send some keysends to the node, with
ReceiveOnly
settling them.Then send a keysend to the other way, from the node to a peer.
Broker immediately switches to the
ReceiveSend
signer, syncs the state, and sends the keysend.It's all about watching for
PreapproveKeysend
andPreapproveInvoice
messages, and switching to the appropriateReceiveSend
signer when these come through.Watching for on-chain sends still todo.