From 36d4ae08e87e227efae5997664ff652ebc7fdbe2 Mon Sep 17 00:00:00 2001 From: wakiyamap Date: Fri, 14 Aug 2020 17:46:02 +0900 Subject: [PATCH] Fix monetary unit --- rpcserver.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpcserver.go b/rpcserver.go index 89817db8..6d684451 100644 --- a/rpcserver.go +++ b/rpcserver.go @@ -543,7 +543,7 @@ func handleCreateRawTransaction(s *rpcServer, cmd interface{}, closeChan <-chan params := s.cfg.ChainParams for encodedAddr, amount := range c.Amounts { // Ensure amount is in the valid range for monetary amounts. - if amount <= 0 || amount > btcutil.MaxSatoshi { + if amount <= 0 || amount*btcutil.SatoshiPerBitcoin > btcutil.MaxSatoshi { return nil, &btcjson.RPCError{ Code: btcjson.ErrRPCType, Message: "Invalid amount",