Adjust code to work with unpatched bitcoind

I haven't tested this actually works, but it was trivial to write...