dagurval / electrum-cash-protocol

Electrum Cash protocol reference
MIT License
9 stars 6 forks source link

Behaviour when subscribing and already subscribed #10

Open dagurval opened 4 years ago

dagurval commented 4 years ago

Ah yeah that makes sense. And I believe right now it actually complains that you're already subscribed, right? IIRC...

Originally posted by @cculianu in https://github.com/dagurval/electrum-cash-protocol/issues/9#issuecomment-588154551

I don't know, we should define this

cculianu commented 4 years ago

I just checked both EX and Fulcrum just return the result again of the tip, basically, without doing anything extra. (i.e. you cannot be subscribed twice and get 2x the notifications -- you still get 1 notification per new header).

I guess the tip call is not strictly necessary although the spurious notifications-as-a-side-effect of subscribe can confuse simple scripts (which would be an argument in favor of the tip call).

We should define this as above I would say.. to save me having to both update EX and Fulcrum.. and to avoid having to check if any clients in the wild "depend" on the current behavior. I hope Electrs doesn't do anything too much different.

If it does, and you don't want to update it -- we can also define it as "maybe returns headers, maybe not". I'm ok with that too. :)

dagurval commented 4 years ago

I just checked both EX and Fulcrum just return the result again of the tip, basically, without doing anything extra. (i.e. you cannot be subscribed twice and get 2x the notifications -- you still get 1 notification per new header).

Sounds good to me, we can just define it as that, thanks for checking :-)