From 9755eb8292ee51148f4ebbbc7bfcfdb67bac5248 Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Fri, 9 Dec 2016 16:55:55 +1300 Subject: [PATCH] Add JS to second block to ensure witnesses are incremented --- src/zcbenchmarks.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/zcbenchmarks.cpp b/src/zcbenchmarks.cpp index 8f324850b..decc33f35 100644 --- a/src/zcbenchmarks.cpp +++ b/src/zcbenchmarks.cpp @@ -274,6 +274,20 @@ double benchmark_increment_note_witnesses(size_t nTxs) // Second block CBlock block2; block2.hashPrevBlock = block1.GetHash(); + { + auto wtx = GetValidReceive(*pzcashParams, sk, 10, true); + auto note = GetNote(*pzcashParams, sk, wtx, 0, 1); + auto nullifier = note.nullifier(sk); + + mapNoteData_t noteData; + JSOutPoint jsoutpt {wtx.GetHash(), 0, 1}; + CNoteData nd {sk.address(), nullifier}; + noteData[jsoutpt] = nd; + + wtx.SetNoteData(noteData); + wallet.AddToWallet(wtx, true, NULL); + block2.vtx.push_back(wtx); + } CBlockIndex index2(block2); index2.nHeight = 2;