packages feed

haskoin-store 0.64.16 → 0.64.17

raw patch · 3 files changed

+15/−6 lines, 3 filesdep ~haskoin-store-dataPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: haskoin-store-data

API changes (from Hackage documentation)

Files

CHANGELOG.md view
@@ -4,6 +4,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html) +## 0.64.17+### Fixed+- Add change addresses to cache when necessary.+ ## 0.64.16 ### Fixed - Correct fee calculation for blocks that do not claim all rewards.
haskoin-store.cabal view
@@ -5,7 +5,7 @@ -- see: https://github.com/sol/hpack  name:           haskoin-store-version:        0.64.16+version:        0.64.17 synopsis:       Storage and index for Bitcoin and Bitcoin Cash description:    Please see the README on GitHub at <https://github.com/haskoin/haskoin-store#readme> category:       Bitcoin, Finance, Network@@ -60,7 +60,7 @@     , hashable >=1.3.0.0     , haskoin-core >=0.21.1     , haskoin-node >=0.17.0-    , haskoin-store-data ==0.64.16+    , haskoin-store-data ==0.64.17     , hedis >=0.12.13     , http-types >=0.12.3     , lens >=4.18.1@@ -116,7 +116,7 @@     , haskoin-core >=0.21.1     , haskoin-node >=0.17.0     , haskoin-store-    , haskoin-store-data ==0.64.16+    , haskoin-store-data ==0.64.17     , hedis >=0.12.13     , http-types >=0.12.3     , lens >=4.18.1@@ -177,7 +177,7 @@     , haskoin-core >=0.21.1     , haskoin-node >=0.17.0     , haskoin-store-    , haskoin-store-data ==0.64.16+    , haskoin-store-data ==0.64.17     , hedis >=0.12.13     , hspec >=2.7.1     , http-types >=0.12.3
src/Haskoin/Store/Cache.hs view
@@ -1440,8 +1440,10 @@ addrsToAdd :: KeyIndex -> [XPubBal] -> AddressXPub -> [(Address, AddressXPub)] addrsToAdd gap xbals addrinfo   | null fbals = []+  | not haschange = zipWith f addrs list <> zipWith f changeaddrs changelist   | otherwise = zipWith f addrs list   where+    haschange = any ((== 1) . head . xPubBalPath) xbals     f a p = (a, AddressXPub {addressXPubSpec = xpub, addressXPubPath = p})     dchain = head (addressXPubPath addrinfo)     fbals = filter ((== dchain) . head . xPubBalPath) xbals@@ -1453,10 +1455,13 @@         then [maxidx + 1 .. aidx + gap]         else []     paths = map (Deriv :/ dchain :/) ixs-    keys = map (\p -> derivePubPath p (xPubSpecKey xpub)) paths+    keys = map (\p -> derivePubPath p (xPubSpecKey xpub))     list = map pathToList paths     xpubf = xPubAddrFunction (xPubDeriveType xpub)-    addrs = map xpubf keys+    addrs = map xpubf (keys paths)+    changepaths = map (Deriv :/ 1 :/) [0 .. gap]+    changeaddrs = map xpubf (keys changepaths)+    changelist = map pathToList changepaths  sortTxData :: [TxData] -> [TxData] sortTxData tds =