From 75407c6872439da88517e1707d243d25565c0291 Mon Sep 17 00:00:00 2001 From: Simon Date: Thu, 20 Oct 2016 17:03:57 -0700 Subject: [PATCH 1/2] Fix issue where z_sendmany is too strict and does not allow integer based amount e.g. 1 which is the same as 1.0 --- src/wallet/rpcwallet.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 4d6608570..8e80400e2 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -3222,8 +3222,6 @@ Value z_sendmany(const Array& params, bool fHelp) throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid parameter, expected object"); const Object& o = output.get_obj(); - RPCTypeCheck(o, boost::assign::map_list_of("address", str_type)("amount", real_type)); - // sanity check, report error if unknown key-value pairs for (const Pair& p : o) { std::string s = p.name_; From 5eed758493dda80b7d70e6b955db87c0248b4b19 Mon Sep 17 00:00:00 2001 From: Simon Date: Thu, 20 Oct 2016 17:10:25 -0700 Subject: [PATCH 2/2] Update test to use integer amount as well as decimal amount when calling z_sendmany --- qa/rpc-tests/wallet.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qa/rpc-tests/wallet.py b/qa/rpc-tests/wallet.py index b2a2ee321..08d549d92 100755 --- a/qa/rpc-tests/wallet.py +++ b/qa/rpc-tests/wallet.py @@ -240,7 +240,7 @@ class WalletTest (BitcoinTestFramework): # send node 2 taddr to zaddr recipients = [] - recipients.append({"address":myzaddr, "amount":7.0}) + recipients.append({"address":myzaddr, "amount":7}) myopid = self.nodes[2].z_sendmany(mytaddr, recipients) opids = [] @@ -288,7 +288,7 @@ class WalletTest (BitcoinTestFramework): node2balance = self.nodes[2].getbalance() # 16.99790000 recipients = [] - recipients.append({"address":self.nodes[0].getnewaddress(), "amount":1.0}) + recipients.append({"address":self.nodes[0].getnewaddress(), "amount":1}) recipients.append({"address":self.nodes[2].getnewaddress(), "amount":1.0}) myopid = self.nodes[2].z_sendmany(myzaddr, recipients)