fixed bitcoin #3162 bitcoin/bitcoin#3162