mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 23:24:27 +01:00
gossipd: don't mark channels unroutable.
For transient failures, the pay plugin should simply exclude those from route considerations. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
committed by
Christian Decker
parent
018a3f1d58
commit
4eddf57fd9
@@ -112,7 +112,6 @@ static unsigned gossip_msg(struct subd *gossip, const u8 *msg, const int *fds)
|
||||
case WIRE_GOSSIP_GET_TXOUT_REPLY:
|
||||
case WIRE_GOSSIP_OUTPOINT_SPENT:
|
||||
case WIRE_GOSSIP_ROUTING_FAILURE:
|
||||
case WIRE_GOSSIP_MARK_CHANNEL_UNROUTABLE:
|
||||
case WIRE_GOSSIP_QUERY_SCIDS:
|
||||
case WIRE_GOSSIP_QUERY_CHANNEL_RANGE:
|
||||
case WIRE_GOSSIP_SEND_TIMESTAMP_FILTER:
|
||||
|
||||
@@ -394,31 +394,6 @@ remote_routing_failure(const tal_t *ctx,
|
||||
return routing_failure;
|
||||
}
|
||||
|
||||
static void random_mark_channel_unroutable(struct log *log,
|
||||
struct subd *gossip,
|
||||
struct short_channel_id *route_channels)
|
||||
{
|
||||
size_t num_channels = tal_count(route_channels);
|
||||
size_t i;
|
||||
const struct short_channel_id *channel;
|
||||
u8 *msg;
|
||||
assert(num_channels != 0);
|
||||
|
||||
/* Select one channel by random. */
|
||||
randombytes_buf(&i, sizeof(i));
|
||||
i = i % num_channels;
|
||||
channel = &route_channels[i];
|
||||
|
||||
log_debug(log,
|
||||
"Disable randomly %dth channel (%s) along route "
|
||||
"(guessing due to bad reply)",
|
||||
(int) i,
|
||||
type_to_string(tmpctx, struct short_channel_id,
|
||||
channel));
|
||||
msg = towire_gossip_mark_channel_unroutable(tmpctx, channel);
|
||||
subd_send_msg(gossip, msg);
|
||||
}
|
||||
|
||||
static void report_routing_failure(struct log *log,
|
||||
struct subd *gossip,
|
||||
struct routing_failure *fail)
|
||||
@@ -535,10 +510,6 @@ void payment_failed(struct lightningd *ld, const struct htlc_out *hout,
|
||||
tal_hex(tmpctx, hout->failuremsg));
|
||||
/* Cannot report failure. */
|
||||
fail = NULL;
|
||||
/* Select a channel to mark unroutable by random */
|
||||
random_mark_channel_unroutable(hout->key.channel->log,
|
||||
ld->gossip,
|
||||
payment->route_channels);
|
||||
/* Can now retry; we selected a channel to mark
|
||||
* unroutable by random */
|
||||
retry_plausible = true;
|
||||
|
||||
Reference in New Issue
Block a user