refactor for density and clarity
(grafted from 7cb1c075b59f)
handle nacks when waiting for confirms

(grafted from 1ecd52982198)