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.
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 likepay
failed, but actually it was because it was trying topay
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.