Mainline bitcoind

I had to make some very minor adjustments