i did some reading of tm code and found that currently tm:branch_failure block seems to be handled only by code in t_reply.c. when t_relay() fails there is no reply processing and thus no execution of tm:branch-failure block.
perhaps something similar to t_reply()/run_branch_failure_handlers() could be done in t_send_branch() when sending fails? i'm pretty sure that t->on_branch_failure is set in t_send_branch(). it is thus the matter on getting the corresponding tm:branch_failure block executed.
-- juha