From 159aa37fc0139d298e5f54fc332fc500825dc5f9 Mon Sep 17 00:00:00 2001 From: Simon Date: Wed, 22 Nov 2017 00:02:52 -0800 Subject: [PATCH] Closes #2759. Fixes broken pipe error with QA test wallet.py. --- qa/rpc-tests/wallet.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/qa/rpc-tests/wallet.py b/qa/rpc-tests/wallet.py index 9b91c803d..12dfac0e4 100755 --- a/qa/rpc-tests/wallet.py +++ b/qa/rpc-tests/wallet.py @@ -271,6 +271,16 @@ class WalletTest (BitcoinTestFramework): for i in xrange(0,num_t_recipients): newtaddr = self.nodes[2].getnewaddress() recipients.append({"address":newtaddr, "amount":amount_per_recipient}) + + # Issue #2759 Workaround START + # HTTP connection to node 0 may fall into a state, during the few minutes it takes to process + # loop above to create new addresses, that when z_sendmany is called with a large amount of + # rpc data in recipients, the connection fails with a 'broken pipe' error. Making a RPC call + # to node 0 before calling z_sendmany appears to fix this issue, perhaps putting the HTTP + # connection into a good state to handle a large amount of data in recipients. + self.nodes[0].getinfo() + # Issue #2759 Workaround END + try: self.nodes[0].z_sendmany(myzaddr, recipients) except JSONRPCException,e: @@ -288,6 +298,11 @@ class WalletTest (BitcoinTestFramework): for i in xrange(0,num_z_recipients): newzaddr = self.nodes[2].z_getnewaddress() recipients.append({"address":newzaddr, "amount":amount_per_recipient}) + + # Issue #2759 Workaround START + self.nodes[0].getinfo() + # Issue #2759 Workaround END + try: self.nodes[0].z_sendmany(myzaddr, recipients) except JSONRPCException,e: