From 05f1d6c89afb353ce0c6c42dfc0f74dac7e6cd52 Mon Sep 17 00:00:00 2001 From: Alex Akselrod Date: Fri, 17 Apr 2015 14:20:39 -0400 Subject: [PATCH] Change parseTxAcceptedNtfnParams to accept a float64 returned by btcd. --- notify.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/notify.go b/notify.go index 29be70b3..f40bc6d1 100644 --- a/notify.go +++ b/notify.go @@ -525,9 +525,15 @@ func parseTxAcceptedNtfnParams(params []json.RawMessage) (*wire.ShaHash, return nil, 0, err } - // Unmarshal second parameter as an integer. - var amt int64 - err = json.Unmarshal(params[1], &amt) + // Unmarshal second parameter as a floating point number. + var famt float64 + err = json.Unmarshal(params[1], &famt) + if err != nil { + return nil, 0, err + } + + // Bounds check amount. + amt, err := btcutil.NewAmount(famt) if err != nil { return nil, 0, err }