From 2b2bc69e8cead1431aec3066c694a8f2364a5b61 Mon Sep 17 00:00:00 2001 From: Sean Bowe Date: Sat, 29 Oct 2016 11:53:16 -0600 Subject: [PATCH 1/2] Properly account for joinsplit value when deciding if a transaction should be placed in a mined block. --- src/miner.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/miner.cpp b/src/miner.cpp index bde9babd5..9289a9f63 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -207,6 +207,8 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn) dPriority += (double)nValueIn * nConf; } + nTotalIn += tx.GetJoinSplitValueIn(); + if (fMissingInputs) continue; // Priority is sum(valuein * age) / modified_txsize From 52676958d15987019b4c4b22f4340a33690bc772 Mon Sep 17 00:00:00 2001 From: Sean Bowe Date: Wed, 2 Nov 2016 14:25:07 -0600 Subject: [PATCH 2/2] Test that a pure joinsplit will mine if other transactions are in the mempool. --- qa/rpc-tests/zcjoinsplit.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/qa/rpc-tests/zcjoinsplit.py b/qa/rpc-tests/zcjoinsplit.py index b04345a82..961f3a0a8 100755 --- a/qa/rpc-tests/zcjoinsplit.py +++ b/qa/rpc-tests/zcjoinsplit.py @@ -36,6 +36,14 @@ class JoinSplitTest(BitcoinTestFramework): receive_result = self.nodes[0].zcrawreceive(zcsecretkey, joinsplit_result["encryptednote1"]) assert_equal(receive_result["exists"], True) + # The pure joinsplit we create should be mined in the next block + # despite other transactions being in the mempool. + addrtest = self.nodes[0].getnewaddress() + for xx in range(0,10): + self.nodes[0].generate(1) + for x in range(0,50): + self.nodes[0].sendtoaddress(addrtest, 0.01); + joinsplit_tx = self.nodes[0].createrawtransaction([], {}) joinsplit_result = self.nodes[0].zcrawjoinsplit(joinsplit_tx, {receive_result["note"] : zcsecretkey}, {zcaddress: 39.8}, 0, 0.1)