boltlabs-inc / zeekoe

Zero-knowledge layer-2 payment channels
MIT License
24 stars 1 forks source link

Remove automatic renaming of channels upon creation #265 #307

Closed gijsvl closed 3 years ago

DariusParvin commented 3 years ago

Good points @marsella. Checking for a duplicate name as early as possible probably makes sense, but probably not a big deal for now?

Overall though I think it's better that we prevent the same label being used rather than renaming. The reason I stumbled into the issue was because when I was running tests, I was using the same channel label across channels. What would happen is that it would establish the channels fine but then sometimes fail on pay. It seemed like pay failed, but actually it was because it was trying to pay on the first channel which had closed by then.

Another way I think about it is that the user should never intentionally try to create a channel with the same name, so it's better to abort.

The PR looks good to me. I tested the PR and it worked. Creating another channel with the same name returned the helpful error message.