Skip to content

Commit

Permalink
bug fix in estimateSmartFee
Browse files Browse the repository at this point in the history
  • Loading branch information
GambolingPangolin committed Mar 11, 2019
1 parent fce34a3 commit d5886eb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Network/Bitcoin/Wallet.hs
Original file line number Diff line number Diff line change
Expand Up @@ -770,7 +770,7 @@ instance ToJSON EstimationMode where
-- | Estimate the fee per kb to send a transaction
estimateSmartFee :: Client -> Word32 -> Maybe EstimationMode -> IO Double
estimateSmartFee client target mode =
parse <$> callApi client "estimatesmartfee" (catMaybes [ Just $ tj target, tj <$> mode ])
parse =<< callApi client "estimatesmartfee" (catMaybes [ Just $ tj target, tj <$> mode ])
where
parse = either (throw . BitcoinResultTypeError . BSL8.pack) id . parseEither parseResp
parse = either (throw . BitcoinResultTypeError . BSL8.pack) pure . parseEither parseResp
parseResp = withObject "estimatesmartfee response" (.: "feerate")

0 comments on commit d5886eb

Please sign in to comment.