Fix monetary unit

This commit is contained in:
wakiyamap 2020-08-14 17:46:02 +09:00 committed by John C. Vernaleo
parent 7d69fb9ba6
commit 36d4ae08e8

View file

@ -543,7 +543,7 @@ func handleCreateRawTransaction(s *rpcServer, cmd interface{}, closeChan <-chan
params := s.cfg.ChainParams params := s.cfg.ChainParams
for encodedAddr, amount := range c.Amounts { for encodedAddr, amount := range c.Amounts {
// Ensure amount is in the valid range for monetary 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{ return nil, &btcjson.RPCError{
Code: btcjson.ErrRPCType, Code: btcjson.ErrRPCType,
Message: "Invalid amount", Message: "Invalid amount",