fix error in scriptpubkey cache
add test for backwars compat
Merge pull request #127 from matiu/bug/cache01

Bug/cache01