Agreed, #3824's changes to paymentserver.cpp (and paymentserver.h) look like a better answer, presuming they're going to be merged.