From 49689a574cdef0d255c2bb4a8096603ee937fd08 Mon Sep 17 00:00:00 2001 From: Simon Date: Fri, 22 Jul 2016 14:09:38 -0700 Subject: [PATCH 01/16] Add GetTxid() which returns a non-malleable txid. --- src/primitives/transaction.cpp | 28 ++++++++++++++++++++++++++++ src/primitives/transaction.h | 7 +++++++ 2 files changed, 35 insertions(+) diff --git a/src/primitives/transaction.cpp b/src/primitives/transaction.cpp index 102a1a33d..510e0b5c5 100644 --- a/src/primitives/transaction.cpp +++ b/src/primitives/transaction.cpp @@ -223,3 +223,31 @@ std::string CTransaction::ToString() const str += " " + vout[i].ToString() + "\n"; return str; } + +// Return a txid which is non-malleable. +// Signature data is cleared before the transaction is serialized and hashed. +uint256 CTransaction::GetTxid() const +{ + // Create a deep copy of this transaction + CMutableTransaction tx(*this); + + // Clear sigscript from all transaction inputs. + for (CTxIn & txIn : tx.vin) { + txIn.scriptSig.clear(); + } + + // Clear joinSplitSig by filling the buffer with zero + tx.joinSplitSig.assign(0); + + // Return double SHA256 hash + return tx.GetHash(); +} + + +// Return a txid which is non-malleable. +uint256 CMutableTransaction::GetTxid() const +{ + CTransaction tx(*this); + return tx.GetTxid(); +} + diff --git a/src/primitives/transaction.h b/src/primitives/transaction.h index a664159b0..0009fcf44 100644 --- a/src/primitives/transaction.h +++ b/src/primitives/transaction.h @@ -373,6 +373,10 @@ public: } std::string ToString() const; + + // Return the txid which is the double SHA256 hash of the transaction. + uint256 GetTxid() const; + }; /** A mutable version of CTransaction. */ @@ -411,6 +415,9 @@ struct CMutableTransaction * fly, as opposed to GetHash() in CTransaction, which uses a cached result. */ uint256 GetHash() const; + + // Compute a non-malleable txid on the fly. + uint256 GetTxid() const; }; #endif // BITCOIN_PRIMITIVES_TRANSACTION_H From a2cf2195816c01b1ccca801a11f19424236aea97 Mon Sep 17 00:00:00 2001 From: Simon Date: Sat, 23 Jul 2016 00:45:38 -0700 Subject: [PATCH 02/16] Update genesis blocks. --- src/chainparams.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/chainparams.cpp b/src/chainparams.cpp index 8de90918d..2349a9e92 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -88,12 +88,12 @@ public: // TODO generate harder genesis block //genesis.nBits = 0x1d00ffff; genesis.nBits = 0x207fffff; - genesis.nNonce = uint256S("0x0000000000000000000000000000000000000000000000000000000000000001"); - genesis.nSolution = {400496, 12965800, 7933378, 26516310, 3573504, 12897574, 9332739, 12534918}; + genesis.nNonce = uint256S("0x0000000000000000000000000000000000000000000000000000000000000000"); + genesis.nSolution = {4237673, 21615556, 16494180, 22743674, 18002967, 22758107, 25855579, 32268516}; consensus.hashGenesisBlock = genesis.GetHash(); - assert(consensus.hashGenesisBlock == uint256S("0x5ff8e250c158c0694814582883343e8a0de5b7e7a5236324d4bf3293a56b6bc5")); - assert(genesis.hashMerkleRoot == uint256S("0x4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b")); + assert(consensus.hashGenesisBlock == uint256S("0x73401d7f5470de6619fd3d469dcfdec7d22f7d2946d3c704e0dfccf9aa868750")); + assert(genesis.hashMerkleRoot == uint256S("0x2a9487e467412bc4b0a993a770bc73d5f4230f0ea5907b3f5df2669f0d7e78c1")); vSeeds.push_back(CDNSSeedData("bitcoin.sipa.be", "seed.bitcoin.sipa.be")); // Pieter Wuille vSeeds.push_back(CDNSSeedData("bluematt.me", "dnsseed.bluematt.me")); // Matt Corallo @@ -158,10 +158,10 @@ public: //! Modify the testnet genesis block so the timestamp is valid for a later start. genesis.nTime = 1296688602; genesis.nBits = 0x207fffff; - genesis.nNonce = uint256S("0x0000000000000000000000000000000000000000000000000000000000000000"); - genesis.nSolution = {830051, 14471730, 2076450, 21556280, 12194645, 22042975, 16221394, 24048626}; + genesis.nNonce = uint256S("0x0000000000000000000000000000000000000000000000000000000000000001"); + genesis.nSolution = {959935, 4504066, 2918279, 21569892, 13720252, 17756975, 14743389, 14769307}; consensus.hashGenesisBlock = genesis.GetHash(); - assert(consensus.hashGenesisBlock == uint256S("0x69675325ac7fb1f5a6bebb7fc8581f9160cbf970817f50b5199df7ff7b2833bd")); + assert(consensus.hashGenesisBlock == uint256S("0x3dfdae8ba1db1b2c449704632d27dda27fbd96eb954b53cd041ad02afd977a3b")); vFixedSeeds.clear(); vSeeds.clear(); @@ -226,11 +226,11 @@ public: nEquihashK = 5; genesis.nTime = 1296688602; genesis.nBits = 0x207fffff; - genesis.nNonce = uint256S("0x0000000000000000000000000000000000000000000000000000000000000003"); - genesis.nSolution = {21, 374, 135, 192, 103, 221, 198, 303, 87, 330, 306, 464, 98, 239, 146, 471, 35, 137, 53, 387, 97, 454, 412, 434, 75, 352, 180, 367, 121, 480, 158, 482}; + genesis.nNonce = uint256S("0x0000000000000000000000000000000000000000000000000000000000000004"); + genesis.nSolution = {26, 109, 273, 377, 31, 150, 145, 379, 57, 324, 271, 442, 129, 186, 217, 448, 76, 165, 224, 325, 120, 250, 329, 497, 78, 307, 410, 491, 184, 414, 301, 479}; consensus.hashGenesisBlock = genesis.GetHash(); nDefaultPort = 18444; - assert(consensus.hashGenesisBlock == uint256S("0x37e57b7047e1a59918a8f98b9bbebc0b6e16e246211ad1f5c664d7e8f7d8d709")); + assert(consensus.hashGenesisBlock == uint256S("0x417aa74a9162c47cb5713d819f01c56919cb063ecbcf1c07c3a9ac3555e2254d")); nPruneAfterHeight = 1000; vFixedSeeds.clear(); //! Regtest mode doesn't have any fixed seeds. From 2b9130cd1ff1de4b4c4c448387f8f31b4386830c Mon Sep 17 00:00:00 2001 From: Simon Date: Sat, 23 Jul 2016 13:28:36 -0700 Subject: [PATCH 03/16] Update precomputed equihash solutions used in test. --- src/test/miner_tests.cpp | 220 +++++++++++++++++++-------------------- 1 file changed, 110 insertions(+), 110 deletions(-) diff --git a/src/test/miner_tests.cpp b/src/test/miner_tests.cpp index adc606aa7..930155225 100644 --- a/src/test/miner_tests.cpp +++ b/src/test/miner_tests.cpp @@ -24,116 +24,116 @@ struct { const char *nonce_hex; uint32_t vSolutions[NUM_EQUIHASH_SOLUTIONS]; } blockinfo[] = { - {"0000000000000000000000000000000000000000000000000000000000000000", {6460681,13237162,7709584,31045419,10285519,17375614,15570856,18802679,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {4561870,17803565,5142864,27252551,4878460,12303443,7865598,11300160,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {1089651,25039626,8810095,9296274,3249918,29008340,24645847,26512131,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {7728372,28861696,9545832,19144166,17556589,24119335,21961452,31035364,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {834238,9184343,13243668,23166288,7981278,26794117,14325463,14669701,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {734172,13569750,3562648,29145860,10283866,23063716,13248910,16359387,}}, - {"0000000000000000000000000000000000000000000000000000000000000002", {1587871,17811157,12023427,21207538,5720315,7856396,7103244,24229710,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {1888147,27449466,13224507,14518313,15963469,22950485,17952156,24720854,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {4302677,18772320,9863528,19410554,12176883,14140896,25924630,26251701,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {197279,32404497,11172719,18080543,15487758,28660859,31764039,32249219,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {4024821,20999820,8894371,30988205,7275560,30827261,9405363,21175857,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {1976935,18657882,12319377,33437938,2895318,8491699,8562465,9766831,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {1205583,22738706,10435172,22796265,16651295,26452611,17851968,21396176,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {4703343,12058656,8341840,9642250,12545365,23735257,29717152,30858347,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {692337,24190308,21647683,23770044,6914318,7096840,20965362,26417921,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {474315,31656164,6219098,28125716,5816881,15195781,13568953,29055883,}}, - {"0000000000000000000000000000000000000000000000000000000000000002", {31517,29912071,8389728,8760739,8901626,26743223,10511308,31784346,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {2869946,23991756,8426881,20564925,5642907,26127833,12441891,22131781,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {5580020,20830652,29410091,32809082,15349511,19331016,18657410,26534999,}}, - {"0000000000000000000000000000000000000000000000000000000000000002", {705535,33235971,1184462,26966580,1849828,26167591,18261528,19642580,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {360784,3620708,15346909,27811152,3736810,12736765,9492651,13418606,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {1229600,7684048,20079597,24040691,10128962,30769642,15215479,21182096,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {1684299,12541147,11247589,28636814,5760908,24056463,13771233,20156600,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {366615,1724571,10566227,11511903,17264833,25873819,22389268,27114210,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {2536004,10826889,5554022,25567653,17117623,27087905,24552584,25213783,}}, - {"0000000000000000000000000000000000000000000000000000000000000002", {1477713,7756450,10956188,18843116,5280035,23926642,21485984,25409801,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {7944879,30703371,18593785,31681620,17003578,23749264,23251318,24362277,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {3151970,16283037,12190544,27031633,16929809,21092626,19126308,20966999,}}, - {"0000000000000000000000000000000000000000000000000000000000000002", {11742805,26242944,23697920,25996586,21500488,31327474,26510314,29943352,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {3474994,10457317,7857597,9399886,3867550,30337263,7069425,9680763,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {4070482,23916700,15699207,32888441,13650427,16462993,13669068,32222979,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {1627610,2703221,25539467,26038173,20347871,22002889,27516372,33238984,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {5468299,20890642,15915944,28896368,5606254,30055314,20185515,26677498,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {4462855,25840162,11275769,25729029,4826227,8562549,17814144,29614168,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {4650460,13427503,11884796,27041814,8349794,29591502,8987422,28994357,}}, - {"0000000000000000000000000000000000000000000000000000000000000002", {2166037,24526315,16259633,18008356,12870736,27719518,18085823,19116447,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {3052277,18769667,10791737,29179500,6365222,25640257,12119977,23834845,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {931226,6222676,1981516,29528857,5526494,6437446,10216785,28915484,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {402336,20565306,1583379,17377951,2444738,20364696,20541200,28451640,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {481364,23732599,3623136,30032932,14778581,29656013,16319804,26087720,}}, - {"0000000000000000000000000000000000000000000000000000000000000004", {673463,14487660,3861111,12772690,12841615,19331262,18127729,25891349,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {2688675,19459330,21829421,33160296,2824435,7396953,21175704,24949453,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {421892,18602015,9591135,12373184,7173347,17694169,7290439,33340580,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {3679946,29187321,20720370,29454078,23815548,28025307,24512609,27027920,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {5915260,18635781,13270767,30532080,12087680,29287028,19295798,24363799,}}, - {"0000000000000000000000000000000000000000000000000000000000000002", {1379380,7806321,2502697,6908506,4744762,14959880,13980259,22137966,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {803408,20975966,1413482,13231173,3839363,23141291,13060405,18560250,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {1947212,33079753,4063708,21246355,11314469,30018165,21961696,31328001,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {6801506,7820458,13124300,19286633,13786873,26395883,24579925,27092845,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {4620414,21545333,24603466,27122394,8013117,19976859,26103775,33462356,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {1370285,27998389,15658264,32386855,13657425,28489219,21379429,27671710,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {1046241,9720078,22270576,31073443,2249489,18541008,3403135,25347615,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {6628384,15347228,7109798,12299310,13621159,18901367,17361405,24566552,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {485899,7175305,13204288,20383108,4291864,25276227,15428198,22075223,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {4576157,29654495,26010900,27823742,10508010,28828381,18751049,19433359,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {334007,24126201,14043036,28663573,12796738,30384031,23762812,32543448,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {1564387,20284844,7145783,29120878,16382945,23659265,24017950,25818664,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {1484737,27983306,17749884,21444188,20800690,30784231,28120163,30053577,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {2865891,27768876,4204802,17130915,11616277,31257628,32536380,33369091,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {1725874,5215139,12692907,19278036,15366567,15828025,21793226,31816514,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {734414,21482967,11953109,25118212,20766944,32456333,25492301,31547478,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {362428,14414265,5075444,27902624,9831174,31212666,13737393,32385081,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {145591,8161454,3423499,6631632,10102448,33473585,23115896,28527903,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {5444772,12807948,22417503,25113898,5895721,31533619,9369957,32708724,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {191145,14692308,10562753,23643852,1755413,2466351,12169279,32286664,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {4217796,23246407,8887845,31695154,10533326,30025673,22206874,32714380,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {1753102,14244174,8640641,9405374,2166463,9756880,20869865,32394445,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {8201850,31499684,11129001,16748109,14515976,24003883,17165759,32317200,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {6917819,32404441,19271143,21516446,15418960,20868981,24923177,28394671,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {321206,26913076,14302151,33448705,7685964,24523233,22925251,29572618,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {2903820,23498516,15828657,20209266,9829797,25536341,28768552,32421544,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {9083532,16515943,25935474,33429629,12792895,14550317,28467194,32688447,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {4996695,29308066,7380272,28823119,14269104,28218529,21486846,26875541,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {228029,9456103,5531810,9109588,3885858,13450710,11493960,23832083,}}, - {"0000000000000000000000000000000000000000000000000000000000000002", {958915,15090644,10493937,26335262,2070393,5579592,18459958,26779385,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {3493559,20210149,7605993,29565780,5511822,15350620,12521491,16673167,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {710976,1160173,1850466,12141940,13492316,15225365,27352064,29101085,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {833211,21378874,6103635,22908955,14126213,17853331,21011902,23341861,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {181919,31623201,16582055,19621754,3411910,25415514,12417425,18284193,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {5204608,22166236,7632269,8411635,10740217,26043175,12647988,26574735,}}, - {"0000000000000000000000000000000000000000000000000000000000000005", {4664139,29955587,14704709,25453965,4905764,29351642,16659156,23751368,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {5074419,30890716,6339326,28953313,9291001,24375735,15257160,21165865,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {190613,10145278,13714746,18808813,1423680,9382947,4269988,10838567,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {504650,14462835,10620156,24205954,15972669,20658502,16300078,23707181,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {7086481,22486367,28908448,28999017,18308207,19251588,25979812,32255764,}}, - {"0000000000000000000000000000000000000000000000000000000000000003", {1172269,3423547,9911856,12439428,8953916,22659976,21037751,30753942,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {3184078,22469134,7580931,10118630,9045686,13673962,11524613,33303343,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {342541,746191,25924366,26107112,9690659,21648096,15916528,18201749,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {582456,27300325,15677298,25818305,2923523,31393258,14404095,22050324,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {10098349,15404997,29705933,31559548,11692299,14511261,15242769,23172215,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {6647678,19913634,25164906,26855602,14666922,20168128,24127251,32531463,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {843691,21167176,4272064,8283965,12764152,21618083,24528474,27375014,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {978668,10447726,18233823,25605427,2261375,2637831,2614534,9252646,}}, - {"0000000000000000000000000000000000000000000000000000000000000002", {1523033,15567854,31485034,31653930,3636244,29609827,9083361,13896638,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {14773161,24406294,20062169,23703412,19849451,25344930,21297766,21606960,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {10100496,12477457,16853659,28087974,18171731,31136212,22832204,25990125,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {531788,29206121,8960854,25889718,3126134,22174191,8498009,30497485,}}, - {"0000000000000000000000000000000000000000000000000000000000000002", {1096424,23770446,8053481,14993175,3764227,10960948,6565175,22844110,}}, - {"0000000000000000000000000000000000000000000000000000000000000002", {6429009,13512960,16148076,24871100,8228201,22446947,25288067,28595618,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {1434391,25515128,14612732,17121094,12948147,15232470,18432774,21355020,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {3262210,13836997,4066552,27432736,10722950,27475484,19851879,33265322,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {2137233,17090519,21817897,23680576,4999337,31859639,19266661,21935793,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {11111617,28095860,19042244,26086616,11348636,11733615,12672763,22722616,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {3028356,33444135,24052719,33236905,5745448,17228696,12238401,17713606,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {3682992,24667486,8936251,20577232,21868711,24392760,25828087,25912226,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {7856263,26873641,8940072,26662014,18323682,23361977,27035850,31048059,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {4788899,18223624,10534029,17985114,14007906,14374373,18385178,32483622,}}, - {"0000000000000000000000000000000000000000000000000000000000000002", {7610807,27213835,11937691,19779229,8510123,27229098,12664187,21714276,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {1108792,32718813,27176467,32141527,9222059,17822217,9907758,25989472,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {1797437,9489520,25931087,27014881,9885952,31932732,10063945,20983975,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {1113402,26940724,29426619,29650324,1651155,28182833,2919013,20269474,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {2541603,14114747,21660764,25879244,5433179,8124465,25666254,26548855,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {11929257,25158964,16095230,24841514,12867411,15686246,25441631,29728310,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {5105680,21328455,16152510,29495600,12443572,24958281,15815721,19841625,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {35834,7761680,14791216,18834970,10322825,29492625,10893714,26525542,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {1102283,26829250,13659455,22864463,3780400,22478846,21827356,30064470,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {2037605,12627800,15388193,32785696,20790459,24445774,23758535,27841410,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {3701973,27733118,20055632,32981287,11852035,23473816,12069611,24241138,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {1239069,7235416,16525930,24221834,17217527,18522923,28626536,33160290,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {257184,24892410,5577177,28973426,3838592,21876018,10548097,32849787,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {594750,25868567,15236813,21639078,695051,6577690,7049607,26122407,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {2953230,27002289,15387579,25612682,19679247,22183247,27483477,29772736,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {14264159,31139880,19405862,22349908,20538800,32612497,22946641,29253443,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {43271,13347426,4967623,27686294,2049029,10643471,26256712,27072023,}}, + {"0000000000000000000000000000000000000000000000000000000000000002", {4264458,5957348,10688362,25520226,5289719,25026457,7796449,22800689,}}, + {"0000000000000000000000000000000000000000000000000000000000000002", {826381,32629643,2098678,20063524,2756556,20471197,7523623,30720049,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {4448010,24132030,18245842,18676702,5480533,22770981,6876675,13164821,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {3619321,9958701,24513456,30709357,6570637,29783605,12349463,19460957,}}, + {"0000000000000000000000000000000000000000000000000000000000000003", {3338352,22879126,22388799,28738999,6338378,26770353,11615580,32570967,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {583162,28968143,8506860,10059788,1382777,17695787,7898822,28735790,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {689723,33265955,4951038,26417615,2878474,15296534,17067304,23912090,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {13387048,24067520,19933907,26756676,25442786,31637164,25467610,28623833,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {1082504,8652408,9758889,10565277,2825000,24483755,8669404,26856495,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {832465,1290760,8314106,21253530,7392507,18386499,17437969,17897762,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {402809,14238247,8846864,15628890,1394254,25476988,9768531,20445018,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {4724342,31383028,17023768,33283980,5666748,16675392,21273019,24165352,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {3671473,32986995,19868903,33549652,7343386,19607857,11053667,30367575,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {3776234,23322341,13313550,32344754,10577747,13162296,26428875,26771723,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {243097,14613552,5611701,6484778,5891882,23132752,8395009,22156516,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {21983,28268666,9568230,19429881,6008006,24008050,20887568,30451447,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {3238065,9482522,10764938,25814521,6563812,8831677,10735823,21915536,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {799412,3035304,15262733,26884054,1434085,10521995,16124208,28240181,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {3710111,16217715,18716479,21610969,21762189,23363300,22420670,24987885,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {172576,26167943,14646569,28316841,10493579,28798168,20021148,30720082,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {8420872,31076256,22609922,24941675,15649275,31768823,27195092,27455312,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {2635709,28723033,19580012,22376948,11090157,15926084,17679411,24519876,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {1753128,10357146,2144657,23878125,5910904,9054774,7382210,24872417,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {2453644,32518876,5369995,25186399,12698634,21512754,20357931,32882156,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {8829271,26693212,14001925,27298324,11910802,12882699,13181357,14940933,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {1679170,31059898,6265694,10641735,12015435,23038105,19962212,28620913,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {2643519,33504705,4356599,17500202,9172412,21700003,15721847,33350879,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {2807039,33438306,19754745,32233210,15667749,20376362,18620055,28064823,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {3281486,27251459,14067966,23523487,8259568,22590380,13893561,28476964,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {946954,5651933,12745771,23620660,1348853,30591707,18939991,26188704,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {1194714,20322323,21075964,26871057,2565364,4491315,8937294,22653696,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {637235,3860119,19707990,20376031,13004891,30800108,13847285,27717772,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {3234016,30828372,12722347,24300538,6920497,19090937,7198341,13648746,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {621868,31862815,4019117,8337759,19276345,22342537,30559974,30941776,}}, + {"0000000000000000000000000000000000000000000000000000000000000003", {1732075,20994666,6155543,25866809,3635886,22477080,5123596,13432247,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {2204518,20921515,12777053,25132755,5063934,14554392,10702268,29914364,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {6406067,20218961,20634617,28827338,11295835,16458724,18683265,31436074,}}, + {"0000000000000000000000000000000000000000000000000000000000000004", {7878007,21165294,8071789,31641431,8904023,17259094,10000563,31794352,}}, + {"0000000000000000000000000000000000000000000000000000000000000006", {5750028,25950324,14832510,30742754,19289275,33373074,19551765,30334371,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {785374,3657166,13462872,17039025,841360,21122444,3591794,8663192,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {6663135,16014329,8015567,27532870,8214530,20513665,14329688,20074961,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {10420672,15431588,30669813,32122115,16834934,23685740,17373413,31595830,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {1738923,3877533,5126100,15281834,6162636,24311468,15242152,24469387,}}, + {"0000000000000000000000000000000000000000000000000000000000000002", {3729011,33320159,26077521,26772495,12079870,20340043,18905055,20848710,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {1899782,12613196,7447739,12133044,6983605,21589090,28189402,28320756,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {3684861,24853041,27961196,32686824,6336696,29822601,7668660,16571990,}}, + {"0000000000000000000000000000000000000000000000000000000000000002", {4325123,10679550,7352744,15939111,20554616,27073737,26855425,31062910,}}, + {"0000000000000000000000000000000000000000000000000000000000000002", {6287964,21839182,8649920,14421276,10805018,12118354,12085375,17757398,}}, + {"0000000000000000000000000000000000000000000000000000000000000002", {9517507,20768654,17832112,32506789,16973867,29314279,19522774,31882006,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {4593507,11801862,22776242,27239522,5315575,32178272,19359679,29246067,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {70220,9824590,8585166,32653223,2471066,32929905,28303302,30995340,}}, + {"0000000000000000000000000000000000000000000000000000000000000002", {2112329,13887696,8915094,9388164,2979335,18058216,6638144,7655413,}}, + {"0000000000000000000000000000000000000000000000000000000000000002", {1598751,18664509,3464189,26549834,14569725,21446311,17294910,17945457,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {7407097,11289078,17774594,26390835,12546942,13428469,13407054,25035467,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {2381661,12510873,4702134,8667532,17569183,30421813,19155815,22067174,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {269914,9618692,314041,2748558,8267376,27166809,19380913,22511695,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {4539289,7888502,12855014,22139555,5618221,22440563,12938906,13283299,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {8734566,31269742,18087135,28734273,21477794,21932806,24439753,27006766,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {1188262,29875085,1555802,17924476,12140044,20111770,25232645,25355017,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {1832397,3831442,13088327,29103907,12436658,30784086,21692723,27401659,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {2199576,12822824,3157494,23072288,5198744,17718433,26926524,32792676,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {6419439,25870304,7393245,18802491,7791936,18552601,9473880,22310729,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {7013069,23660256,16998725,21932905,13990149,25724364,16911298,27581808,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {471581,12203475,2723947,7113047,15786079,24354137,19011625,22309954,}}, + {"0000000000000000000000000000000000000000000000000000000000000002", {8896196,16963078,19359299,32096019,8995579,32939764,9810638,25878351,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {1181248,19238611,3809164,29162138,7154558,12567104,13080848,19703519,}}, + {"0000000000000000000000000000000000000000000000000000000000000003", {3159364,30879003,25864645,28052580,7950194,24790693,16701888,16864466,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {1351562,12572515,1820009,2236616,10623632,13443650,12213300,29122917,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {6395614,31532576,7311043,10903613,15213720,21843676,24512158,30509942,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {6477837,27167216,10603653,31769971,9994098,10362636,13678858,20335701,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {10221363,31336574,14990834,18930315,11237243,19825663,19539543,32836293,}}, + {"0000000000000000000000000000000000000000000000000000000000000002", {4367295,26169439,17762319,25998417,9130819,26381016,17089620,33519140,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {4613517,6512918,24599762,26414995,12681444,18904943,17798602,31427364,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {3860451,17465681,12090048,25390051,9715631,26138619,15482251,25481590,}}, + {"0000000000000000000000000000000000000000000000000000000000000003", {784501,11148617,8619935,12096717,19509386,30494905,20301666,25869317,}}, + {"0000000000000000000000000000000000000000000000000000000000000004", {15985863,17262436,29269412,30002853,23454792,31616235,30450428,32986536,}}, + {"0000000000000000000000000000000000000000000000000000000000000004", {9262794,31375100,19724049,31709447,11614400,21767376,12567350,27208647,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {1930259,27620340,9374147,16209672,12127207,15790862,18749713,24745295,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {2037675,14809883,2478700,3880212,4322485,32315203,12270271,16346556,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {117986,8138393,9924260,20860963,4853158,13921015,10507877,17593395,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {11692683,14336396,22099757,23606002,23949189,25590567,24622458,29590174,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {3043651,6225687,17084299,32798569,3588547,5990245,19014563,24645345,}}, + {"0000000000000000000000000000000000000000000000000000000000000002", {568573,17369049,11024897,21817275,3636340,13669739,13852461,23632810,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {2363919,17767456,14656543,28392801,12503350,16087276,13869110,31665137,}}, + {"0000000000000000000000000000000000000000000000000000000000000002", {2199578,6335833,6936547,24494327,6477788,29903938,15516514,31970217,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {10830339,25496585,13882123,33083752,15548721,31652248,19757093,21446046,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {374835,17320644,27040413,32847830,7963957,12019127,12706216,22517651,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {2609477,6610225,19929451,26914203,13981212,26886006,16125588,25033208,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {9363335,29523412,28912941,29371268,16114010,28531419,20059905,28948000,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {3391197,19317083,15555354,32678769,5616378,18941218,14472636,15965627,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {3715073,28701443,13820848,27234602,4891795,9601840,23734794,25942841,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {3971271,14389739,12618800,28651336,13312973,15535545,24816839,29576036,}}, + {"0000000000000000000000000000000000000000000000000000000000000002", {2144617,32079731,14138184,14863508,5648295,15898822,13407115,26261273,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {8688716,28058207,9670766,27031282,10808709,20387419,23177453,30815061,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {2156330,19076434,5724654,8006651,2841915,3402602,21290399,26647339,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {40417,20280746,10776364,31468848,2879925,21985288,27692340,31524552,}}, }; // NOTE: These tests rely on CreateNewBlock doing its own self-validation! From b742003ee9e40e925cdaf532c77897e66d1228b8 Mon Sep 17 00:00:00 2001 From: Simon Date: Sun, 24 Jul 2016 00:56:15 -0700 Subject: [PATCH 04/16] Update block and tx data used in bloom filter tests. --- src/test/bloom_tests.cpp | 155 ++++++++++++++++++++++----------------- 1 file changed, 86 insertions(+), 69 deletions(-) diff --git a/src/test/bloom_tests.cpp b/src/test/bloom_tests.cpp index e99f99226..889c90761 100644 --- a/src/test/bloom_tests.cpp +++ b/src/test/bloom_tests.cpp @@ -113,50 +113,56 @@ BOOST_AUTO_TEST_CASE(bloom_create_insert_key) BOOST_AUTO_TEST_CASE(bloom_match) { - // Random real transaction (b4749f017444b051c44dfd2720e88f314ff94f3dd6d56d40ef65854fcd7fff6b) + // Random zcash transaction (dd5ffaa97eb9327b04fa1a73cf2af28e81527b6ad612d728840a7ae3c1093803) CTransaction tx; - CDataStream stream(ParseHex("01000000010b26e9b7735eb6aabdf358bab62f9816a21ba9ebdb719d5299e88607d722c190000000008b4830450220070aca44506c5cef3a16ed519d7c3c39f8aab192c4e1c90d065f37b8a4af6141022100a8e160b856c2d43d27d8fba71e5aef6405b8643ac4cb7cb3c462aced7f14711a0141046d11fee51b0e60666d5049a9101a72741df480b96ee26488a4d3466b95c9a40ac5eeef87e10a5cd336c19a84565f80fa6c547957b7700ff4dfbdefe76036c339ffffffff021bff3d11000000001976a91404943fdd508053c75000106d3bc6e2754dbcff1988ac2f15de00000000001976a914a266436d2965547608b9e15d9032a7b9d64fa43188ac00000000"), SER_DISK, CLIENT_VERSION); + CDataStream stream(ParseHex("0100000001d49715970a6b5c491f1d874011973df322a27453e2fdb5a507829893fce22a69000000006a47304402201cfc09e6cfd278289e7312494dfe08be0d18346dc4283e8a78f18a6d8a124556022014042b86888110791bfd95d67c0a88986f2ad24f892d8088f82bc87b88d3bdb1012103a990a2a91a478d867e09e0ce9d48df3e3220423e057e6442dacf7bce14bb29dfffffffff01f0490200000000001976a9144816c219a422243b154337c56562f07ad6ff404d88ac00000000"), SER_DISK, CLIENT_VERSION); stream >> tx; - // and one which spends it (e2769b09e784f32f62ef849763d4f45b98e07ba658647343b915ff832b110436) - unsigned char ch[] = {0x01, 0x00, 0x00, 0x00, 0x01, 0x6b, 0xff, 0x7f, 0xcd, 0x4f, 0x85, 0x65, 0xef, 0x40, 0x6d, 0xd5, 0xd6, 0x3d, 0x4f, 0xf9, 0x4f, 0x31, 0x8f, 0xe8, 0x20, 0x27, 0xfd, 0x4d, 0xc4, 0x51, 0xb0, 0x44, 0x74, 0x01, 0x9f, 0x74, 0xb4, 0x00, 0x00, 0x00, 0x00, 0x8c, 0x49, 0x30, 0x46, 0x02, 0x21, 0x00, 0xda, 0x0d, 0xc6, 0xae, 0xce, 0xfe, 0x1e, 0x06, 0xef, 0xdf, 0x05, 0x77, 0x37, 0x57, 0xde, 0xb1, 0x68, 0x82, 0x09, 0x30, 0xe3, 0xb0, 0xd0, 0x3f, 0x46, 0xf5, 0xfc, 0xf1, 0x50, 0xbf, 0x99, 0x0c, 0x02, 0x21, 0x00, 0xd2, 0x5b, 0x5c, 0x87, 0x04, 0x00, 0x76, 0xe4, 0xf2, 0x53, 0xf8, 0x26, 0x2e, 0x76, 0x3e, 0x2d, 0xd5, 0x1e, 0x7f, 0xf0, 0xbe, 0x15, 0x77, 0x27, 0xc4, 0xbc, 0x42, 0x80, 0x7f, 0x17, 0xbd, 0x39, 0x01, 0x41, 0x04, 0xe6, 0xc2, 0x6e, 0xf6, 0x7d, 0xc6, 0x10, 0xd2, 0xcd, 0x19, 0x24, 0x84, 0x78, 0x9a, 0x6c, 0xf9, 0xae, 0xa9, 0x93, 0x0b, 0x94, 0x4b, 0x7e, 0x2d, 0xb5, 0x34, 0x2b, 0x9d, 0x9e, 0x5b, 0x9f, 0xf7, 0x9a, 0xff, 0x9a, 0x2e, 0xe1, 0x97, 0x8d, 0xd7, 0xfd, 0x01, 0xdf, 0xc5, 0x22, 0xee, 0x02, 0x28, 0x3d, 0x3b, 0x06, 0xa9, 0xd0, 0x3a, 0xcf, 0x80, 0x96, 0x96, 0x8d, 0x7d, 0xbb, 0x0f, 0x91, 0x78, 0xff, 0xff, 0xff, 0xff, 0x02, 0x8b, 0xa7, 0x94, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x19, 0x76, 0xa9, 0x14, 0xba, 0xde, 0xec, 0xfd, 0xef, 0x05, 0x07, 0x24, 0x7f, 0xc8, 0xf7, 0x42, 0x41, 0xd7, 0x3b, 0xc0, 0x39, 0x97, 0x2d, 0x7b, 0x88, 0xac, 0x40, 0x94, 0xa8, 0x02, 0x00, 0x00, 0x00, 0x00, 0x19, 0x76, 0xa9, 0x14, 0xc1, 0x09, 0x32, 0x48, 0x3f, 0xec, 0x93, 0xed, 0x51, 0xf5, 0xfe, 0x95, 0xe7, 0x25, 0x59, 0xf2, 0xcc, 0x70, 0x43, 0xf9, 0x88, 0xac, 0x00, 0x00, 0x00, 0x00, 0x00}; - vector vch(ch, ch + sizeof(ch) -1); - CDataStream spendStream(vch, SER_DISK, CLIENT_VERSION); + // and one which spends it (071921cd01ec92e2d8e4aaf6bbf395858576b4bd979da9f88a521d1e619d8c8f) + CDataStream spendStream(ParseHex("0100000001033809c1e37a0a8428d712d66a7b52818ef22acf731afa047b32b97ea9fa5fdd000000006b483045022100da3bce63d1c8904bad436f06109ab90a1380c560d21fb2298bb3802d8d3f1206022063c5581894818a5a56a22292fc81efc168eeccd69f5642de612b071f129f90f50121020cdf9b096dc2cd4718a05a3c1fa4d317dff2ab6837e0c2f6fd3988fd84b95524ffffffff01f0490200000000001976a9144816c219a422243b154337c56562f07ad6ff404d88ac00000000"), SER_DISK, CLIENT_VERSION); + + //unsigned char ch[] = {0x01, 0x00, 0x00, 0x00, 0x01, 0x6b, 0xff, 0x7f, 0xcd, 0x4f, 0x85, 0x65, 0xef, 0x40, 0x6d, 0xd5, 0xd6, 0x3d, 0x4f, 0xf9, 0x4f, 0x31, 0x8f, 0xe8, 0x20, 0x27, 0xfd, 0x4d, 0xc4, 0x51, 0xb0, 0x44, 0x74, 0x01, 0x9f, 0x74, 0xb4, 0x00, 0x00, 0x00, 0x00, 0x8c, 0x49, 0x30, 0x46, 0x02, 0x21, 0x00, 0xda, 0x0d, 0xc6, 0xae, 0xce, 0xfe, 0x1e, 0x06, 0xef, 0xdf, 0x05, 0x77, 0x37, 0x57, 0xde, 0xb1, 0x68, 0x82, 0x09, 0x30, 0xe3, 0xb0, 0xd0, 0x3f, 0x46, 0xf5, 0xfc, 0xf1, 0x50, 0xbf, 0x99, 0x0c, 0x02, 0x21, 0x00, 0xd2, 0x5b, 0x5c, 0x87, 0x04, 0x00, 0x76, 0xe4, 0xf2, 0x53, 0xf8, 0x26, 0x2e, 0x76, 0x3e, 0x2d, 0xd5, 0x1e, 0x7f, 0xf0, 0xbe, 0x15, 0x77, 0x27, 0xc4, 0xbc, 0x42, 0x80, 0x7f, 0x17, 0xbd, 0x39, 0x01, 0x41, 0x04, 0xe6, 0xc2, 0x6e, 0xf6, 0x7d, 0xc6, 0x10, 0xd2, 0xcd, 0x19, 0x24, 0x84, 0x78, 0x9a, 0x6c, 0xf9, 0xae, 0xa9, 0x93, 0x0b, 0x94, 0x4b, 0x7e, 0x2d, 0xb5, 0x34, 0x2b, 0x9d, 0x9e, 0x5b, 0x9f, 0xf7, 0x9a, 0xff, 0x9a, 0x2e, 0xe1, 0x97, 0x8d, 0xd7, 0xfd, 0x01, 0xdf, 0xc5, 0x22, 0xee, 0x02, 0x28, 0x3d, 0x3b, 0x06, 0xa9, 0xd0, 0x3a, 0xcf, 0x80, 0x96, 0x96, 0x8d, 0x7d, 0xbb, 0x0f, 0x91, 0x78, 0xff, 0xff, 0xff, 0xff, 0x02, 0x8b, 0xa7, 0x94, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x19, 0x76, 0xa9, 0x14, 0xba, 0xde, 0xec, 0xfd, 0xef, 0x05, 0x07, 0x24, 0x7f, 0xc8, 0xf7, 0x42, 0x41, 0xd7, 0x3b, 0xc0, 0x39, 0x97, 0x2d, 0x7b, 0x88, 0xac, 0x40, 0x94, 0xa8, 0x02, 0x00, 0x00, 0x00, 0x00, 0x19, 0x76, 0xa9, 0x14, 0xc1, 0x09, 0x32, 0x48, 0x3f, 0xec, 0x93, 0xed, 0x51, 0xf5, 0xfe, 0x95, 0xe7, 0x25, 0x59, 0xf2, 0xcc, 0x70, 0x43, 0xf9, 0x88, 0xac, 0x00, 0x00, 0x00, 0x00, 0x00}; + //vector vch(ch, ch + sizeof(ch) -1); + //CDataStream spendStream(vch, SER_DISK, CLIENT_VERSION); + CTransaction spendingTx; spendStream >> spendingTx; CBloomFilter filter(10, 0.000001, 0, BLOOM_UPDATE_ALL); - filter.insert(uint256S("0xb4749f017444b051c44dfd2720e88f314ff94f3dd6d56d40ef65854fcd7fff6b")); + filter.insert(uint256S("0xdd5ffaa97eb9327b04fa1a73cf2af28e81527b6ad612d728840a7ae3c1093803")); BOOST_CHECK_MESSAGE(filter.IsRelevantAndUpdate(tx), "Simple Bloom filter didn't match tx hash"); filter = CBloomFilter(10, 0.000001, 0, BLOOM_UPDATE_ALL); // byte-reversed tx hash - filter.insert(ParseHex("6bff7fcd4f8565ef406dd5d63d4ff94f318fe82027fd4dc451b04474019f74b4")); + filter.insert(ParseHex("033809c1e37a0a8428d712d66a7b52818ef22acf731afa047b32b97ea9fa5fdd")); BOOST_CHECK_MESSAGE(filter.IsRelevantAndUpdate(tx), "Simple Bloom filter didn't match manually serialized tx hash"); filter = CBloomFilter(10, 0.000001, 0, BLOOM_UPDATE_ALL); - filter.insert(ParseHex("30450220070aca44506c5cef3a16ed519d7c3c39f8aab192c4e1c90d065f37b8a4af6141022100a8e160b856c2d43d27d8fba71e5aef6405b8643ac4cb7cb3c462aced7f14711a01")); + filter.insert(ParseHex("304402201cfc09e6cfd278289e7312494dfe08be0d18346dc4283e8a78f18a6d8a124556022014042b86888110791bfd95d67c0a88986f2ad24f892d8088f82bc87b88d3bdb101")); BOOST_CHECK_MESSAGE(filter.IsRelevantAndUpdate(tx), "Simple Bloom filter didn't match input signature"); filter = CBloomFilter(10, 0.000001, 0, BLOOM_UPDATE_ALL); - filter.insert(ParseHex("046d11fee51b0e60666d5049a9101a72741df480b96ee26488a4d3466b95c9a40ac5eeef87e10a5cd336c19a84565f80fa6c547957b7700ff4dfbdefe76036c339")); + filter.insert(ParseHex("03a990a2a91a478d867e09e0ce9d48df3e3220423e057e6442dacf7bce14bb29df")); BOOST_CHECK_MESSAGE(filter.IsRelevantAndUpdate(tx), "Simple Bloom filter didn't match input pub key"); filter = CBloomFilter(10, 0.000001, 0, BLOOM_UPDATE_ALL); - filter.insert(ParseHex("04943fdd508053c75000106d3bc6e2754dbcff19")); + filter.insert(ParseHex("4816c219a422243b154337c56562f07ad6ff404d")); BOOST_CHECK_MESSAGE(filter.IsRelevantAndUpdate(tx), "Simple Bloom filter didn't match output address"); BOOST_CHECK_MESSAGE(filter.IsRelevantAndUpdate(spendingTx), "Simple Bloom filter didn't add output"); + // Need a second output for this. + /* filter = CBloomFilter(10, 0.000001, 0, BLOOM_UPDATE_ALL); filter.insert(ParseHex("a266436d2965547608b9e15d9032a7b9d64fa431")); BOOST_CHECK_MESSAGE(filter.IsRelevantAndUpdate(tx), "Simple Bloom filter didn't match output address"); + */ filter = CBloomFilter(10, 0.000001, 0, BLOOM_UPDATE_ALL); - filter.insert(COutPoint(uint256S("0x90c122d70786e899529d71dbeba91ba216982fb6ba58f3bdaab65e73b7e9260b"), 0)); + filter.insert(COutPoint(uint256S("0x692ae2fc93988207a5b5fde25374a222f33d971140871d1f495c6b0a971597d4"), 0)); BOOST_CHECK_MESSAGE(filter.IsRelevantAndUpdate(tx), "Simple Bloom filter didn't match COutPoint"); filter = CBloomFilter(10, 0.000001, 0, BLOOM_UPDATE_ALL); - COutPoint prevOutPoint(uint256S("0x90c122d70786e899529d71dbeba91ba216982fb6ba58f3bdaab65e73b7e9260b"), 0); + COutPoint prevOutPoint(uint256S("0x692ae2fc93988207a5b5fde25374a222f33d971140871d1f495c6b0a971597d4"), 0); { vector data(32 + sizeof(unsigned int)); memcpy(&data[0], prevOutPoint.hash.begin(), 32); @@ -184,15 +190,15 @@ BOOST_AUTO_TEST_CASE(bloom_match) BOOST_AUTO_TEST_CASE(merkle_block_1) { - // Random real block (0000000000013b8ab2cd513b0261a14096412195a72a0c4827d229dcc7e0f7af) - // With 9 txes + // Random zcash block (0a18aa311b3c81284754677e66e3a78e5390680e54e4d9c1a716a74bf7bdd850) + // With 6 txes CBlock block; - CDataStream stream(ParseHex("0100000090f0a9f110702f808219ebea1173056042a714bad51b916cb6800000000000005275289558f51c9966699404ae2294730c3c9f9bda53523ce50e9b95e558da2fdb261b4d4c86041b0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001ab1bf93000901000000010000000000000000000000000000000000000000000000000000000000000000ffffffff07044c86041b0146ffffffff0100f2052a01000000434104e18f7afbe4721580e81e8414fc8c24d7cfacf254bb5c7b949450c3e997c2dc1242487a8169507b631eb3771f2b425483fb13102c4eb5d858eef260fe70fbfae0ac00000000010000000196608ccbafa16abada902780da4dc35dafd7af05fa0da08cf833575f8cf9e836000000004a493046022100dab24889213caf43ae6adc41cf1c9396c08240c199f5225acf45416330fd7dbd022100fe37900e0644bf574493a07fc5edba06dbc07c311b947520c2d514bc5725dcb401ffffffff0100f2052a010000001976a914f15d1921f52e4007b146dfa60f369ed2fc393ce288ac000000000100000001fb766c1288458c2bafcfec81e48b24d98ec706de6b8af7c4e3c29419bfacb56d000000008c493046022100f268ba165ce0ad2e6d93f089cfcd3785de5c963bb5ea6b8c1b23f1ce3e517b9f022100da7c0f21adc6c401887f2bfd1922f11d76159cbc597fbd756a23dcbb00f4d7290141042b4e8625a96127826915a5b109852636ad0da753c9e1d5606a50480cd0c40f1f8b8d898235e571fe9357d9ec842bc4bba1827daaf4de06d71844d0057707966affffffff0280969800000000001976a9146963907531db72d0ed1a0cfb471ccb63923446f388ac80d6e34c000000001976a914f0688ba1c0d1ce182c7af6741e02658c7d4dfcd388ac000000000100000002c40297f730dd7b5a99567eb8d27b78758f607507c52292d02d4031895b52f2ff010000008b483045022100f7edfd4b0aac404e5bab4fd3889e0c6c41aa8d0e6fa122316f68eddd0a65013902205b09cc8b2d56e1cd1f7f2fafd60a129ed94504c4ac7bdc67b56fe67512658b3e014104732012cb962afa90d31b25d8fb0e32c94e513ab7a17805c14ca4c3423e18b4fb5d0e676841733cb83abaf975845c9f6f2a8097b7d04f4908b18368d6fc2d68ecffffffffca5065ff9617cbcba45eb23726df6498a9b9cafed4f54cbab9d227b0035ddefb000000008a473044022068010362a13c7f9919fa832b2dee4e788f61f6f5d344a7c2a0da6ae740605658022006d1af525b9a14a35c003b78b72bd59738cd676f845d1ff3fc25049e01003614014104732012cb962afa90d31b25d8fb0e32c94e513ab7a17805c14ca4c3423e18b4fb5d0e676841733cb83abaf975845c9f6f2a8097b7d04f4908b18368d6fc2d68ecffffffff01001ec4110200000043410469ab4181eceb28985b9b4e895c13fa5e68d85761b7eee311db5addef76fa8621865134a221bd01f28ec9999ee3e021e60766e9d1f3458c115fb28650605f11c9ac000000000100000001cdaf2f758e91c514655e2dc50633d1e4c84989f8aa90a0dbc883f0d23ed5c2fa010000008b48304502207ab51be6f12a1962ba0aaaf24a20e0b69b27a94fac5adf45aa7d2d18ffd9236102210086ae728b370e5329eead9accd880d0cb070aea0c96255fae6c4f1ddcce1fd56e014104462e76fd4067b3a0aa42070082dcb0bf2f388b6495cf33d789904f07d0f55c40fbd4b82963c69b3dc31895d0c772c812b1d5fbcade15312ef1c0e8ebbb12dcd4ffffffff02404b4c00000000001976a9142b6ba7c9d796b75eef7942fc9288edd37c32f5c388ac002d3101000000001976a9141befba0cdc1ad56529371864d9f6cb042faa06b588ac000000000100000001b4a47603e71b61bc3326efd90111bf02d2f549b067f4c4a8fa183b57a0f800cb010000008a4730440220177c37f9a505c3f1a1f0ce2da777c339bd8339ffa02c7cb41f0a5804f473c9230220585b25a2ee80eb59292e52b987dad92acb0c64eced92ed9ee105ad153cdb12d001410443bd44f683467e549dae7d20d1d79cbdb6df985c6e9c029c8d0c6cb46cc1a4d3cf7923c5021b27f7a0b562ada113bc85d5fda5a1b41e87fe6e8802817cf69996ffffffff0280651406000000001976a9145505614859643ab7b547cd7f1f5e7e2a12322d3788ac00aa0271000000001976a914ea4720a7a52fc166c55ff2298e07baf70ae67e1b88ac00000000010000000586c62cd602d219bb60edb14a3e204de0705176f9022fe49a538054fb14abb49e010000008c493046022100f2bc2aba2534becbdf062eb993853a42bbbc282083d0daf9b4b585bd401aa8c9022100b1d7fd7ee0b95600db8535bbf331b19eed8d961f7a8e54159c53675d5f69df8c014104462e76fd4067b3a0aa42070082dcb0bf2f388b6495cf33d789904f07d0f55c40fbd4b82963c69b3dc31895d0c772c812b1d5fbcade15312ef1c0e8ebbb12dcd4ffffffff03ad0e58ccdac3df9dc28a218bcf6f1997b0a93306faaa4b3a28ae83447b2179010000008b483045022100be12b2937179da88599e27bb31c3525097a07cdb52422d165b3ca2f2020ffcf702200971b51f853a53d644ebae9ec8f3512e442b1bcb6c315a5b491d119d10624c83014104462e76fd4067b3a0aa42070082dcb0bf2f388b6495cf33d789904f07d0f55c40fbd4b82963c69b3dc31895d0c772c812b1d5fbcade15312ef1c0e8ebbb12dcd4ffffffff2acfcab629bbc8685792603762c921580030ba144af553d271716a95089e107b010000008b483045022100fa579a840ac258871365dd48cd7552f96c8eea69bd00d84f05b283a0dab311e102207e3c0ee9234814cfbb1b659b83671618f45abc1326b9edcc77d552a4f2a805c0014104462e76fd4067b3a0aa42070082dcb0bf2f388b6495cf33d789904f07d0f55c40fbd4b82963c69b3dc31895d0c772c812b1d5fbcade15312ef1c0e8ebbb12dcd4ffffffffdcdc6023bbc9944a658ddc588e61eacb737ddf0a3cd24f113b5a8634c517fcd2000000008b4830450221008d6df731df5d32267954bd7d2dda2302b74c6c2a6aa5c0ca64ecbabc1af03c75022010e55c571d65da7701ae2da1956c442df81bbf076cdbac25133f99d98a9ed34c014104462e76fd4067b3a0aa42070082dcb0bf2f388b6495cf33d789904f07d0f55c40fbd4b82963c69b3dc31895d0c772c812b1d5fbcade15312ef1c0e8ebbb12dcd4ffffffffe15557cd5ce258f479dfd6dc6514edf6d7ed5b21fcfa4a038fd69f06b83ac76e010000008b483045022023b3e0ab071eb11de2eb1cc3a67261b866f86bf6867d4558165f7c8c8aca2d86022100dc6e1f53a91de3efe8f63512850811f26284b62f850c70ca73ed5de8771fb451014104462e76fd4067b3a0aa42070082dcb0bf2f388b6495cf33d789904f07d0f55c40fbd4b82963c69b3dc31895d0c772c812b1d5fbcade15312ef1c0e8ebbb12dcd4ffffffff01404b4c00000000001976a9142b6ba7c9d796b75eef7942fc9288edd37c32f5c388ac00000000010000000166d7577163c932b4f9690ca6a80b6e4eb001f0a2fa9023df5595602aae96ed8d000000008a4730440220262b42546302dfb654a229cefc86432b89628ff259dc87edd1154535b16a67e102207b4634c020a97c3e7bbd0d4d19da6aa2269ad9dded4026e896b213d73ca4b63f014104979b82d02226b3a4597523845754d44f13639e3bf2df5e82c6aab2bdc79687368b01b1ab8b19875ae3c90d661a3d0a33161dab29934edeb36aa01976be3baf8affffffff02404b4c00000000001976a9144854e695a02af0aeacb823ccbc272134561e0a1688ac40420f00000000001976a914abee93376d6b37b5c2940655a6fcaf1c8e74237988ac0000000001000000014e3f8ef2e91349a9059cb4f01e54ab2597c1387161d3da89919f7ea6acdbb371010000008c49304602210081f3183471a5ca22307c0800226f3ef9c353069e0773ac76bb580654d56aa523022100d4c56465bdc069060846f4fbf2f6b20520b2a80b08b168b31e66ddb9c694e240014104976c79848e18251612f8940875b2b08d06e6dc73b9840e8860c066b7e87432c477e9a59a453e71e6d76d5fe34058b800a098fc1740ce3012e8fc8a00c96af966ffffffff02c0e1e400000000001976a9144134e75a6fcb6042034aab5e18570cf1f844f54788ac404b4c00000000001976a9142b6ba7c9d796b75eef7942fc9288edd37c32f5c388ac00000000"), SER_NETWORK, PROTOCOL_VERSION); + CDataStream stream(ParseHex("0400000088804e46ac93ae538cc4977aa65752be37e5af84cffdbab6d329b907622d324afd2edd33b94f6d28167d53a815af40448150897061caa5ebd85074525a9c2c3100000000000000000000000000000000000000000000000000000000000000006b019457ffff7f200000bfc18df0babc36d4e1d6ef8a6e343c15c3bec1b7b936440f839d99d1000008cf940200d0e6730013b2580060577f00f3c74a0041951001e43707015a1f1b010601000000010000000000000000000000000000000000000000000000000000000000000000ffffffff035e0101ffffffff0283c70a0000000000232102ffa90cf88320e4cbaa282506f6b2c1df39b0fabdcd0ceb685979bb6345acfd95ac98ab02000000000017a9146708e6670db0b950dac68031025cc5b63213a49187000000000100000001a2d8e5984af5f902ce8ee42a431f2211cd92e0347eb8304794bb29a95385eeab000000004847304402200b8b7d29ac534c83d57771215b1af572a96b41283ced1a2a8c3b7258a5687c7c02202e989869b11085745e04d5a23bdcca5e02ef6263270f5b8c55e400a10fcc31ed01feffffff02602c0500000000001976a91482d75bc161b2230c6fbbeb586d10c66c3f962fc288ac10270000000000001976a9142b891e223001d0d68bdbcc9d339057aaaa86f92188ac0200000001000000015339144fde1f417adeabc7d3e8fcf01bee9cc5da5fe7a5f80a93fdd1b69393430000000049483045022100cb6d1d202701d5a13a896048731426f7bddc7c03e85009dc6533709bdbf6e339022056fa5c9cfb60cb5c55af6c90583e079049545c7ec082452b69b7df6bdd322e3501feffffff02b0ef0500000000001976a91457db1edd2585f4140bbcd0d9e27821f04fcca4b688ac10270000000000001976a9142b891e223001d0d68bdbcc9d339057aaaa86f92188ac020000000100000001f503717810123e7f40a6ab13c7866102d137fc2b077dfca39ff61f3879e37ceb0000000049483045022100a4063874bb0ae4710c75ab45d437cc30894bfc89c7bb2ad0cc7739785d25879d02204783c8a6b99f50134539697a7ce86ed80a9f2ea2975c5386e66154b2a6c0a55401feffffff0210270000000000001976a9142b891e223001d0d68bdbcc9d339057aaaa86f92188ac10690400000000001976a914e50a70d55a860cb7e73f7584cff7875ed620919a88ac020000000100000001b077d12d457292c4d8b2e0e853eea6eb19eba20984e0cffc8441ba78111f9b89000000004847304402205ef1baaa781496b89d34aaae4c98b7e36f3235fc91e7e94481ce1b401eae758702200ae0b18264154229fc8d0a63df6737f1be63fe8b50401394f03711bf92d5ea3201feffffff0205b30600000000001976a914aa3f898ea469eb2fc2e404ed145dc53cc586ce9e88ac10270000000000001976a9142b891e223001d0d68bdbcc9d339057aaaa86f92188ac02000000010000000399a7a65dcc321f2586b61d091b663cd68042804b583540924591ae20f4f26cd9000000006a47304402202508bd6e4d2e0c93275beffa034b55f0aabde470147606cedb794534eac4a3c80220098a202bd0863ed621abe251f31b26d01cb5c652d7da51c4ed582f5ff13d0458012103fb660ee1d5341e4e908d8d779af7a5afd05906142cd5f84ff30fc34264408b2dfeffffff1122a4ff1174c6d3e022dd56a0940a2a937bd90493a7b4f2711f75c9a6ecdade000000006a473044022002d71379dd96afb965ae88992b5b809c08805a1235e9ce25737131f08b1f81160220316b075e4f137729023e81b54278baa6cfb3c2dd327e8fff763c255787b347a9012102fd61e686c93ef2881c60b9635d53559445de6ef6cb6ba2f91a7ac11ab6eaff87feffffff21d123d2ea376cd4a671678145e34cf1a3322bd569866d59ca0edf425da0d1cc010000006b483045022100ae2709f53a71a7be9acb46bd2571352bfecf33ddbb0796b87c13884038fed5e20220784b8895c3a3c9784a6184a323f6324d6997e9cfae907bcdd3377a73334cb3370121037c0af65516ad1cd82ff72e3582aea350d98844713ed4088cad27c67ed98a73b7feffffff0210270000000000001976a9142b891e223001d0d68bdbcc9d339057aaaa86f92188ace8530f00000000001976a9142306e76c457f7ba143eb0ecc7dbeb2d493f4b5d088ac02000000"), SER_NETWORK, PROTOCOL_VERSION); stream >> block; CBloomFilter filter(10, 0.000001, 0, BLOOM_UPDATE_ALL); // Match the last transaction - filter.insert(uint256S("0x74d681e0e03bafa802c8aa084379aa98d9fcd632ddc2ed9782b586ec87451f20")); + filter.insert(uint256S("0xa562d78f7a20d11e43fe5eabbcf90a25b60f28cd59363c4250ad3a9024057c9e")); CMerkleBlock merkleBlock(block, filter); BOOST_CHECK(merkleBlock.header.GetHash() == block.GetHash()); @@ -200,17 +206,16 @@ BOOST_AUTO_TEST_CASE(merkle_block_1) BOOST_CHECK(merkleBlock.vMatchedTxn.size() == 1); pair pair = merkleBlock.vMatchedTxn[0]; - BOOST_CHECK(merkleBlock.vMatchedTxn[0].second == uint256S("0x74d681e0e03bafa802c8aa084379aa98d9fcd632ddc2ed9782b586ec87451f20")); - BOOST_CHECK(merkleBlock.vMatchedTxn[0].first == 8); - + BOOST_CHECK(merkleBlock.vMatchedTxn[0].second == uint256S("0xa562d78f7a20d11e43fe5eabbcf90a25b60f28cd59363c4250ad3a9024057c9e")); + BOOST_CHECK(merkleBlock.vMatchedTxn[0].first == 5); vector vMatched; BOOST_CHECK(merkleBlock.txn.ExtractMatches(vMatched) == block.hashMerkleRoot); BOOST_CHECK(vMatched.size() == merkleBlock.vMatchedTxn.size()); for (unsigned int i = 0; i < vMatched.size(); i++) BOOST_CHECK(vMatched[i] == merkleBlock.vMatchedTxn[i].second); - // Also match the 8th transaction - filter.insert(uint256S("0xdd1fd2a6fc16404faf339881a90adbde7f4f728691ac62e8f168809cdfae1053")); + // Also match the 2nd last + filter.insert(uint256S("0x028ab77cd33e7bbd91a7119d755bc7c151f8fb3cd307066fde28a87dc669fa4f")); merkleBlock = CMerkleBlock(block, filter); BOOST_CHECK(merkleBlock.header.GetHash() == block.GetHash()); @@ -218,8 +223,8 @@ BOOST_AUTO_TEST_CASE(merkle_block_1) BOOST_CHECK(merkleBlock.vMatchedTxn[1] == pair); - BOOST_CHECK(merkleBlock.vMatchedTxn[0].second == uint256S("0xdd1fd2a6fc16404faf339881a90adbde7f4f728691ac62e8f168809cdfae1053")); - BOOST_CHECK(merkleBlock.vMatchedTxn[0].first == 7); + BOOST_CHECK(merkleBlock.vMatchedTxn[0].second == uint256S("0x028ab77cd33e7bbd91a7119d755bc7c151f8fb3cd307066fde28a87dc669fa4f")); + BOOST_CHECK(merkleBlock.vMatchedTxn[0].first == 4); BOOST_CHECK(merkleBlock.txn.ExtractMatches(vMatched) == block.hashMerkleRoot); BOOST_CHECK(vMatched.size() == merkleBlock.vMatchedTxn.size()); @@ -227,17 +232,18 @@ BOOST_AUTO_TEST_CASE(merkle_block_1) BOOST_CHECK(vMatched[i] == merkleBlock.vMatchedTxn[i].second); } + BOOST_AUTO_TEST_CASE(merkle_block_2) { - // Random real block (000000005a4ded781e667e06ceefafb71410b511fe0d5adc3e5a27ecbec34ae6) - // With 4 txes + // Random zcash block (7d7f21eed27f0cef570542da3f3221c9e3ce5378539b8a241a3b627ae87112f1) + // With 5 txes CBlock block; - CDataStream stream(ParseHex("0100000075616236cc2126035fadb38deb65b9102cc2c41c09cdf29fc051906800000000fe7d5e12ef0ff901f6050211249919b1c0653771832b3a80c66cea42847f0ae1d4d26e49ffff001d00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f0a441000401000000010000000000000000000000000000000000000000000000000000000000000000ffffffff0804ffff001d029105ffffffff0100f2052a010000004341046d8709a041d34357697dfcb30a9d05900a6294078012bf3bb09c6f9b525f1d16d5503d7905db1ada9501446ea00728668fc5719aa80be2fdfc8a858a4dbdd4fbac00000000010000000255605dc6f5c3dc148b6da58442b0b2cd422be385eab2ebea4119ee9c268d28350000000049483045022100aa46504baa86df8a33b1192b1b9367b4d729dc41e389f2c04f3e5c7f0559aae702205e82253a54bf5c4f65b7428551554b2045167d6d206dfe6a2e198127d3f7df1501ffffffff55605dc6f5c3dc148b6da58442b0b2cd422be385eab2ebea4119ee9c268d2835010000004847304402202329484c35fa9d6bb32a55a70c0982f606ce0e3634b69006138683bcd12cbb6602200c28feb1e2555c3210f1dddb299738b4ff8bbe9667b68cb8764b5ac17b7adf0001ffffffff0200e1f505000000004341046a0765b5865641ce08dd39690aade26dfbf5511430ca428a3089261361cef170e3929a68aee3d8d4848b0c5111b0a37b82b86ad559fd2a745b44d8e8d9dfdc0cac00180d8f000000004341044a656f065871a353f216ca26cef8dde2f03e8c16202d2e8ad769f02032cb86a5eb5e56842e92e19141d60a01928f8dd2c875a390f67c1f6c94cfc617c0ea45afac0000000001000000025f9a06d3acdceb56be1bfeaa3e8a25e62d182fa24fefe899d1c17f1dad4c2028000000004847304402205d6058484157235b06028c30736c15613a28bdb768ee628094ca8b0030d4d6eb0220328789c9a2ec27ddaec0ad5ef58efded42e6ea17c2e1ce838f3d6913f5e95db601ffffffff5f9a06d3acdceb56be1bfeaa3e8a25e62d182fa24fefe899d1c17f1dad4c2028010000004a493046022100c45af050d3cea806cedd0ab22520c53ebe63b987b8954146cdca42487b84bdd6022100b9b027716a6b59e640da50a864d6dd8a0ef24c76ce62391fa3eabaf4d2886d2d01ffffffff0200e1f505000000004341046a0765b5865641ce08dd39690aade26dfbf5511430ca428a3089261361cef170e3929a68aee3d8d4848b0c5111b0a37b82b86ad559fd2a745b44d8e8d9dfdc0cac00180d8f000000004341046a0765b5865641ce08dd39690aade26dfbf5511430ca428a3089261361cef170e3929a68aee3d8d4848b0c5111b0a37b82b86ad559fd2a745b44d8e8d9dfdc0cac000000000100000002e2274e5fea1bf29d963914bd301aa63b64daaf8a3e88f119b5046ca5738a0f6b0000000048473044022016e7a727a061ea2254a6c358376aaa617ac537eb836c77d646ebda4c748aac8b0220192ce28bf9f2c06a6467e6531e27648d2b3e2e2bae85159c9242939840295ba501ffffffffe2274e5fea1bf29d963914bd301aa63b64daaf8a3e88f119b5046ca5738a0f6b010000004a493046022100b7a1a755588d4190118936e15cd217d133b0e4a53c3c15924010d5648d8925c9022100aaef031874db2114f2d869ac2de4ae53908fbfea5b2b1862e181626bb9005c9f01ffffffff0200e1f505000000004341044a656f065871a353f216ca26cef8dde2f03e8c16202d2e8ad769f02032cb86a5eb5e56842e92e19141d60a01928f8dd2c875a390f67c1f6c94cfc617c0ea45afac00180d8f000000004341046a0765b5865641ce08dd39690aade26dfbf5511430ca428a3089261361cef170e3929a68aee3d8d4848b0c5111b0a37b82b86ad559fd2a745b44d8e8d9dfdc0cac00000000"), SER_NETWORK, PROTOCOL_VERSION); + CDataStream stream(ParseHex("0400000086fc337f4d96ad6fe26922993aff7f460610f023947fb1524a9796c6039e336e9e3f50e8efd148368f28751b175acc0a2f84e90d95804b0240ed77805208d7140000000000000000000000000000000000000000000000000000000000000000085f9457ffff7f200000eeab3b01a349c2321e62021d3127a7453012509b43b617b84d8ade01000008ad2d65008026b20155667d00e6102901b0ff6800ff82f10088cc9500c51eff010501000000010000000000000000000000000000000000000000000000000000000000000000ffffffff0502a0000101ffffffff02e1e3c100000000002321032b5658ac8bc397cb7eec32bda5e0126b07237ad06416c4b0c26515d200f271abac80841e000000000017a9146708e6670db0b950dac68031025cc5b63213a4918700000000010000000219e8b9f1338a730a196b90c9cade66f30da41ee3b887216ca938debc1e4ab49f0000000048473044022027471af3b10251d4246e0d2835a06e4db14cc0395d0b366f520401768fd959a902203cbf3bcfe6223a475fe768eec6f4e799c37c0b68eecde417a1c52d0df25211e901feffffff7586bc0810ba8f280ebfd28331cbbc9d0340f1e0843d591c85434355aedf5af60000000049483045022100e74bb84b3ff5173db4ac0e1bfd662585a29015e30939ef702bcc1b78e585e46102202dfa012c71c1f57a6d8abf95f028b565523fc781435bc157157fc211e1948dae01feffffff0280969800000000001976a914c580c53320dea648a03a97593d8a1c808da144e688ac39530f00000000001976a9144e208bf1ea539cfc42abba2ed9ed471dd37273ce88ac950000000100000002bb040278a4d7db142130f76cad84a73c92acbf4d09b14a1b4b4a20e3f03813ff0000000049483045022100a26a7b988da9ec27c5296da2284d98caf000b4eac1228755020fb081fb087520022046d3afe1ac0e272a2dc471a4c428330889dd2105a0b0522eb048e336fd15e1f101feffffff0c142569ea608b72f23b0865c631fdc7e1f121934a2c4ae4d38927922c162089010000006b483045022100ddc61e56211a99738b4d6f5a23b1b6e5e3cbea61c2f4450aa805fcb89f8af79502200802e6b51b56624942edf13a5e1acf37e670d7bd91de2b2ee02b4494c9cce0a5012103a3097a1563701a2e7f49986980d7e771837bae6500776c555916e9251fe30bd3feffffff02d8590f00000000001976a914a4456fc397881ed5f12dea3fd0dea651320f49d388ac00093d00000000001976a914c580c53320dea648a03a97593d8a1c808da144e688ac950000000100000003669fb2f8f1bd9108db56b69ac744c5c99c4bc2007450f0d583f62b547d0dba7e0000000048473044022072fdbcd8824d8b24c3f28a2a47d041e206bf8d04ba87b0cda501961dcbfc1de7022076ec3a543b2c2577e91ff575353d29203eeaafd5acd5563f4782e80494da75d301feffffff810f324b04fc23388ea298b07333eb61c332ac18ff956930c7159d2f1f3e7e71000000006a4730440220686bb245a82628d546f4cd707080106f49344aeda007f579fc4d65f39ffa9478022015ebda540b1cc62859fb388c5ee886c072ef0b2bcacfca9cdf59f66994e3e03d012103f795e1424eab94769f4652dd54ab14d7a8e404620c0e8b66586dde70485f723bfeffffff0c142569ea608b72f23b0865c631fdc7e1f121934a2c4ae4d38927922c162089000000006b483045022100f6de5dd27bba83f56a47f92aa196899bee0d8bd64198c5b4e5ff28bb410fb2d002204058b435554da16a7a9551ed3186e6eb5322b24886435aa75f50f91735e7ee60012102ce64b6712044dae5a45b4167a28a746ba2053b300ad1eae2f873a7b93ba4417efeffffff02404b4c00000000001976a914c580c53320dea648a03a97593d8a1c808da144e688acfc4e0f00000000001976a91471738f751839f99768c4a2e9c689acd9b184225488ac950000000100000001880a0b5d9e485fee5e457c41451e7fc9ca947bd1a8f5cc92f94ac6a42aa1c178000000006b483045022100c0345a7fdeabdfa6178b4ffff027c50c9ae8ba6ee13f70889d36063e863a326302202c7bc4146cf2b4d6f225db5ad2cf6bafeac04f4d121cf2428318d3795890dffb012102a7c4ed2842941f56e666820b4fd2db00ad04c2336c4e22d89c9c6a632cc10721ffffffff01e0930400000000001976a91472dd7e185c3f069223560a1df310c81d4d12804c88ac00000000"), SER_NETWORK, PROTOCOL_VERSION); stream >> block; CBloomFilter filter(10, 0.000001, 0, BLOOM_UPDATE_ALL); // Match the first transaction - filter.insert(uint256S("0xe980fe9f792d014e73b95203dc1335c5f9ce19ac537a419e6df5b47aecb93b70")); + filter.insert(uint256S("0xbadc26343ec0d00d1106e5715a15aa10d4000c2211dca8cb76db51560302367e")); CMerkleBlock merkleBlock(block, filter); BOOST_CHECK(merkleBlock.header.GetHash() == block.GetHash()); @@ -245,7 +251,7 @@ BOOST_AUTO_TEST_CASE(merkle_block_2) BOOST_CHECK(merkleBlock.vMatchedTxn.size() == 1); pair pair = merkleBlock.vMatchedTxn[0]; - BOOST_CHECK(merkleBlock.vMatchedTxn[0].second == uint256S("0xe980fe9f792d014e73b95203dc1335c5f9ce19ac537a419e6df5b47aecb93b70")); + BOOST_CHECK(merkleBlock.vMatchedTxn[0].second == uint256S("0xbadc26343ec0d00d1106e5715a15aa10d4000c2211dca8cb76db51560302367e")); BOOST_CHECK(merkleBlock.vMatchedTxn[0].first == 0); vector vMatched; @@ -254,27 +260,31 @@ BOOST_AUTO_TEST_CASE(merkle_block_2) for (unsigned int i = 0; i < vMatched.size(); i++) BOOST_CHECK(vMatched[i] == merkleBlock.vMatchedTxn[i].second); - // Match an output from the second transaction (the pubkey for address 1DZTzaBHUDM7T3QvUKBz4qXMRpkg8jsfB5) - // This should match the third transaction because it spends the output matched + // Match an output from the second transaction (the pubkey for address myXFfxnnizWcNmgeA7iccxZgCcoL2g9RjC) + // It also matches the third transaction, which spends to the pubkey again // It also matches the fourth transaction, which spends to the pubkey again - filter.insert(ParseHex("044a656f065871a353f216ca26cef8dde2f03e8c16202d2e8ad769f02032cb86a5eb5e56842e92e19141d60a01928f8dd2c875a390f67c1f6c94cfc617c0ea45af")); + // This should match the last transaction because it spends the output matched + filter.insert(ParseHex("c580c53320dea648a03a97593d8a1c808da144e6")); merkleBlock = CMerkleBlock(block, filter); BOOST_CHECK(merkleBlock.header.GetHash() == block.GetHash()); - BOOST_CHECK(merkleBlock.vMatchedTxn.size() == 4); + BOOST_CHECK(merkleBlock.vMatchedTxn.size() == 5); BOOST_CHECK(pair == merkleBlock.vMatchedTxn[0]); - BOOST_CHECK(merkleBlock.vMatchedTxn[1].second == uint256S("0x28204cad1d7fc1d199e8ef4fa22f182de6258a3eaafe1bbe56ebdcacd3069a5f")); + BOOST_CHECK(merkleBlock.vMatchedTxn[1].second == uint256S("0x9042d2c9222e7b6ee8901950ae2fd4b2be10a9914f282bb6b01c98bc66630dae")); BOOST_CHECK(merkleBlock.vMatchedTxn[1].first == 1); - BOOST_CHECK(merkleBlock.vMatchedTxn[2].second == uint256S("0x6b0f8a73a56c04b519f1883e8aafda643ba61a30bd1439969df21bea5f4e27e2")); + BOOST_CHECK(merkleBlock.vMatchedTxn[2].second == uint256S("0x3a691704797375f98ea0c48ed60b8c4c8e616e4031ca43a2300df105ef47dee3")); BOOST_CHECK(merkleBlock.vMatchedTxn[2].first == 2); - BOOST_CHECK(merkleBlock.vMatchedTxn[3].second == uint256S("0x3c1d7e82342158e4109df2e0b6348b6e84e403d8b4046d7007663ace63cddb23")); + BOOST_CHECK(merkleBlock.vMatchedTxn[3].second == uint256S("0x78c1a12aa4c64af992ccf5a8d17b94cac97f1e45417c455eee5f489e5d0b0a88")); BOOST_CHECK(merkleBlock.vMatchedTxn[3].first == 3); + BOOST_CHECK(merkleBlock.vMatchedTxn[4].second == uint256S("0x55a46dbe172f7a453caf98bcc144d732e62b2a2f91615cd21e0571491e13ade6")); + BOOST_CHECK(merkleBlock.vMatchedTxn[4].first == 4); + BOOST_CHECK(merkleBlock.txn.ExtractMatches(vMatched) == block.hashMerkleRoot); BOOST_CHECK(vMatched.size() == merkleBlock.vMatchedTxn.size()); for (unsigned int i = 0; i < vMatched.size(); i++) @@ -283,15 +293,15 @@ BOOST_AUTO_TEST_CASE(merkle_block_2) BOOST_AUTO_TEST_CASE(merkle_block_2_with_update_none) { - // Random real block (000000005a4ded781e667e06ceefafb71410b511fe0d5adc3e5a27ecbec34ae6) - // With 4 txes + // Random zcash block (7d7f21eed27f0cef570542da3f3221c9e3ce5378539b8a241a3b627ae87112f1) + // With 5 txes CBlock block; - CDataStream stream(ParseHex("0100000075616236cc2126035fadb38deb65b9102cc2c41c09cdf29fc051906800000000fe7d5e12ef0ff901f6050211249919b1c0653771832b3a80c66cea42847f0ae1d4d26e49ffff001d00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f0a441000401000000010000000000000000000000000000000000000000000000000000000000000000ffffffff0804ffff001d029105ffffffff0100f2052a010000004341046d8709a041d34357697dfcb30a9d05900a6294078012bf3bb09c6f9b525f1d16d5503d7905db1ada9501446ea00728668fc5719aa80be2fdfc8a858a4dbdd4fbac00000000010000000255605dc6f5c3dc148b6da58442b0b2cd422be385eab2ebea4119ee9c268d28350000000049483045022100aa46504baa86df8a33b1192b1b9367b4d729dc41e389f2c04f3e5c7f0559aae702205e82253a54bf5c4f65b7428551554b2045167d6d206dfe6a2e198127d3f7df1501ffffffff55605dc6f5c3dc148b6da58442b0b2cd422be385eab2ebea4119ee9c268d2835010000004847304402202329484c35fa9d6bb32a55a70c0982f606ce0e3634b69006138683bcd12cbb6602200c28feb1e2555c3210f1dddb299738b4ff8bbe9667b68cb8764b5ac17b7adf0001ffffffff0200e1f505000000004341046a0765b5865641ce08dd39690aade26dfbf5511430ca428a3089261361cef170e3929a68aee3d8d4848b0c5111b0a37b82b86ad559fd2a745b44d8e8d9dfdc0cac00180d8f000000004341044a656f065871a353f216ca26cef8dde2f03e8c16202d2e8ad769f02032cb86a5eb5e56842e92e19141d60a01928f8dd2c875a390f67c1f6c94cfc617c0ea45afac0000000001000000025f9a06d3acdceb56be1bfeaa3e8a25e62d182fa24fefe899d1c17f1dad4c2028000000004847304402205d6058484157235b06028c30736c15613a28bdb768ee628094ca8b0030d4d6eb0220328789c9a2ec27ddaec0ad5ef58efded42e6ea17c2e1ce838f3d6913f5e95db601ffffffff5f9a06d3acdceb56be1bfeaa3e8a25e62d182fa24fefe899d1c17f1dad4c2028010000004a493046022100c45af050d3cea806cedd0ab22520c53ebe63b987b8954146cdca42487b84bdd6022100b9b027716a6b59e640da50a864d6dd8a0ef24c76ce62391fa3eabaf4d2886d2d01ffffffff0200e1f505000000004341046a0765b5865641ce08dd39690aade26dfbf5511430ca428a3089261361cef170e3929a68aee3d8d4848b0c5111b0a37b82b86ad559fd2a745b44d8e8d9dfdc0cac00180d8f000000004341046a0765b5865641ce08dd39690aade26dfbf5511430ca428a3089261361cef170e3929a68aee3d8d4848b0c5111b0a37b82b86ad559fd2a745b44d8e8d9dfdc0cac000000000100000002e2274e5fea1bf29d963914bd301aa63b64daaf8a3e88f119b5046ca5738a0f6b0000000048473044022016e7a727a061ea2254a6c358376aaa617ac537eb836c77d646ebda4c748aac8b0220192ce28bf9f2c06a6467e6531e27648d2b3e2e2bae85159c9242939840295ba501ffffffffe2274e5fea1bf29d963914bd301aa63b64daaf8a3e88f119b5046ca5738a0f6b010000004a493046022100b7a1a755588d4190118936e15cd217d133b0e4a53c3c15924010d5648d8925c9022100aaef031874db2114f2d869ac2de4ae53908fbfea5b2b1862e181626bb9005c9f01ffffffff0200e1f505000000004341044a656f065871a353f216ca26cef8dde2f03e8c16202d2e8ad769f02032cb86a5eb5e56842e92e19141d60a01928f8dd2c875a390f67c1f6c94cfc617c0ea45afac00180d8f000000004341046a0765b5865641ce08dd39690aade26dfbf5511430ca428a3089261361cef170e3929a68aee3d8d4848b0c5111b0a37b82b86ad559fd2a745b44d8e8d9dfdc0cac00000000"), SER_NETWORK, PROTOCOL_VERSION); + CDataStream stream(ParseHex("0400000086fc337f4d96ad6fe26922993aff7f460610f023947fb1524a9796c6039e336e9e3f50e8efd148368f28751b175acc0a2f84e90d95804b0240ed77805208d7140000000000000000000000000000000000000000000000000000000000000000085f9457ffff7f200000eeab3b01a349c2321e62021d3127a7453012509b43b617b84d8ade01000008ad2d65008026b20155667d00e6102901b0ff6800ff82f10088cc9500c51eff010501000000010000000000000000000000000000000000000000000000000000000000000000ffffffff0502a0000101ffffffff02e1e3c100000000002321032b5658ac8bc397cb7eec32bda5e0126b07237ad06416c4b0c26515d200f271abac80841e000000000017a9146708e6670db0b950dac68031025cc5b63213a4918700000000010000000219e8b9f1338a730a196b90c9cade66f30da41ee3b887216ca938debc1e4ab49f0000000048473044022027471af3b10251d4246e0d2835a06e4db14cc0395d0b366f520401768fd959a902203cbf3bcfe6223a475fe768eec6f4e799c37c0b68eecde417a1c52d0df25211e901feffffff7586bc0810ba8f280ebfd28331cbbc9d0340f1e0843d591c85434355aedf5af60000000049483045022100e74bb84b3ff5173db4ac0e1bfd662585a29015e30939ef702bcc1b78e585e46102202dfa012c71c1f57a6d8abf95f028b565523fc781435bc157157fc211e1948dae01feffffff0280969800000000001976a914c580c53320dea648a03a97593d8a1c808da144e688ac39530f00000000001976a9144e208bf1ea539cfc42abba2ed9ed471dd37273ce88ac950000000100000002bb040278a4d7db142130f76cad84a73c92acbf4d09b14a1b4b4a20e3f03813ff0000000049483045022100a26a7b988da9ec27c5296da2284d98caf000b4eac1228755020fb081fb087520022046d3afe1ac0e272a2dc471a4c428330889dd2105a0b0522eb048e336fd15e1f101feffffff0c142569ea608b72f23b0865c631fdc7e1f121934a2c4ae4d38927922c162089010000006b483045022100ddc61e56211a99738b4d6f5a23b1b6e5e3cbea61c2f4450aa805fcb89f8af79502200802e6b51b56624942edf13a5e1acf37e670d7bd91de2b2ee02b4494c9cce0a5012103a3097a1563701a2e7f49986980d7e771837bae6500776c555916e9251fe30bd3feffffff02d8590f00000000001976a914a4456fc397881ed5f12dea3fd0dea651320f49d388ac00093d00000000001976a914c580c53320dea648a03a97593d8a1c808da144e688ac950000000100000003669fb2f8f1bd9108db56b69ac744c5c99c4bc2007450f0d583f62b547d0dba7e0000000048473044022072fdbcd8824d8b24c3f28a2a47d041e206bf8d04ba87b0cda501961dcbfc1de7022076ec3a543b2c2577e91ff575353d29203eeaafd5acd5563f4782e80494da75d301feffffff810f324b04fc23388ea298b07333eb61c332ac18ff956930c7159d2f1f3e7e71000000006a4730440220686bb245a82628d546f4cd707080106f49344aeda007f579fc4d65f39ffa9478022015ebda540b1cc62859fb388c5ee886c072ef0b2bcacfca9cdf59f66994e3e03d012103f795e1424eab94769f4652dd54ab14d7a8e404620c0e8b66586dde70485f723bfeffffff0c142569ea608b72f23b0865c631fdc7e1f121934a2c4ae4d38927922c162089000000006b483045022100f6de5dd27bba83f56a47f92aa196899bee0d8bd64198c5b4e5ff28bb410fb2d002204058b435554da16a7a9551ed3186e6eb5322b24886435aa75f50f91735e7ee60012102ce64b6712044dae5a45b4167a28a746ba2053b300ad1eae2f873a7b93ba4417efeffffff02404b4c00000000001976a914c580c53320dea648a03a97593d8a1c808da144e688acfc4e0f00000000001976a91471738f751839f99768c4a2e9c689acd9b184225488ac950000000100000001880a0b5d9e485fee5e457c41451e7fc9ca947bd1a8f5cc92f94ac6a42aa1c178000000006b483045022100c0345a7fdeabdfa6178b4ffff027c50c9ae8ba6ee13f70889d36063e863a326302202c7bc4146cf2b4d6f225db5ad2cf6bafeac04f4d121cf2428318d3795890dffb012102a7c4ed2842941f56e666820b4fd2db00ad04c2336c4e22d89c9c6a632cc10721ffffffff01e0930400000000001976a91472dd7e185c3f069223560a1df310c81d4d12804c88ac00000000"), SER_NETWORK, PROTOCOL_VERSION); stream >> block; CBloomFilter filter(10, 0.000001, 0, BLOOM_UPDATE_NONE); // Match the first transaction - filter.insert(uint256S("0xe980fe9f792d014e73b95203dc1335c5f9ce19ac537a419e6df5b47aecb93b70")); + filter.insert(uint256S("0xbadc26343ec0d00d1106e5715a15aa10d4000c2211dca8cb76db51560302367e")); CMerkleBlock merkleBlock(block, filter); BOOST_CHECK(merkleBlock.header.GetHash() == block.GetHash()); @@ -299,7 +309,7 @@ BOOST_AUTO_TEST_CASE(merkle_block_2_with_update_none) BOOST_CHECK(merkleBlock.vMatchedTxn.size() == 1); pair pair = merkleBlock.vMatchedTxn[0]; - BOOST_CHECK(merkleBlock.vMatchedTxn[0].second == uint256S("0xe980fe9f792d014e73b95203dc1335c5f9ce19ac537a419e6df5b47aecb93b70")); + BOOST_CHECK(merkleBlock.vMatchedTxn[0].second == uint256S("0xbadc26343ec0d00d1106e5715a15aa10d4000c2211dca8cb76db51560302367e")); BOOST_CHECK(merkleBlock.vMatchedTxn[0].first == 0); vector vMatched; @@ -308,23 +318,27 @@ BOOST_AUTO_TEST_CASE(merkle_block_2_with_update_none) for (unsigned int i = 0; i < vMatched.size(); i++) BOOST_CHECK(vMatched[i] == merkleBlock.vMatchedTxn[i].second); - // Match an output from the second transaction (the pubkey for address 1DZTzaBHUDM7T3QvUKBz4qXMRpkg8jsfB5) - // This should not match the third transaction though it spends the output matched + // Match an output from the second transaction (the pubkey for address myXFfxnnizWcNmgeA7iccxZgCcoL2g9RjC) + // It will match the third transaction, which has another pay-to-pubkey output to the same address // It will match the fourth transaction, which has another pay-to-pubkey output to the same address - filter.insert(ParseHex("044a656f065871a353f216ca26cef8dde2f03e8c16202d2e8ad769f02032cb86a5eb5e56842e92e19141d60a01928f8dd2c875a390f67c1f6c94cfc617c0ea45af")); + // This should not match the last transaction though it spends the output matched + filter.insert(ParseHex("c580c53320dea648a03a97593d8a1c808da144e6")); merkleBlock = CMerkleBlock(block, filter); BOOST_CHECK(merkleBlock.header.GetHash() == block.GetHash()); - BOOST_CHECK(merkleBlock.vMatchedTxn.size() == 3); + BOOST_CHECK(merkleBlock.vMatchedTxn.size() == 4); BOOST_CHECK(pair == merkleBlock.vMatchedTxn[0]); - BOOST_CHECK(merkleBlock.vMatchedTxn[1].second == uint256S("0x28204cad1d7fc1d199e8ef4fa22f182de6258a3eaafe1bbe56ebdcacd3069a5f")); + BOOST_CHECK(merkleBlock.vMatchedTxn[1].second == uint256S("0x9042d2c9222e7b6ee8901950ae2fd4b2be10a9914f282bb6b01c98bc66630dae")); BOOST_CHECK(merkleBlock.vMatchedTxn[1].first == 1); - BOOST_CHECK(merkleBlock.vMatchedTxn[2].second == uint256S("0x3c1d7e82342158e4109df2e0b6348b6e84e403d8b4046d7007663ace63cddb23")); - BOOST_CHECK(merkleBlock.vMatchedTxn[2].first == 3); + BOOST_CHECK(merkleBlock.vMatchedTxn[2].second == uint256S("0x3a691704797375f98ea0c48ed60b8c4c8e616e4031ca43a2300df105ef47dee3")); + BOOST_CHECK(merkleBlock.vMatchedTxn[2].first == 2); + + BOOST_CHECK(merkleBlock.vMatchedTxn[3].second == uint256S("0x78c1a12aa4c64af992ccf5a8d17b94cac97f1e45417c455eee5f489e5d0b0a88")); + BOOST_CHECK(merkleBlock.vMatchedTxn[3].first == 3); BOOST_CHECK(merkleBlock.txn.ExtractMatches(vMatched) == block.hashMerkleRoot); BOOST_CHECK(vMatched.size() == merkleBlock.vMatchedTxn.size()); @@ -332,24 +346,25 @@ BOOST_AUTO_TEST_CASE(merkle_block_2_with_update_none) BOOST_CHECK(vMatched[i] == merkleBlock.vMatchedTxn[i].second); } + BOOST_AUTO_TEST_CASE(merkle_block_3_and_serialize) { - // Random real block (000000000000dab0130bbcc991d3d7ae6b81aa6f50a798888dfe62337458dc45) + // Random zcash block (149e54e5b639d1be22337e2176311ef37f487fcfb12036155407aaaa710b8104) // With one tx CBlock block; - CDataStream stream(ParseHex("0100000079cda856b143d9db2c1caff01d1aecc8630d30625d10e8b4b8b0000000000000b50cc069d6a3e33e3ff84a5c41d9d3febe7c770fdcc96b2c3ff60abe184f196367291b4d4c86041b0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008fa45d63000101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff08044c86041b020a02ffffffff0100f2052a01000000434104ecd3229b0571c3be876feaac0442a9f13c5a572742927af1dc623353ecf8c202225f64868137a18cdd85cbbb4c74fbccfd4f49639cf1bdc94a5672bb15ad5d4cac00000000"), SER_NETWORK, PROTOCOL_VERSION); + CDataStream stream(ParseHex("04000000443e8135b55929f59ff07da32013a08cb71e2f33e0538183ac1956c52124183c2a77a9bad5cc4a5ae1866799d1e148bf9196f25abfbf1758fb242f9cfe6a018e0000000000000000000000000000000000000000000000000000000000000000b45a94574b716f200000a78cee268a82089ff84d8769980442c6335768c5177e3d57f19e0527000008fa9220006d111601601cae01f546da01834874003649fa0124abdb00fd3366010101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff050296000101ffffffff02e07072000000000023210304fe1f36dbe31372a1d9b711a9ad8c9713b3b3e66ca9d4815f16d876a243a0f3ac389c1c000000000017a9146708e6670db0b950dac68031025cc5b63213a4918700000000"), SER_NETWORK, PROTOCOL_VERSION); stream >> block; CBloomFilter filter(10, 0.000001, 0, BLOOM_UPDATE_ALL); // Match the only transaction - filter.insert(uint256S("0x63194f18be0af63f2c6bc9dc0f777cbefed3d9415c4af83f3ee3a3d669c00cb5")); + filter.insert(uint256S("0x8e016afe9c2f24fb5817bfbf5af29691bf48e1d1996786e15a4accd5baa9772a")); CMerkleBlock merkleBlock(block, filter); BOOST_CHECK(merkleBlock.header.GetHash() == block.GetHash()); BOOST_CHECK(merkleBlock.vMatchedTxn.size() == 1); - BOOST_CHECK(merkleBlock.vMatchedTxn[0].second == uint256S("0x63194f18be0af63f2c6bc9dc0f777cbefed3d9415c4af83f3ee3a3d669c00cb5")); + BOOST_CHECK(merkleBlock.vMatchedTxn[0].second == uint256S("0x8e016afe9c2f24fb5817bfbf5af29691bf48e1d1996786e15a4accd5baa9772a")); BOOST_CHECK(merkleBlock.vMatchedTxn[0].first == 0); vector vMatched; @@ -360,27 +375,29 @@ BOOST_AUTO_TEST_CASE(merkle_block_3_and_serialize) CDataStream merkleStream(SER_NETWORK, PROTOCOL_VERSION); merkleStream << merkleBlock; - - vector vch = ParseHex("0100000079cda856b143d9db2c1caff01d1aecc8630d30625d10e8b4b8b0000000000000b50cc069d6a3e33e3ff84a5c41d9d3febe7c770fdcc96b2c3ff60abe184f196367291b4d4c86041b0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008fa45d63000100000001b50cc069d6a3e33e3ff84a5c41d9d3febe7c770fdcc96b2c3ff60abe184f19630101"); + vector vch = ParseHex("04000000443e8135b55929f59ff07da32013a08cb71e2f33e0538183ac1956c52124183c2a77a9bad5cc4a5ae1866799d1e148bf9196f25abfbf1758fb242f9cfe6a018e0000000000000000000000000000000000000000000000000000000000000000b45a94574b716f200000a78cee268a82089ff84d8769980442c6335768c5177e3d57f19e0527000008fa9220006d111601601cae01f546da01834874003649fa0124abdb00fd33660101000000012a77a9bad5cc4a5ae1866799d1e148bf9196f25abfbf1758fb242f9cfe6a018e0101"); vector expected(vch.size()); for (unsigned int i = 0; i < vch.size(); i++) expected[i] = (char)vch[i]; +// std::cout << HexStr(merkleStream.begin(), merkleStream.end()) << std::endl; + BOOST_CHECK_EQUAL_COLLECTIONS(expected.begin(), expected.end(), merkleStream.begin(), merkleStream.end()); } + BOOST_AUTO_TEST_CASE(merkle_block_4) { - // Random real block (000000000000b731f2eef9e8c63173adfb07e41bd53eb0ef0a6b720d6cb6dea4) - // With 7 txes + // Random zcash block (0a18aa311b3c81284754677e66e3a78e5390680e54e4d9c1a716a74bf7bdd850) + // With 6 txes CBlock block; - CDataStream stream(ParseHex("0100000082bb869cf3a793432a66e826e05a6fc37469f8efb7421dc880670100000000007f16c5962e8bd963659c793ce370d95f093bc7e367117b3c30c1f8fdd0d9728776381b4d4c86041b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000554b8529000701000000010000000000000000000000000000000000000000000000000000000000000000ffffffff07044c86041b0136ffffffff0100f2052a01000000434104eaafc2314def4ca98ac970241bcab022b9c1e1f4ea423a20f134c876f2c01ec0f0dd5b2e86e7168cefe0d81113c3807420ce13ad1357231a2252247d97a46a91ac000000000100000001bcad20a6a29827d1424f08989255120bf7f3e9e3cdaaa6bb31b0737fe048724300000000494830450220356e834b046cadc0f8ebb5a8a017b02de59c86305403dad52cd77b55af062ea10221009253cd6c119d4729b77c978e1e2aa19f5ea6e0e52b3f16e32fa608cd5bab753901ffffffff02008d380c010000001976a9142b4b8072ecbba129b6453c63e129e643207249ca88ac0065cd1d000000001976a9141b8dd13b994bcfc787b32aeadf58ccb3615cbd5488ac000000000100000003fdacf9b3eb077412e7a968d2e4f11b9a9dee312d666187ed77ee7d26af16cb0b000000008c493046022100ea1608e70911ca0de5af51ba57ad23b9a51db8d28f82c53563c56a05c20f5a87022100a8bdc8b4a8acc8634c6b420410150775eb7f2474f5615f7fccd65af30f310fbf01410465fdf49e29b06b9a1582287b6279014f834edc317695d125ef623c1cc3aaece245bd69fcad7508666e9c74a49dc9056d5fc14338ef38118dc4afae5fe2c585caffffffff309e1913634ecb50f3c4f83e96e70b2df071b497b8973a3e75429df397b5af83000000004948304502202bdb79c596a9ffc24e96f4386199aba386e9bc7b6071516e2b51dda942b3a1ed022100c53a857e76b724fc14d45311eac5019650d415c3abb5428f3aae16d8e69bec2301ffffffff2089e33491695080c9edc18a428f7d834db5b6d372df13ce2b1b0e0cbcb1e6c10000000049483045022100d4ce67c5896ee251c810ac1ff9ceccd328b497c8f553ab6e08431e7d40bad6b5022033119c0c2b7d792d31f1187779c7bd95aefd93d90a715586d73801d9b47471c601ffffffff0100714460030000001976a914c7b55141d097ea5df7a0ed330cf794376e53ec8d88ac0000000001000000045bf0e214aa4069a3e792ecee1e1bf0c1d397cde8dd08138f4b72a00681743447000000008b48304502200c45de8c4f3e2c1821f2fc878cba97b1e6f8807d94930713aa1c86a67b9bf1e40221008581abfef2e30f957815fc89978423746b2086375ca8ecf359c85c2a5b7c88ad01410462bb73f76ca0994fcb8b4271e6fb7561f5c0f9ca0cf6485261c4a0dc894f4ab844c6cdfb97cd0b60ffb5018ffd6238f4d87270efb1d3ae37079b794a92d7ec95ffffffffd669f7d7958d40fc59d2253d88e0f248e29b599c80bbcec344a83dda5f9aa72c000000008a473044022078124c8beeaa825f9e0b30bff96e564dd859432f2d0cb3b72d3d5d93d38d7e930220691d233b6c0f995be5acb03d70a7f7a65b6bc9bdd426260f38a1346669507a3601410462bb73f76ca0994fcb8b4271e6fb7561f5c0f9ca0cf6485261c4a0dc894f4ab844c6cdfb97cd0b60ffb5018ffd6238f4d87270efb1d3ae37079b794a92d7ec95fffffffff878af0d93f5229a68166cf051fd372bb7a537232946e0a46f53636b4dafdaa4000000008c493046022100c717d1714551663f69c3c5759bdbb3a0fcd3fab023abc0e522fe6440de35d8290221008d9cbe25bffc44af2b18e81c58eb37293fd7fe1c2e7b46fc37ee8c96c50ab1e201410462bb73f76ca0994fcb8b4271e6fb7561f5c0f9ca0cf6485261c4a0dc894f4ab844c6cdfb97cd0b60ffb5018ffd6238f4d87270efb1d3ae37079b794a92d7ec95ffffffff27f2b668859cd7f2f894aa0fd2d9e60963bcd07c88973f425f999b8cbfd7a1e2000000008c493046022100e00847147cbf517bcc2f502f3ddc6d284358d102ed20d47a8aa788a62f0db780022100d17b2d6fa84dcaf1c95d88d7e7c30385aecf415588d749afd3ec81f6022cecd701410462bb73f76ca0994fcb8b4271e6fb7561f5c0f9ca0cf6485261c4a0dc894f4ab844c6cdfb97cd0b60ffb5018ffd6238f4d87270efb1d3ae37079b794a92d7ec95ffffffff0100c817a8040000001976a914b6efd80d99179f4f4ff6f4dd0a007d018c385d2188ac000000000100000001834537b2f1ce8ef9373a258e10545ce5a50b758df616cd4356e0032554ebd3c4000000008b483045022100e68f422dd7c34fdce11eeb4509ddae38201773dd62f284e8aa9d96f85099d0b002202243bd399ff96b649a0fad05fa759d6a882f0af8c90cf7632c2840c29070aec20141045e58067e815c2f464c6a2a15f987758374203895710c2d452442e28496ff38ba8f5fd901dc20e29e88477167fe4fc299bf818fd0d9e1632d467b2a3d9503b1aaffffffff0280d7e636030000001976a914f34c3e10eb387efe872acb614c89e78bfca7815d88ac404b4c00000000001976a914a84e272933aaf87e1715d7786c51dfaeb5b65a6f88ac00000000010000000143ac81c8e6f6ef307dfe17f3d906d999e23e0189fda838c5510d850927e03ae7000000008c4930460221009c87c344760a64cb8ae6685a3eec2c1ac1bed5b88c87de51acd0e124f266c16602210082d07c037359c3a257b5c63ebd90f5a5edf97b2ac1c434b08ca998839f346dd40141040ba7e521fa7946d12edbb1d1e95a15c34bd4398195e86433c92b431cd315f455fe30032ede69cad9d1e1ed6c3c4ec0dbfced53438c625462afb792dcb098544bffffffff0240420f00000000001976a9144676d1b820d63ec272f1900d59d43bc6463d96f888ac40420f00000000001976a914648d04341d00d7968b3405c034adc38d4d8fb9bd88ac00000000010000000248cc917501ea5c55f4a8d2009c0567c40cfe037c2e71af017d0a452ff705e3f1000000008b483045022100bf5fdc86dc5f08a5d5c8e43a8c9d5b1ed8c65562e280007b52b133021acd9acc02205e325d613e555f772802bf413d36ba807892ed1a690a77811d3033b3de226e0a01410429fa713b124484cb2bd7b5557b2c0b9df7b2b1fee61825eadc5ae6c37a9920d38bfccdc7dc3cb0c47d7b173dbc9db8d37db0a33ae487982c59c6f8606e9d1791ffffffff41ed70551dd7e841883ab8f0b16bf04176b7d1480e4f0af9f3d4c3595768d068000000008b4830450221008513ad65187b903aed1102d1d0c47688127658c51106753fed0151ce9c16b80902201432b9ebcb87bd04ceb2de66035fbbaf4bf8b00d1cfe41f1a1f7338f9ad79d210141049d4cf80125bf50be1709f718c07ad15d0fc612b7da1f5570dddc35f2a352f0f27c978b06820edca9ef982c35fda2d255afba340068c5035552368bc7200c1488ffffffff0100093d00000000001976a9148edb68822f1ad580b043c7b3df2e400f8699eb4888ac00000000"), SER_NETWORK, PROTOCOL_VERSION); + CDataStream stream(ParseHex("0400000088804e46ac93ae538cc4977aa65752be37e5af84cffdbab6d329b907622d324afd2edd33b94f6d28167d53a815af40448150897061caa5ebd85074525a9c2c3100000000000000000000000000000000000000000000000000000000000000006b019457ffff7f200000bfc18df0babc36d4e1d6ef8a6e343c15c3bec1b7b936440f839d99d1000008cf940200d0e6730013b2580060577f00f3c74a0041951001e43707015a1f1b010601000000010000000000000000000000000000000000000000000000000000000000000000ffffffff035e0101ffffffff0283c70a0000000000232102ffa90cf88320e4cbaa282506f6b2c1df39b0fabdcd0ceb685979bb6345acfd95ac98ab02000000000017a9146708e6670db0b950dac68031025cc5b63213a49187000000000100000001a2d8e5984af5f902ce8ee42a431f2211cd92e0347eb8304794bb29a95385eeab000000004847304402200b8b7d29ac534c83d57771215b1af572a96b41283ced1a2a8c3b7258a5687c7c02202e989869b11085745e04d5a23bdcca5e02ef6263270f5b8c55e400a10fcc31ed01feffffff02602c0500000000001976a91482d75bc161b2230c6fbbeb586d10c66c3f962fc288ac10270000000000001976a9142b891e223001d0d68bdbcc9d339057aaaa86f92188ac0200000001000000015339144fde1f417adeabc7d3e8fcf01bee9cc5da5fe7a5f80a93fdd1b69393430000000049483045022100cb6d1d202701d5a13a896048731426f7bddc7c03e85009dc6533709bdbf6e339022056fa5c9cfb60cb5c55af6c90583e079049545c7ec082452b69b7df6bdd322e3501feffffff02b0ef0500000000001976a91457db1edd2585f4140bbcd0d9e27821f04fcca4b688ac10270000000000001976a9142b891e223001d0d68bdbcc9d339057aaaa86f92188ac020000000100000001f503717810123e7f40a6ab13c7866102d137fc2b077dfca39ff61f3879e37ceb0000000049483045022100a4063874bb0ae4710c75ab45d437cc30894bfc89c7bb2ad0cc7739785d25879d02204783c8a6b99f50134539697a7ce86ed80a9f2ea2975c5386e66154b2a6c0a55401feffffff0210270000000000001976a9142b891e223001d0d68bdbcc9d339057aaaa86f92188ac10690400000000001976a914e50a70d55a860cb7e73f7584cff7875ed620919a88ac020000000100000001b077d12d457292c4d8b2e0e853eea6eb19eba20984e0cffc8441ba78111f9b89000000004847304402205ef1baaa781496b89d34aaae4c98b7e36f3235fc91e7e94481ce1b401eae758702200ae0b18264154229fc8d0a63df6737f1be63fe8b50401394f03711bf92d5ea3201feffffff0205b30600000000001976a914aa3f898ea469eb2fc2e404ed145dc53cc586ce9e88ac10270000000000001976a9142b891e223001d0d68bdbcc9d339057aaaa86f92188ac02000000010000000399a7a65dcc321f2586b61d091b663cd68042804b583540924591ae20f4f26cd9000000006a47304402202508bd6e4d2e0c93275beffa034b55f0aabde470147606cedb794534eac4a3c80220098a202bd0863ed621abe251f31b26d01cb5c652d7da51c4ed582f5ff13d0458012103fb660ee1d5341e4e908d8d779af7a5afd05906142cd5f84ff30fc34264408b2dfeffffff1122a4ff1174c6d3e022dd56a0940a2a937bd90493a7b4f2711f75c9a6ecdade000000006a473044022002d71379dd96afb965ae88992b5b809c08805a1235e9ce25737131f08b1f81160220316b075e4f137729023e81b54278baa6cfb3c2dd327e8fff763c255787b347a9012102fd61e686c93ef2881c60b9635d53559445de6ef6cb6ba2f91a7ac11ab6eaff87feffffff21d123d2ea376cd4a671678145e34cf1a3322bd569866d59ca0edf425da0d1cc010000006b483045022100ae2709f53a71a7be9acb46bd2571352bfecf33ddbb0796b87c13884038fed5e20220784b8895c3a3c9784a6184a323f6324d6997e9cfae907bcdd3377a73334cb3370121037c0af65516ad1cd82ff72e3582aea350d98844713ed4088cad27c67ed98a73b7feffffff0210270000000000001976a9142b891e223001d0d68bdbcc9d339057aaaa86f92188ace8530f00000000001976a9142306e76c457f7ba143eb0ecc7dbeb2d493f4b5d088ac02000000"), SER_NETWORK, PROTOCOL_VERSION); stream >> block; CBloomFilter filter(10, 0.000001, 0, BLOOM_UPDATE_ALL); // Match the last transaction - filter.insert(uint256S("0x0a2a92f0bda4727d0a13eaddf4dd9ac6b5c61a1429e6b2b818f19b15df0ac154")); + filter.insert(uint256S("0xa562d78f7a20d11e43fe5eabbcf90a25b60f28cd59363c4250ad3a9024057c9e")); CMerkleBlock merkleBlock(block, filter); BOOST_CHECK(merkleBlock.header.GetHash() == block.GetHash()); @@ -388,8 +405,8 @@ BOOST_AUTO_TEST_CASE(merkle_block_4) BOOST_CHECK(merkleBlock.vMatchedTxn.size() == 1); pair pair = merkleBlock.vMatchedTxn[0]; - BOOST_CHECK(merkleBlock.vMatchedTxn[0].second == uint256S("0x0a2a92f0bda4727d0a13eaddf4dd9ac6b5c61a1429e6b2b818f19b15df0ac154")); - BOOST_CHECK(merkleBlock.vMatchedTxn[0].first == 6); + BOOST_CHECK(merkleBlock.vMatchedTxn[0].second == uint256S("0xa562d78f7a20d11e43fe5eabbcf90a25b60f28cd59363c4250ad3a9024057c9e")); + BOOST_CHECK(merkleBlock.vMatchedTxn[0].first == 5); vector vMatched; BOOST_CHECK(merkleBlock.txn.ExtractMatches(vMatched) == block.hashMerkleRoot); @@ -398,13 +415,13 @@ BOOST_AUTO_TEST_CASE(merkle_block_4) BOOST_CHECK(vMatched[i] == merkleBlock.vMatchedTxn[i].second); // Also match the 4th transaction - filter.insert(uint256S("0x02981fa052f0481dbc5868f4fc2166035a10f27a03cfd2de67326471df5bc041")); + filter.insert(uint256S("0xccd1a05d42df0eca596d8669d52b32a3f14ce345816771a6d46c37ead223d121")); merkleBlock = CMerkleBlock(block, filter); BOOST_CHECK(merkleBlock.header.GetHash() == block.GetHash()); BOOST_CHECK(merkleBlock.vMatchedTxn.size() == 2); - BOOST_CHECK(merkleBlock.vMatchedTxn[0].second == uint256S("0x02981fa052f0481dbc5868f4fc2166035a10f27a03cfd2de67326471df5bc041")); + BOOST_CHECK(merkleBlock.vMatchedTxn[0].second == uint256S("0xccd1a05d42df0eca596d8669d52b32a3f14ce345816771a6d46c37ead223d121")); BOOST_CHECK(merkleBlock.vMatchedTxn[0].first == 3); BOOST_CHECK(merkleBlock.vMatchedTxn[1] == pair); @@ -417,25 +434,25 @@ BOOST_AUTO_TEST_CASE(merkle_block_4) BOOST_AUTO_TEST_CASE(merkle_block_4_test_p2pubkey_only) { - // Random real block (000000000000b731f2eef9e8c63173adfb07e41bd53eb0ef0a6b720d6cb6dea4) - // With 7 txes + // Random zcash block (3c182421c55619ac838153e0332f1eb78ca01320a37df09ff52959b535813e44) + // With 6 txes CBlock block; - CDataStream stream(ParseHex("0100000082bb869cf3a793432a66e826e05a6fc37469f8efb7421dc880670100000000007f16c5962e8bd963659c793ce370d95f093bc7e367117b3c30c1f8fdd0d9728776381b4d4c86041b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000554b8529000701000000010000000000000000000000000000000000000000000000000000000000000000ffffffff07044c86041b0136ffffffff0100f2052a01000000434104eaafc2314def4ca98ac970241bcab022b9c1e1f4ea423a20f134c876f2c01ec0f0dd5b2e86e7168cefe0d81113c3807420ce13ad1357231a2252247d97a46a91ac000000000100000001bcad20a6a29827d1424f08989255120bf7f3e9e3cdaaa6bb31b0737fe048724300000000494830450220356e834b046cadc0f8ebb5a8a017b02de59c86305403dad52cd77b55af062ea10221009253cd6c119d4729b77c978e1e2aa19f5ea6e0e52b3f16e32fa608cd5bab753901ffffffff02008d380c010000001976a9142b4b8072ecbba129b6453c63e129e643207249ca88ac0065cd1d000000001976a9141b8dd13b994bcfc787b32aeadf58ccb3615cbd5488ac000000000100000003fdacf9b3eb077412e7a968d2e4f11b9a9dee312d666187ed77ee7d26af16cb0b000000008c493046022100ea1608e70911ca0de5af51ba57ad23b9a51db8d28f82c53563c56a05c20f5a87022100a8bdc8b4a8acc8634c6b420410150775eb7f2474f5615f7fccd65af30f310fbf01410465fdf49e29b06b9a1582287b6279014f834edc317695d125ef623c1cc3aaece245bd69fcad7508666e9c74a49dc9056d5fc14338ef38118dc4afae5fe2c585caffffffff309e1913634ecb50f3c4f83e96e70b2df071b497b8973a3e75429df397b5af83000000004948304502202bdb79c596a9ffc24e96f4386199aba386e9bc7b6071516e2b51dda942b3a1ed022100c53a857e76b724fc14d45311eac5019650d415c3abb5428f3aae16d8e69bec2301ffffffff2089e33491695080c9edc18a428f7d834db5b6d372df13ce2b1b0e0cbcb1e6c10000000049483045022100d4ce67c5896ee251c810ac1ff9ceccd328b497c8f553ab6e08431e7d40bad6b5022033119c0c2b7d792d31f1187779c7bd95aefd93d90a715586d73801d9b47471c601ffffffff0100714460030000001976a914c7b55141d097ea5df7a0ed330cf794376e53ec8d88ac0000000001000000045bf0e214aa4069a3e792ecee1e1bf0c1d397cde8dd08138f4b72a00681743447000000008b48304502200c45de8c4f3e2c1821f2fc878cba97b1e6f8807d94930713aa1c86a67b9bf1e40221008581abfef2e30f957815fc89978423746b2086375ca8ecf359c85c2a5b7c88ad01410462bb73f76ca0994fcb8b4271e6fb7561f5c0f9ca0cf6485261c4a0dc894f4ab844c6cdfb97cd0b60ffb5018ffd6238f4d87270efb1d3ae37079b794a92d7ec95ffffffffd669f7d7958d40fc59d2253d88e0f248e29b599c80bbcec344a83dda5f9aa72c000000008a473044022078124c8beeaa825f9e0b30bff96e564dd859432f2d0cb3b72d3d5d93d38d7e930220691d233b6c0f995be5acb03d70a7f7a65b6bc9bdd426260f38a1346669507a3601410462bb73f76ca0994fcb8b4271e6fb7561f5c0f9ca0cf6485261c4a0dc894f4ab844c6cdfb97cd0b60ffb5018ffd6238f4d87270efb1d3ae37079b794a92d7ec95fffffffff878af0d93f5229a68166cf051fd372bb7a537232946e0a46f53636b4dafdaa4000000008c493046022100c717d1714551663f69c3c5759bdbb3a0fcd3fab023abc0e522fe6440de35d8290221008d9cbe25bffc44af2b18e81c58eb37293fd7fe1c2e7b46fc37ee8c96c50ab1e201410462bb73f76ca0994fcb8b4271e6fb7561f5c0f9ca0cf6485261c4a0dc894f4ab844c6cdfb97cd0b60ffb5018ffd6238f4d87270efb1d3ae37079b794a92d7ec95ffffffff27f2b668859cd7f2f894aa0fd2d9e60963bcd07c88973f425f999b8cbfd7a1e2000000008c493046022100e00847147cbf517bcc2f502f3ddc6d284358d102ed20d47a8aa788a62f0db780022100d17b2d6fa84dcaf1c95d88d7e7c30385aecf415588d749afd3ec81f6022cecd701410462bb73f76ca0994fcb8b4271e6fb7561f5c0f9ca0cf6485261c4a0dc894f4ab844c6cdfb97cd0b60ffb5018ffd6238f4d87270efb1d3ae37079b794a92d7ec95ffffffff0100c817a8040000001976a914b6efd80d99179f4f4ff6f4dd0a007d018c385d2188ac000000000100000001834537b2f1ce8ef9373a258e10545ce5a50b758df616cd4356e0032554ebd3c4000000008b483045022100e68f422dd7c34fdce11eeb4509ddae38201773dd62f284e8aa9d96f85099d0b002202243bd399ff96b649a0fad05fa759d6a882f0af8c90cf7632c2840c29070aec20141045e58067e815c2f464c6a2a15f987758374203895710c2d452442e28496ff38ba8f5fd901dc20e29e88477167fe4fc299bf818fd0d9e1632d467b2a3d9503b1aaffffffff0280d7e636030000001976a914f34c3e10eb387efe872acb614c89e78bfca7815d88ac404b4c00000000001976a914a84e272933aaf87e1715d7786c51dfaeb5b65a6f88ac00000000010000000143ac81c8e6f6ef307dfe17f3d906d999e23e0189fda838c5510d850927e03ae7000000008c4930460221009c87c344760a64cb8ae6685a3eec2c1ac1bed5b88c87de51acd0e124f266c16602210082d07c037359c3a257b5c63ebd90f5a5edf97b2ac1c434b08ca998839f346dd40141040ba7e521fa7946d12edbb1d1e95a15c34bd4398195e86433c92b431cd315f455fe30032ede69cad9d1e1ed6c3c4ec0dbfced53438c625462afb792dcb098544bffffffff0240420f00000000001976a9144676d1b820d63ec272f1900d59d43bc6463d96f888ac40420f00000000001976a914648d04341d00d7968b3405c034adc38d4d8fb9bd88ac00000000010000000248cc917501ea5c55f4a8d2009c0567c40cfe037c2e71af017d0a452ff705e3f1000000008b483045022100bf5fdc86dc5f08a5d5c8e43a8c9d5b1ed8c65562e280007b52b133021acd9acc02205e325d613e555f772802bf413d36ba807892ed1a690a77811d3033b3de226e0a01410429fa713b124484cb2bd7b5557b2c0b9df7b2b1fee61825eadc5ae6c37a9920d38bfccdc7dc3cb0c47d7b173dbc9db8d37db0a33ae487982c59c6f8606e9d1791ffffffff41ed70551dd7e841883ab8f0b16bf04176b7d1480e4f0af9f3d4c3595768d068000000008b4830450221008513ad65187b903aed1102d1d0c47688127658c51106753fed0151ce9c16b80902201432b9ebcb87bd04ceb2de66035fbbaf4bf8b00d1cfe41f1a1f7338f9ad79d210141049d4cf80125bf50be1709f718c07ad15d0fc612b7da1f5570dddc35f2a352f0f27c978b06820edca9ef982c35fda2d255afba340068c5035552368bc7200c1488ffffffff0100093d00000000001976a9148edb68822f1ad580b043c7b3df2e400f8699eb4888ac00000000"), SER_NETWORK, PROTOCOL_VERSION); + CDataStream stream(ParseHex("04000000b976a3322ee5e9d242dc0b465f5c27fdcf5e292789694ed46531e41e509257059dcff7d722ef68818ac8238e312071dfcc7dc004bcb808f1196c9ba9e32fed450000000000000000000000000000000000000000000000000000000000000000675a94575b297620010080cd55554a4c899735a7d13984e7b20959398ffc253a3e540d2c0645000008d69f170034ebec002551500179097601c8363900b62f4d00f976870072b012010601000000010000000000000000000000000000000000000000000000000000000000000000ffffffff050295000101ffffffff0280cc710000000000232103c5da583f3ee0da22004d314b45e6be77cace71778644260032e11bf981db2d42ac646b1c000000000017a9146708e6670db0b950dac68031025cc5b63213a491870000000001000000024ffa69c67da828de6f0607d33cfbf851c1c75b759d11a791bd7b3ed37cb78a02000000006a47304402204a1a53914484608f77a6b2a8263321df466585cc7b7fe83efb020a756e3de67402200c3f8f4067b7a7e4bd69e3e470c863c1cccde825dc95f065bc64fd4f0fd57770012102e1234490210e241ff92318a602b03c9f96e61e48cefc308d09ce8e4d89aa826efeffffff6b2b1e73383909bb5166fd7480c6e320510a81d7314edb72cbc5c548fb35439e000000004847304402200324ce69f57ad21500c4e63ddb51e2bcbf8bb16c5dbf935292c52f19d72f8fcb02207542fd826f72803cf37fe7cbf3559bbc26291754141983ca3d8d47e31f8e4a3e01feffffff02e0930400000000001976a914b444970f859e4deba8942c7fc3fea7126b10497888ac76971000000000001976a914c471e3193347fa63e6e6654097aa16b341d76bca88ac890000000100000001388af1a41c9c99286e272124e32fbc5c1f4af7f55b9a9198dffb6dace9ec33ab00000000494830450221008d6e09b6edf96bbbe53a29527db12eede18f50edb5b7b561c9ab5d48ece3d22a02202c94705e6eeb22b2721ca6ed5876b49f01cd9be461805211d6421ee78f3a0d4b01feffffff02dd4a0f00000000001976a914f35f951a3bc9abb208046df56f34dfe08e23a0fa88ac801a0600000000001976a91472dd7e185c3f069223560a1df310c81d4d12804c88ac890000000100000002032108d0cabea40dccb01020f6e28b747ce9e02312301de9633b58deb022e039000000004847304402200cb4558d6ca6fae452e2972b464944f4c5c0db190e7c4e89c504b52fcbc3d83602203bb3a0e861dae27dbec077fe58aa25272303bb1df4f542b8dda3522bc6d763d901feffffff1edf71037dbc7f30406afe7a0bc1577dd4e9bf460c4c7bddf48ab1e6e855b08f010000006b483045022100af83a715b4a1d2a1d72736e4705b1bc2b3270fd77451db27478f851031416f6b02201dd22bde30b1ba3e7e31044a53ddcd8ed5d82f552dc547a3cc099debaae05bb4012102319fecfd88d7872bd1298222a0b45567da9ff3af29cf890ee60b2b10192bfaf5feffffff02a0860100000000001976a91472dd7e185c3f069223560a1df310c81d4d12804c88acac620f00000000001976a914c3da60b701d2e0b4d31566301c9c9f5071f01bc188ac89000000010000000125c2dae4318d08dd07a3cd3bed9c7de519e0eee0f210f630c2753208f234f51b0000000049483045022100e410502257a92db55a6bfbb7833aef74e9e48c1a4b02037ab837305c4476599b02207b0c33e54a717105a6e80003276a7f63dea9b7db2cef2578cb6b986d8e4d838401feffffff0270881100000000001976a91412517b5217b2c1700d92f9b8aad67453e24e3c5888aca0860100000000001976a914b444970f859e4deba8942c7fc3fea7126b10497888ac890000000100000002aa0a10864e11d225322564862705caf4cb6c30c928793278483a4f5f638779d0000000006b4830450221009530514326b8de4ba1aebd06b5f74903fb3550d846047677b3e882bc379cfa7602203b57f2bd869e7e1d7217b2139ffa8a491ed3c07d01c832389ce01ec99dbccf10012102ce64b6712044dae5a45b4167a28a746ba2053b300ad1eae2f873a7b93ba4417efeffffffc88a41b10c0e433a90d99b4435b8281deb830a6a25eb8dff8194e48910a39bf0010000006b483045022100d0de362b1b8d4e3d7005bd13f870d7cd5872a39bb2371c2f3b60df893147b827022030999f2355ce3f5da6be0dd2bb74b7521271e76e4182b91934a4b25ed6d03ac1012103e0a3402c211ee59bd3a3f5213db04ccda564276b607271e87f6dd58f697b65a7feffffff027f580f00000000001976a9145733181088dfc1f3ca8a77126a3beb06fc72dd5888ace0930400000000001976a91472dd7e185c3f069223560a1df310c81d4d12804c88ac89000000"), SER_NETWORK, PROTOCOL_VERSION); stream >> block; CBloomFilter filter(10, 0.000001, 0, BLOOM_UPDATE_P2PUBKEY_ONLY); // Match the generation pubkey - filter.insert(ParseHex("04eaafc2314def4ca98ac970241bcab022b9c1e1f4ea423a20f134c876f2c01ec0f0dd5b2e86e7168cefe0d81113c3807420ce13ad1357231a2252247d97a46a91")); + filter.insert(ParseHex("03c5da583f3ee0da22004d314b45e6be77cace71778644260032e11bf981db2d42")); // ...and the output address of the 4th transaction - filter.insert(ParseHex("b6efd80d99179f4f4ff6f4dd0a007d018c385d21")); + filter.insert(ParseHex("72dd7e185c3f069223560a1df310c81d4d12804c")); CMerkleBlock merkleBlock(block, filter); BOOST_CHECK(merkleBlock.header.GetHash() == block.GetHash()); // We should match the generation outpoint - BOOST_CHECK(filter.contains(COutPoint(uint256S("0x147caa76786596590baa4e98f5d9f48b86c7765e489f7a6ff3360fe5c674360b"), 0))); + BOOST_CHECK(filter.contains(COutPoint(uint256S("0xdebdc61ca196e4a84bb5eedf07600af651d8bf351b04b592243319286f064f80"), 0))); // ... but not the 4th transaction's output (its not pay-2-pubkey) - BOOST_CHECK(!filter.contains(COutPoint(uint256S("0x02981fa052f0481dbc5868f4fc2166035a10f27a03cfd2de67326471df5bc041"), 0))); + BOOST_CHECK(!filter.contains(COutPoint(uint256S("0x8920162c922789d3e44a2c4a9321f1e1c7fd31c665083bf2728b60ea6925140c"), 0))); } BOOST_AUTO_TEST_CASE(merkle_block_4_test_update_none) From 3574c9251fc6b977022e7b9f1d3c4de9ef5683bb Mon Sep 17 00:00:00 2001 From: Simon Date: Mon, 25 Jul 2016 01:11:47 -0700 Subject: [PATCH 05/16] Updated test data for script_tests by uncommenting UPDATE_JSON_TESTS flag. --- src/test/data/script_invalid.json | 86 ++++++++++++++----------------- src/test/data/script_valid.json | 62 +++++++++++----------- 2 files changed, 71 insertions(+), 77 deletions(-) diff --git a/src/test/data/script_invalid.json b/src/test/data/script_invalid.json index 7afa2abf4..eb3fb4a1c 100644 --- a/src/test/data/script_invalid.json +++ b/src/test/data/script_invalid.json @@ -534,97 +534,97 @@ ["Automatically generated test cases"], [ - "0x47 0x304402200a5c6163f07b8c3b013c4d1d6dba25e780b39658d79ba37af7057a3b7f15ffa102201fd9b4eaa9943f734928b99a83592c2e7bf342ea2680f6a2bb705167966b742001", + "0x47 0x3044022028704302bdbc0851b707a947fc76b0bc833fe73d105f6b65917993b6ba739052022056e4d465960125cd226963137b93c31e5831af98f3250bacae1245fa882f837801", "0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG", "", "P2PK, bad sig" ], [ - "0x47 0x3044022034bb0494b50b8ef130e2185bb220265b9284ef5b4b8a8da4d8415df489c83b5102206259a26d9cc0a125ac26af6153b17c02956855ebe1467412f066e402f5f05d1201 0x21 0x03363d90d446b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640", + "0x47 0x304402202a5d85a6578cd4fb1d64679f789407858031de1ae379d5c7f585e4d24cd8aaea02204f42378166158cf4b7c55f32b414e66ea393e00ac8bf08bf419bfa3d4b3bfa8c01 0x21 0x03363d90d446b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640", "DUP HASH160 0x14 0xc0834c0c158f53be706d234c38fd52de7eece656 EQUALVERIFY CHECKSIG", "", "P2PKH, bad pubkey" ], [ - "0x47 0x304402204710a85181663b32d25c70ec2bbd14adff5ddfff6cb50d09e155ef5f541fc86c0220056b0cc949be9386ecc5f6c2ac0493269031dbb185781db90171b54ac127790201", + "0x47 0x304402200e963b830cc61b8e80915c2c72dad1358807d33554daf114fa5859f2a741c006022000a81f1c8e223c5a459ff99addf9e04ae5492181ec8e947fc6f49c315e49570e01", "0x41 0x048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf CHECKSIG", "", "P2PK anyonecanpay marked with normal hashtype" ], [ - "0x47 0x3044022003fef42ed6c7be8917441218f525a60e2431be978e28b7aca4d7a532cc413ae8022067a1f82c74e8d69291b90d148778405c6257bbcfc2353cc38a3e1f22bf44254601 0x23 0x210279be667ef9dcbbac54a06295ce870b07029bfcdb2dce28d959f2815b16f81798ac", + "0x47 0x3044022039e3b7051329e12e23ec00f9ae70c1e317beb718da52e7988776d44b4911173702200fb94de60deb6d6a440fc119f00127e731cdbe5760aa7fffdbf5f3da2d07569801 0x23 0x210279be667ef9dcbbac54a06295ce870b07029bfcdb2dce28d959f2815b16f81798ac", "HASH160 0x14 0x23b0ad3477f2178bc0b3eed26e4e6316f4e83aa1 EQUAL", "P2SH", "P2SH(P2PK), bad redeemscript" ], [ - "0x47 0x304402204e2eb034be7b089534ac9e798cf6a2c79f38bcb34d1b179efd6f2de0841735db022071461beb056b5a7be1819da6a3e3ce3662831ecc298419ca101eb6887b5dd6a401 0x19 0x76a9147cf9c846cd4882efec4bf07e44ebdad495c94f4b88ac", + "0x47 0x30440220555e138776dbd4d7592df35989d8265858b0137b54118d700edb9cf83d42ec660220224f766b9956b380ea8f853a6832bf14bcd42514159080dd90f21d27cbe61d1201 0x19 0x76a9147cf9c846cd4882efec4bf07e44ebdad495c94f4b88ac", "HASH160 0x14 0x2df519943d5acc0ef5222091f9dfe3543f489a82 EQUAL", "P2SH", "P2SH(P2PKH), bad sig" ], [ - "0 0x47 0x3044022051254b9fb476a52d85530792b578f86fea70ec1ffb4393e661bcccb23d8d63d3022076505f94a403c86097841944e044c70c2045ce90e36de51f7e9d3828db98a07501 0x47 0x304402200a358f750934b3feb822f1966bfcd8bbec9eeaa3a8ca941e11ee5960e181fa01022050bf6b5a8e7750f70354ae041cb68a7bade67ec6c3ab19eb359638974410626e01 0", + "0 0x47 0x3044022019fa79ee8642d75cc7f89ee4c05610308363c25d459be356d333f5dd276548780220192af34c8fcd2d116c1a3cac43bebc9439de0e3435c3b5c946b7b0c6098a9ab701 0x47 0x304402203f967505faa2f69e3482e63d0c59f6e4b06599f59e7df9558bbb5f976cc190250220572c2a827b6a2ace87475acdc00bfbc4442ecaf6b4f54c489b0a5bd0ffc36d1d01 0", "3 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 3 CHECKMULTISIG", "", "3-of-3, 2 sigs" ], [ - "0 0x47 0x304402205b7d2c2f177ae76cfbbf14d589c113b0b35db753d305d5562dd0b61cbf366cfb02202e56f93c4f08a27f986cd424ffc48a462c3202c4902104d4d0ff98ed28f4bf8001 0 0x4c69 0x52210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f8179821038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f515082103363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff464053ae", + "0 0x47 0x304402201c9f6e207f988e12d688c215fa2f754436cf85a097257cbbb2b5c8ac5e770b2d0220665f8265a950d896cc613194970c89a49c94d1aa8e736ff8dacbe0af8f33a53401 0 0x4c69 0x52210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f8179821038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f515082103363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff464053ae", "HASH160 0x14 0xc9e4a896d149702d0d1695434feddd52e24ad78d EQUAL", "P2SH", "P2SH(2-of-3), 1 sig" ], [ - "0x47 0x304402200060558477337b9022e70534f1fea71a318caf836812465a2509931c5e7c4987022078ec32bd50ac9e03a349ba953dfd9fe1c8d2dd8bdb1d38ddca844d3d5c78c11801", + "0x47 0x30440220000a55d0ce61b3e392a2f6d7331021b26472489174bb8c2ad8cb6725d3bfeda2022060087e93b5083d99b6a11584d71357e19e251f689715226b2e154817259dde1b01", "0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG", "DERSIG", "P2PK with too much R padding" ], [ - "0x48 0x304502202de8c03fc525285c9c535631019a5f2af7c6454fa9eb392a3756a4917c420edd02210046130bf2baf7cfc065067c8b9e33a066d9c15edcea9feb0ca2d233e3597925b401", + "0x48 0x3045022030e7ea75f00a73608db820ba645a066e3fccf09dbb315a0a1d7e8773afcb9ab7022100505fea7b5dc292a43e8d1e6468bdd6c3269012cd05106be015ea14ca7cb4bba401", "0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG", "DERSIG", "P2PK with too much S padding" ], [ - "0x47 0x30440220d7a0417c3f6d1a15094d1cf2a3378ca0503eb8a57630953a9e2987e21ddd0a6502207a6266d686c99090920249991d3d42065b6d43eb70187b219c0db82e4f94d1a201", + "0x47 0x30440220f392c3fc0b257a8d6ad64a070c40ddd11a0f8f4ecc8e05f6719a2934900e71df0220139e1bf8052713895cda2f843dde585abc05a7f07d4931dd5c1dbb8c7d94909101", "0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG", "DERSIG", "P2PK with too little R padding" ], [ - "0x47 0x30440220005ece1335e7f757a1a1f476a7fb5bd90964e8a022489f890614a04acfb734c002206c12b8294a6513c7710e8c82d3c23d75cdbfe83200eb7efb495701958501a5d601", + "0x47 0x304402200052768d9f59125f9006926e19f464692107c21b3e6d4d020ddf957b4f115f770220629111f4f57822dc77d355586921daf39020353752dbd4b4d0ed161964b1255401", "0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 CHECKSIG NOT", "DERSIG", "P2PK NOT with bad sig with too much R padding" ], [ - "0x47 0x30440220005ece1335e7f657a1a1f476a7fb5bd90964e8a022489f890614a04acfb734c002206c12b8294a6513c7710e8c82d3c23d75cdbfe83200eb7efb495701958501a5d601", + "0x47 0x304402200052768d9f59135f9006926e19f464692107c21b3e6d4d020ddf957b4f115f770220629111f4f57822dc77d355586921daf39020353752dbd4b4d0ed161964b1255401", "0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 CHECKSIG NOT", "", "P2PK NOT with too much R padding but no DERSIG" ], [ - "0x47 0x30440220005ece1335e7f657a1a1f476a7fb5bd90964e8a022489f890614a04acfb734c002206c12b8294a6513c7710e8c82d3c23d75cdbfe83200eb7efb495701958501a5d601", + "0x47 0x304402200052768d9f59135f9006926e19f464692107c21b3e6d4d020ddf957b4f115f770220629111f4f57822dc77d355586921daf39020353752dbd4b4d0ed161964b1255401", "0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 CHECKSIG NOT", "DERSIG", "P2PK NOT with too much R padding" ], [ - "0x47 0x30440220d7a0417c3f6d1a15094d1cf2a3378ca0503eb8a57630953a9e2987e21ddd0a6502207a6266d686c99090920249991d3d42065b6d43eb70187b219c0db82e4f94d1a201", + "0x47 0x30440220f392c3fc0b257a8d6ad64a070c40ddd11a0f8f4ecc8e05f6719a2934900e71df0220139e1bf8052713895cda2f843dde585abc05a7f07d4931dd5c1dbb8c7d94909101", "0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG", "DERSIG", "BIP66 example 1, with DERSIG" ], [ - "0x47 0x304402208e43c0b91f7c1e5bc58e41c8185f8a6086e111b0090187968a86f2822462d3c902200a58f4076b1133b18ff1dc83ee51676e44c60cc608d9534e0df5ace0424fc0be01", + "0x47 0x30440220cbeef9619105f2f7b4915edc6be74b21581c580358c8db05af4eb55c999c0aa1022047a1c5a5fa8dcb18da7535aa37c75671847042449fb708e3fd2c85a7a874c07401", "0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG NOT", "", "BIP66 example 2, without DERSIG" ], [ - "0x47 0x304402208e43c0b91f7c1e5bc58e41c8185f8a6086e111b0090187968a86f2822462d3c902200a58f4076b1133b18ff1dc83ee51676e44c60cc608d9534e0df5ace0424fc0be01", + "0x47 0x30440220cbeef9619105f2f7b4915edc6be74b21581c580358c8db05af4eb55c999c0aa1022047a1c5a5fa8dcb18da7535aa37c75671847042449fb708e3fd2c85a7a874c07401", "0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG NOT", "DERSIG", "BIP66 example 2, with DERSIG" @@ -660,151 +660,145 @@ "BIP66 example 6, with DERSIG" ], [ - "0 0x47 0x30440220cae00b1444babfbf6071b0ba8707f6bd373da3df494d6e74119b0430c5db810502205d5231b8c5939c8ff0c82242656d6e06edb073d42af336c99fe8837c36ea39d501 0x47 0x3044022027c2714269ca5aeecc4d70edc88ba5ee0e3da4986e9216028f489ab4f1b8efce022022bd545b4951215267e4c5ceabd4c5350331b2e4a0b6494c56f361fa5a57a1a201", + "0 0x47 0x30440220959b3fa55bcbc510291af8f090ba5a17ee308f733f471bb382b8a23988a7d0500220770e10f776857775a4cc544718e1f3ce50521cfcafebf8936ffacb7b6284629e01 0x47 0x304402206ef1151dc2c72e3f57dc9185d5755808367fb57c2c65c8df55d82e6d8e89b6f8022050dff5f4a6055b9b26640f9fcdb05290d7d82008ab934b126cae78abdc2f2a2001", "2 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 2 CHECKMULTISIG", "DERSIG", "BIP66 example 7, with DERSIG" ], [ - "0 0x47 0x30440220b119d67d389315308d1745f734a51ff3ec72e06081e84e236fdf9dc2f5d2a64802204b04e3bc38674c4422ea317231d642b56dc09d214a1ecbbf16ecca01ed996e2201 0x47 0x3044022079ea80afd538d9ada421b5101febeb6bc874e01dde5bca108c1d0479aec339a4022004576db8f66130d1df686ccf00935703689d69cf539438da1edab208b0d63c4801", + "0 0x47 0x30440220ef225ea223236e01fd726d26d69fcb40b39df836cde25881e11848b80714d6c002205d7d8e091fc16a0d5e8b4785312466c5e8080b862534f94a9c70f24ac0ff496c01 0x47 0x304402206dbb0c04f6c25a99926ee88d7efa8090b5214291d08e3c04fabf631df2d4f191022023e7a95e76fd196bbf36407222995976f0c3fcb2c15f44b4e141f3289d54991d01", "2 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 2 CHECKMULTISIG NOT", "", "BIP66 example 8, without DERSIG" ], [ - "0 0x47 0x30440220b119d67d389315308d1745f734a51ff3ec72e06081e84e236fdf9dc2f5d2a64802204b04e3bc38674c4422ea317231d642b56dc09d214a1ecbbf16ecca01ed996e2201 0x47 0x3044022079ea80afd538d9ada421b5101febeb6bc874e01dde5bca108c1d0479aec339a4022004576db8f66130d1df686ccf00935703689d69cf539438da1edab208b0d63c4801", + "0 0x47 0x30440220ef225ea223236e01fd726d26d69fcb40b39df836cde25881e11848b80714d6c002205d7d8e091fc16a0d5e8b4785312466c5e8080b862534f94a9c70f24ac0ff496c01 0x47 0x304402206dbb0c04f6c25a99926ee88d7efa8090b5214291d08e3c04fabf631df2d4f191022023e7a95e76fd196bbf36407222995976f0c3fcb2c15f44b4e141f3289d54991d01", "2 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 2 CHECKMULTISIG NOT", "DERSIG", "BIP66 example 8, with DERSIG" ], [ - "0 0 0x47 0x3044022081aa9d436f2154e8b6d600516db03d78de71df685b585a9807ead4210bd883490220534bb6bdf318a419ac0749660b60e78d17d515558ef369bf872eff405b676b2e01", + "0 0 0x47 0x304402208bbf6eaf54a87a4445ca13d4448ad418295cf287ba600acfd296298da1993d740220090882b857284d80ab6707b455a3296552535df8e35d10c0a3914b50a078775501", "2 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 2 CHECKMULTISIG", "", "BIP66 example 9, without DERSIG" ], [ - "0 0 0x47 0x3044022081aa9d436f2154e8b6d600516db03d78de71df685b585a9807ead4210bd883490220534bb6bdf318a419ac0749660b60e78d17d515558ef369bf872eff405b676b2e01", + "0 0 0x47 0x304402208bbf6eaf54a87a4445ca13d4448ad418295cf287ba600acfd296298da1993d740220090882b857284d80ab6707b455a3296552535df8e35d10c0a3914b50a078775501", "2 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 2 CHECKMULTISIG", "DERSIG", "BIP66 example 9, with DERSIG" ], [ - "0 0 0x47 0x30440220da6f441dc3b4b2c84cfa8db0cd5b34ed92c9e01686de5a800d40498b70c0dcac02207c2cf91b0c32b860c4cd4994be36cfb84caf8bb7c3a8e4d96a31b2022c5299c501", + "0 0 0x47 0x30440220baaa8a49e8a96778a462eb8f2eae31ccb544e432b34662a5602ece12f20bf64f022007019c21e05b796e87b4b56e82903aae79e8efec190d4d834a551a406118b64601", "2 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 2 CHECKMULTISIG NOT", "DERSIG", "BIP66 example 10, with DERSIG" ], [ - "0 0x47 0x30440220cae00b1444babfbf6071b0ba8707f6bd373da3df494d6e74119b0430c5db810502205d5231b8c5939c8ff0c82242656d6e06edb073d42af336c99fe8837c36ea39d501 0", + "0 0x47 0x30440220959b3fa55bcbc510291af8f090ba5a17ee308f733f471bb382b8a23988a7d0500220770e10f776857775a4cc544718e1f3ce50521cfcafebf8936ffacb7b6284629e01 0", "2 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 2 CHECKMULTISIG", "", "BIP66 example 11, without DERSIG" ], [ - "0 0x47 0x30440220cae00b1444babfbf6071b0ba8707f6bd373da3df494d6e74119b0430c5db810502205d5231b8c5939c8ff0c82242656d6e06edb073d42af336c99fe8837c36ea39d501 0", + "0 0x47 0x30440220959b3fa55bcbc510291af8f090ba5a17ee308f733f471bb382b8a23988a7d0500220770e10f776857775a4cc544718e1f3ce50521cfcafebf8936ffacb7b6284629e01 0", "2 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 2 CHECKMULTISIG", "DERSIG", "BIP66 example 11, with DERSIG" ], [ - "0x48 0x304402203e4516da7253cf068effec6b95c41221c0cf3a8e6ccb8cbf1725b562e9afde2c022054e1c258c2981cdfba5df1f46661fb6541c44f77ca0092f3600331abfffb12510101", + "0x48 0x3044022012918460459bc14fc7bd7d5050455b7d71444f48c5890381123fc46ddaf83d3a02202f83c59b73dedc29510acb4f7cce6de9c664e6e606d9a821a422e3e058ec95e80101", "0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 CHECKSIG", "DERSIG", "P2PK with multi-byte hashtype, with DERSIG" ], [ - "0x48 0x304502203e4516da7253cf068effec6b95c41221c0cf3a8e6ccb8cbf1725b562e9afde2c022100ab1e3da73d67e32045a20e0b999e049978ea8d6ee5480d485fcf2ce0d03b2ef001", + "0x48 0x3045022012918460459bc14fc7bd7d5050455b7d71444f48c5890381123fc46ddaf83d3a022100d07c3a648c2123d6aef534b083319214f449f600a86ef81a1baf7aac7749ab5901", "0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 CHECKSIG", "LOW_S", "P2PK with high S" ], [ - "0x47 0x3044022057292e2d4dfe775becdd0a9e6547997c728cdf35390f6a017da56d654d374e4902206b643be2fc53763b4e284845bfea2c597d2dc7759941dce937636c9d341b71ed01", + "0x47 0x3044022028ad19793d4abe04bc99c64523dcd06cb7fb6b9a8eb9b692489f02ba2ca51b4a02201ce5c56dcde293e8e3c011521e3f82ac27fdb5862df09077d002be95ea84841f01", "0x41 0x0679be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG", "STRICTENC", "P2PK with hybrid pubkey" ], [ - "0x47 0x30440220035d554e3153c14950c9993f41c496607a8e24093db0595be7bf875cf64fcf1f02204731c8c4e5daf15e706cec19cdd8f2c5b1d05490e11dab8465ed426569b6e92101", + "0x47 0x304402207a7c44917eff93b8597bf3e5c7abaa01bba9183d926455b394d87a4897d1dac00220339e270e534ecaabbd3e49e59393e7c00b6b8558c29aa6f14aa6c6277c5e244d01", "0x41 0x0679be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG NOT", "", "P2PK NOT with hybrid pubkey but no STRICTENC" ], [ - "0x47 0x30440220035d554e3153c14950c9993f41c496607a8e24093db0595be7bf875cf64fcf1f02204731c8c4e5daf15e706cec19cdd8f2c5b1d05490e11dab8465ed426569b6e92101", + "0x47 0x304402207a7c44917eff93b8597bf3e5c7abaa01bba9183d926455b394d87a4897d1dac00220339e270e534ecaabbd3e49e59393e7c00b6b8558c29aa6f14aa6c6277c5e244d01", "0x41 0x0679be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG NOT", "STRICTENC", "P2PK NOT with hybrid pubkey" ], [ - "0x47 0x30440220035d554e3153c04950c9993f41c496607a8e24093db0595be7bf875cf64fcf1f02204731c8c4e5daf15e706cec19cdd8f2c5b1d05490e11dab8465ed426569b6e92101", + "0x47 0x304402207a7c44917eff92b8597bf3e5c7abaa01bba9183d926455b394d87a4897d1dac00220339e270e534ecaabbd3e49e59393e7c00b6b8558c29aa6f14aa6c6277c5e244d01", "0x41 0x0679be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG NOT", "STRICTENC", "P2PK NOT with invalid hybrid pubkey" ], [ - "0 0x47 0x3044022079c7824d6c868e0e1a273484e28c2654a27d043c8a27f49f52cb72efed0759090220452bbbf7089574fa082095a4fc1b3a16bafcf97a3a34d745fafc922cce66b27201", + "0 0x47 0x304402201a117a26d2d47ad6d83be979810f76751485b05a881afb6a15318a1a020fd09502205d00caa1987524882193e44a0eda65bf2ef7aff482527f248a9a3919d030335601", "1 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x41 0x0679be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 2 CHECKMULTISIG", "STRICTENC", "1-of-2 with the first 1 hybrid pubkey" ], [ - "0x47 0x304402206177d513ec2cda444c021a1f4f656fc4c72ba108ae063e157eb86dc3575784940220666fc66702815d0e5413bb9b1df22aed44f5f1efb8b99d41dd5dc9a5be6d205205", + "0x47 0x30440220220c3ad143cafae0c3c5403270b0c392f5eeb869701130c6a9790f7f1ce8261d02201cbe777ad4e7998b4f78363497eaf8dd4166901daaeb9737ff2b1326b0451a5c05", "0x41 0x048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf CHECKSIG", "STRICTENC", "P2PK with undefined hashtype" ], [ - "0x47 0x304402207409b5b320296e5e2136a7b281a7f803028ca4ca44e2b83eebd46932677725de02202d4eea1c8d3c98e6f42614f54764e6e5e6542e213eb4d079737e9a8b6e9812ec05", + "0x47 0x304402200213672d90b1b99738e6c98f4a0798235b9f726ce1d674d8163fe5dac51b099802203a43ecb279d89dece434dc8d2bbf2347ee4b66147540a2e545c57135fa8d525105", "0x41 0x048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf CHECKSIG NOT", "STRICTENC", "P2PK NOT with invalid sig and undefined hashtype" ], [ - "1 0x47 0x3044022051254b9fb476a52d85530792b578f86fea70ec1ffb4393e661bcccb23d8d63d3022076505f94a403c86097841944e044c70c2045ce90e36de51f7e9d3828db98a07501 0x47 0x304402200a358f750934b3feb822f1966bfcd8bbec9eeaa3a8ca941e11ee5960e181fa01022050bf6b5a8e7750f70354ae041cb68a7bade67ec6c3ab19eb359638974410626e01 0x47 0x304402200955d031fff71d8653221e85e36c3c85533d2312fc3045314b19650b7ae2f81002202a6bb8505e36201909d0921f01abff390ae6b7ff97bbf959f98aedeb0a56730901", + "1 0x47 0x3044022019fa79ee8642d75cc7f89ee4c05610308363c25d459be356d333f5dd276548780220192af34c8fcd2d116c1a3cac43bebc9439de0e3435c3b5c946b7b0c6098a9ab701 0x47 0x304402203f967505faa2f69e3482e63d0c59f6e4b06599f59e7df9558bbb5f976cc190250220572c2a827b6a2ace87475acdc00bfbc4442ecaf6b4f54c489b0a5bd0ffc36d1d01 0x47 0x304402200400c0da6ef02d88af4d9ccdc97e5db3cd0e0f148024805089920c89742637af022040400714f61c99394f68422288b36399fa274561d9e6ca4d0f539cc680360f5d01", "3 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 3 CHECKMULTISIG", "NULLDUMMY", "3-of-3 with nonzero dummy" ], [ - "1 0x47 0x304402201bb2edab700a5d020236df174fefed78087697143731f659bea59642c759c16d022061f42cdbae5bcd3e8790f20bf76687443436e94a634321c16a72aa54cbc7c2ea01 0x47 0x304402204bb4a64f2a6e5c7fb2f07fef85ee56fde5e6da234c6a984262307a20e99842d702206f8303aaba5e625d223897e2ffd3f88ef1bcffef55f38dc3768e5f2e94c923f901 0x47 0x3044022040c2809b71fffb155ec8b82fe7a27f666bd97f941207be4e14ade85a1249dd4d02204d56c85ec525dd18e29a0533d5ddf61b6b1bb32980c2f63edf951aebf7a27bfe01", + "1 0x47 0x304402205ed72cf70a97fbb41a7a75710a843e15f8646993d95209fabdca3a5da51e714102204354e061ba74c65761a2543e4943ecde19e26f84d8ea169f910c7d83cc79d10b01 0x47 0x3044022027a6e542a9b5cc18c81638e836c16da213f959a368cdec1de0a945df59ce84950220349a2e3f4f7eef8b64dc134168ae67ef4e42bb5151ab0e13656249c77278733c01 0x47 0x304402202b747c3dfc7bc63e9e22e40a721fe05cc6356f737c92a427ac77fbde950aa35e02207625f28d3cb4186c5a9d665b0040b8bc59ab2a451b46cb8aa9e8e4c4cadefa3001", "3 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 3 CHECKMULTISIG NOT", "NULLDUMMY", "3-of-3 NOT with invalid sig with nonzero dummy" ], [ - "0 0x47 0x304402200abeb4bd07f84222f474aed558cfbdfc0b4e96cde3c2935ba7098b1ff0bd74c302204a04c1ca67b2a20abee210cf9a21023edccbbf8024b988812634233115c6b73901 DUP", + "0 0x47 0x3044022069335c200a859303ff1ab36c82aea0c0f71f8a841a5db2cd3b443d8ca98c395c02206afafd2571c690511ba64c26e7bb7ebef39967770f27fec0900e212f3992f1f201 DUP", "2 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 2 CHECKMULTISIG", "SIGPUSHONLY", "2-of-2 with two identical keys and sigs pushed using OP_DUP" ], [ - "0x47 0x304402203e4516da7253cf068effec6b95c41221c0cf3a8e6ccb8cbf1725b562e9afde2c022054e1c258c2981cdfba5df1f46661fb6541c44f77ca0092f3600331abfffb125101 0x23 0x2103363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640ac", + "0x47 0x3044022012918460459bc14fc7bd7d5050455b7d71444f48c5890381123fc46ddaf83d3a02202f83c59b73dedc29510acb4f7cce6de9c664e6e606d9a821a422e3e058ec95e801 0x23 0x2103363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640ac", "0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 CHECKSIG", "", "P2SH(P2PK) with non-push scriptSig but no SIGPUSHONLY" ], [ - "0x47 0x304402203e4516da7253cf068effec6b95c41221c0cf3a8e6ccb8cbf1725b562e9afde2c022054e1c258c2981cdfba5df1f46661fb6541c44f77ca0092f3600331abfffb125101 0x23 0x2103363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640ac", + "0x47 0x3044022012918460459bc14fc7bd7d5050455b7d71444f48c5890381123fc46ddaf83d3a02202f83c59b73dedc29510acb4f7cce6de9c664e6e606d9a821a422e3e058ec95e801 0x23 0x2103363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640ac", "0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 CHECKSIG", "SIGPUSHONLY", "P2SH(P2PK) with non-push scriptSig" ], [ - "0 0x47 0x304402205451ce65ad844dbb978b8bdedf5082e33b43cae8279c30f2c74d9e9ee49a94f802203fe95a7ccf74da7a232ee523ef4a53cb4d14bdd16289680cdb97a63819b8f42f01 0x46 0x304402205451ce65ad844dbb978b8bdedf5082e33b43cae8279c30f2c74d9e9ee49a94f802203fe95a7ccf74da7a232ee523ef4a53cb4d14bdd16289680cdb97a63819b8f42f", - "2 0x21 0x02a673638cb9587cb68ea08dbef685c6f2d2a751a8b3c6f2a7e9a4999e6e4bfaf5 0x21 0x02a673638cb9587cb68ea08dbef685c6f2d2a751a8b3c6f2a7e9a4999e6e4bfaf5 0x21 0x02a673638cb9587cb68ea08dbef685c6f2d2a751a8b3c6f2a7e9a4999e6e4bfaf5 3 CHECKMULTISIG", - "P2SH,STRICTENC", - "2-of-3 with one valid and one invalid signature due to parse error, nSigs > validSigs" -], -[ - "11 0x47 0x304402200a5c6163f07b8d3b013c4d1d6dba25e780b39658d79ba37af7057a3b7f15ffa102201fd9b4eaa9943f734928b99a83592c2e7bf342ea2680f6a2bb705167966b742001", + "11 0x47 0x3044022028704302bdbc0951b707a947fc76b0bc833fe73d105f6b65917993b6ba739052022056e4d465960125cd226963137b93c31e5831af98f3250bacae1245fa882f837801", "0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG", "CLEANSTACK,P2SH", "P2PK with unnecessary input" ], [ - "11 0x47 0x304402202f7505132be14872581f35d74b759212d9da40482653f1ffa3116c3294a4a51702206adbf347a2240ca41c66522b1a22a41693610b76a8e7770645dc721d1635854f01 0x43 0x410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8ac", + "11 0x47 0x30440220785cd94c2ff5079a1423af355053c56c6a252f6806e3a6539f168709fbee533202203ba85578f85448a9ee4eb4c38e26b76367d992002eece1018273f043639ce06a01 0x43 0x410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8ac", "HASH160 0x14 0x31edc23bdafda4639e669f89ad6b2318dd79d032 EQUAL", "CLEANSTACK,P2SH", "P2SH with unnecessary input" diff --git a/src/test/data/script_valid.json b/src/test/data/script_valid.json index a4e15faea..6f3d4143e 100644 --- a/src/test/data/script_valid.json +++ b/src/test/data/script_valid.json @@ -703,73 +703,73 @@ ["Automatically generated test cases"], [ - "0x47 0x304402200a5c6163f07b8d3b013c4d1d6dba25e780b39658d79ba37af7057a3b7f15ffa102201fd9b4eaa9943f734928b99a83592c2e7bf342ea2680f6a2bb705167966b742001", + "0x47 0x3044022028704302bdbc0951b707a947fc76b0bc833fe73d105f6b65917993b6ba739052022056e4d465960125cd226963137b93c31e5831af98f3250bacae1245fa882f837801", "0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG", "", "P2PK" ], [ - "0x47 0x304402206e05a6fe23c59196ffe176c9ddc31e73a9885638f9d1328d47c0c703863b8876022076feb53811aa5b04e0e79f938eb19906cc5e67548bc555a8e8b8b0fc603d840c01 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508", + "0x47 0x304402207ac319831b4c09cb1e7c122be879aa50cdb026d325334ef0e0d6d8d367a95892022066a2da5719283fb94370e97829afb8578aeb76adb32cd67776a435e8bcbdc5cf01 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508", "DUP HASH160 0x14 0x1018853670f9f3b0582c5b9ee8ce93764ac32b93 EQUALVERIFY CHECKSIG", "", "P2PKH" ], [ - "0x47 0x304402204710a85181663b32d25c70ec2bbd14adff5ddfff6cb50d09e155ef5f541fc86c0220056b0cc949be9386ecc5f6c2ac0493269031dbb185781db90171b54ac127790281", + "0x47 0x304402200e963b830cc61b8e80915c2c72dad1358807d33554daf114fa5859f2a741c006022000a81f1c8e223c5a459ff99addf9e04ae5492181ec8e947fc6f49c315e49570e81", "0x41 0x048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf CHECKSIG", "", "P2PK anyonecanpay" ], [ - "0x47 0x3044022003fef42ed6c7be8917441218f525a60e2431be978e28b7aca4d7a532cc413ae8022067a1f82c74e8d69291b90d148778405c6257bbcfc2353cc38a3e1f22bf44254601 0x23 0x210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798ac", + "0x47 0x3044022039e3b7051329e12e23ec00f9ae70c1e317beb718da52e7988776d44b4911173702200fb94de60deb6d6a440fc119f00127e731cdbe5760aa7fffdbf5f3da2d07569801 0x23 0x210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798ac", "HASH160 0x14 0x23b0ad3477f2178bc0b3eed26e4e6316f4e83aa1 EQUAL", "P2SH", "P2SH(P2PK)" ], [ - "0x47 0x304402204e2eb034be7b089534ac9e798cf6a2c79f38bcb34d1b179efd6f2de0841735db022071461beb056b5a7be1819da6a3e3ce3662831ecc298419ca101eb6887b5dd6a401 0x19 0x76a9147cf9c846cd4882efec4bf07e44ebdad495c94f4b88ac", + "0x47 0x30440220555e138776dbd4d7592df35989d8265858b0137b54118d700edb9cf83d42ec660220224f766b9956b380ea8f853a6832bf14bcd42514159080dd90f21d27cbe61d1201 0x19 0x76a9147cf9c846cd4882efec4bf07e44ebdad495c94f4b88ac", "HASH160 0x14 0x2df519943d5acc0ef5222091f9dfe3543f489a82 EQUAL", "", "P2SH(P2PKH), bad sig but no VERIFY_P2SH" ], [ - "0 0x47 0x3044022051254b9fb476a52d85530792b578f86fea70ec1ffb4393e661bcccb23d8d63d3022076505f94a403c86097841944e044c70c2045ce90e36de51f7e9d3828db98a07501 0x47 0x304402200a358f750934b3feb822f1966bfcd8bbec9eeaa3a8ca941e11ee5960e181fa01022050bf6b5a8e7750f70354ae041cb68a7bade67ec6c3ab19eb359638974410626e01 0x47 0x304402200955d031fff71d8653221e85e36c3c85533d2312fc3045314b19650b7ae2f81002202a6bb8505e36201909d0921f01abff390ae6b7ff97bbf959f98aedeb0a56730901", + "0 0x47 0x3044022019fa79ee8642d75cc7f89ee4c05610308363c25d459be356d333f5dd276548780220192af34c8fcd2d116c1a3cac43bebc9439de0e3435c3b5c946b7b0c6098a9ab701 0x47 0x304402203f967505faa2f69e3482e63d0c59f6e4b06599f59e7df9558bbb5f976cc190250220572c2a827b6a2ace87475acdc00bfbc4442ecaf6b4f54c489b0a5bd0ffc36d1d01 0x47 0x304402200400c0da6ef02d88af4d9ccdc97e5db3cd0e0f148024805089920c89742637af022040400714f61c99394f68422288b36399fa274561d9e6ca4d0f539cc680360f5d01", "3 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 3 CHECKMULTISIG", "", "3-of-3" ], [ - "0 0x47 0x304402205b7d2c2f177ae76cfbbf14d589c113b0b35db753d305d5562dd0b61cbf366cfb02202e56f93c4f08a27f986cd424ffc48a462c3202c4902104d4d0ff98ed28f4bf8001 0x47 0x30440220563e5b3b1fc11662a84bc5ea2a32cc3819703254060ba30d639a1aaf2d5068ad0220601c1f47ddc76d93284dd9ed68f7c9974c4a0ea7cbe8a247d6bc3878567a5fca01 0x4c69 0x52210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f8179821038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f515082103363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff464053ae", + "0 0x47 0x304402201c9f6e207f988e12d688c215fa2f754436cf85a097257cbbb2b5c8ac5e770b2d0220665f8265a950d896cc613194970c89a49c94d1aa8e736ff8dacbe0af8f33a53401 0x47 0x30440220635cafa87f41567435d0528559a3d4ff89d707f592bf6c54083777a584e3ba900220746fa1c7a1f0e441b629095e16fcf71111825a9d3d14d7068c3d82a491115ac701 0x4c69 0x52210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f8179821038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f515082103363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff464053ae", "HASH160 0x14 0xc9e4a896d149702d0d1695434feddd52e24ad78d EQUAL", "P2SH", "P2SH(2-of-3)" ], [ - "0x47 0x304402200060558477337b9022e70534f1fea71a318caf836812465a2509931c5e7c4987022078ec32bd50ac9e03a349ba953dfd9fe1c8d2dd8bdb1d38ddca844d3d5c78c11801", + "0x47 0x30440220000a55d0ce61b3e392a2f6d7331021b26472489174bb8c2ad8cb6725d3bfeda2022060087e93b5083d99b6a11584d71357e19e251f689715226b2e154817259dde1b01", "0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG", "", "P2PK with too much R padding but no DERSIG" ], [ - "0x48 0x304502202de8c03fc525285c9c535631019a5f2af7c6454fa9eb392a3756a4917c420edd02210046130bf2baf7cfc065067c8b9e33a066d9c15edcea9feb0ca2d233e3597925b401", + "0x48 0x3045022030e7ea75f00a73608db820ba645a066e3fccf09dbb315a0a1d7e8773afcb9ab7022100505fea7b5dc292a43e8d1e6468bdd6c3269012cd05106be015ea14ca7cb4bba401", "0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG", "", "P2PK with too much S padding but no DERSIG" ], [ - "0x47 0x30440220d7a0417c3f6d1a15094d1cf2a3378ca0503eb8a57630953a9e2987e21ddd0a6502207a6266d686c99090920249991d3d42065b6d43eb70187b219c0db82e4f94d1a201", + "0x47 0x30440220f392c3fc0b257a8d6ad64a070c40ddd11a0f8f4ecc8e05f6719a2934900e71df0220139e1bf8052713895cda2f843dde585abc05a7f07d4931dd5c1dbb8c7d94909101", "0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG", "", "P2PK with too little R padding but no DERSIG" ], [ - "0x47 0x30440220005ece1335e7f757a1a1f476a7fb5bd90964e8a022489f890614a04acfb734c002206c12b8294a6513c7710e8c82d3c23d75cdbfe83200eb7efb495701958501a5d601", + "0x47 0x304402200052768d9f59125f9006926e19f464692107c21b3e6d4d020ddf957b4f115f770220629111f4f57822dc77d355586921daf39020353752dbd4b4d0ed161964b1255401", "0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 CHECKSIG NOT", "", "P2PK NOT with bad sig with too much R padding but no DERSIG" ], [ - "0x47 0x30440220d7a0417c3f6d1a15094d1cf2a3378ca0503eb8a57630953a9e2987e21ddd0a6502207a6266d686c99090920249991d3d42065b6d43eb70187b219c0db82e4f94d1a201", + "0x47 0x30440220f392c3fc0b257a8d6ad64a070c40ddd11a0f8f4ecc8e05f6719a2934900e71df0220139e1bf8052713895cda2f843dde585abc05a7f07d4931dd5c1dbb8c7d94909101", "0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG", "", "BIP66 example 1, without DERSIG" @@ -793,115 +793,115 @@ "BIP66 example 6, without DERSIG" ], [ - "0 0x47 0x30440220cae00b1444babfbf6071b0ba8707f6bd373da3df494d6e74119b0430c5db810502205d5231b8c5939c8ff0c82242656d6e06edb073d42af336c99fe8837c36ea39d501 0x47 0x3044022027c2714269ca5aeecc4d70edc88ba5ee0e3da4986e9216028f489ab4f1b8efce022022bd545b4951215267e4c5ceabd4c5350331b2e4a0b6494c56f361fa5a57a1a201", + "0 0x47 0x30440220959b3fa55bcbc510291af8f090ba5a17ee308f733f471bb382b8a23988a7d0500220770e10f776857775a4cc544718e1f3ce50521cfcafebf8936ffacb7b6284629e01 0x47 0x304402206ef1151dc2c72e3f57dc9185d5755808367fb57c2c65c8df55d82e6d8e89b6f8022050dff5f4a6055b9b26640f9fcdb05290d7d82008ab934b126cae78abdc2f2a2001", "2 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 2 CHECKMULTISIG", "", "BIP66 example 7, without DERSIG" ], [ - "0 0 0x47 0x30440220da6f441dc3b4b2c84cfa8db0cd5b34ed92c9e01686de5a800d40498b70c0dcac02207c2cf91b0c32b860c4cd4994be36cfb84caf8bb7c3a8e4d96a31b2022c5299c501", + "0 0 0x47 0x30440220baaa8a49e8a96778a462eb8f2eae31ccb544e432b34662a5602ece12f20bf64f022007019c21e05b796e87b4b56e82903aae79e8efec190d4d834a551a406118b64601", "2 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 2 CHECKMULTISIG NOT", "", "BIP66 example 10, without DERSIG" ], [ - "0 0x47 0x30440220b119d67d389315308d1745f734a51ff3ec72e06081e84e236fdf9dc2f5d2a64802204b04e3bc38674c4422ea317231d642b56dc09d214a1ecbbf16ecca01ed996e2201 0", + "0 0x47 0x30440220ef225ea223236e01fd726d26d69fcb40b39df836cde25881e11848b80714d6c002205d7d8e091fc16a0d5e8b4785312466c5e8080b862534f94a9c70f24ac0ff496c01 0", "2 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 2 CHECKMULTISIG NOT", "", "BIP66 example 12, without DERSIG" ], [ - "0 0x47 0x30440220b119d67d389315308d1745f734a51ff3ec72e06081e84e236fdf9dc2f5d2a64802204b04e3bc38674c4422ea317231d642b56dc09d214a1ecbbf16ecca01ed996e2201 0", + "0 0x47 0x30440220ef225ea223236e01fd726d26d69fcb40b39df836cde25881e11848b80714d6c002205d7d8e091fc16a0d5e8b4785312466c5e8080b862534f94a9c70f24ac0ff496c01 0", "2 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 2 CHECKMULTISIG NOT", "DERSIG", "BIP66 example 12, with DERSIG" ], [ - "0x48 0x304402203e4516da7253cf068effec6b95c41221c0cf3a8e6ccb8cbf1725b562e9afde2c022054e1c258c2981cdfba5df1f46661fb6541c44f77ca0092f3600331abfffb12510101", + "0x48 0x3044022012918460459bc14fc7bd7d5050455b7d71444f48c5890381123fc46ddaf83d3a02202f83c59b73dedc29510acb4f7cce6de9c664e6e606d9a821a422e3e058ec95e80101", "0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 CHECKSIG", "", "P2PK with multi-byte hashtype, without DERSIG" ], [ - "0x48 0x304502203e4516da7253cf068effec6b95c41221c0cf3a8e6ccb8cbf1725b562e9afde2c022100ab1e3da73d67e32045a20e0b999e049978ea8d6ee5480d485fcf2ce0d03b2ef001", + "0x48 0x3045022012918460459bc14fc7bd7d5050455b7d71444f48c5890381123fc46ddaf83d3a022100d07c3a648c2123d6aef534b083319214f449f600a86ef81a1baf7aac7749ab5901", "0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 CHECKSIG", "", "P2PK with high S but no LOW_S" ], [ - "0x47 0x3044022057292e2d4dfe775becdd0a9e6547997c728cdf35390f6a017da56d654d374e4902206b643be2fc53763b4e284845bfea2c597d2dc7759941dce937636c9d341b71ed01", + "0x47 0x3044022028ad19793d4abe04bc99c64523dcd06cb7fb6b9a8eb9b692489f02ba2ca51b4a02201ce5c56dcde293e8e3c011521e3f82ac27fdb5862df09077d002be95ea84841f01", "0x41 0x0679be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG", "", "P2PK with hybrid pubkey but no STRICTENC" ], [ - "0x47 0x30440220035d554e3153c04950c9993f41c496607a8e24093db0595be7bf875cf64fcf1f02204731c8c4e5daf15e706cec19cdd8f2c5b1d05490e11dab8465ed426569b6e92101", + "0x47 0x304402207a7c44917eff92b8597bf3e5c7abaa01bba9183d926455b394d87a4897d1dac00220339e270e534ecaabbd3e49e59393e7c00b6b8558c29aa6f14aa6c6277c5e244d01", "0x41 0x0679be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG NOT", "", "P2PK NOT with invalid hybrid pubkey but no STRICTENC" ], [ - "0 0x47 0x304402202e79441ad1baf5a07fb86bae3753184f6717d9692680947ea8b6e8b777c69af1022079a262e13d868bb5a0964fefe3ba26942e1b0669af1afb55ef3344bc9d4fc4c401", + "0 0x47 0x304402204846105e84bfc9fca3e64e58a78d3eafdc4da901b52508c57d656171cc3f95d002204155bde10e327190b16573f35d34dcba8fcda77c80fe3ed24da2838f1e09239801", "1 0x41 0x0679be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 2 CHECKMULTISIG", "", "1-of-2 with the second 1 hybrid pubkey and no STRICTENC" ], [ - "0 0x47 0x304402202e79441ad1baf5a07fb86bae3753184f6717d9692680947ea8b6e8b777c69af1022079a262e13d868bb5a0964fefe3ba26942e1b0669af1afb55ef3344bc9d4fc4c401", + "0 0x47 0x304402204846105e84bfc9fca3e64e58a78d3eafdc4da901b52508c57d656171cc3f95d002204155bde10e327190b16573f35d34dcba8fcda77c80fe3ed24da2838f1e09239801", "1 0x41 0x0679be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 2 CHECKMULTISIG", "STRICTENC", "1-of-2 with the second 1 hybrid pubkey" ], [ - "0x47 0x304402206177d513ec2cda444c021a1f4f656fc4c72ba108ae063e157eb86dc3575784940220666fc66702815d0e5413bb9b1df22aed44f5f1efb8b99d41dd5dc9a5be6d205205", + "0x47 0x30440220220c3ad143cafae0c3c5403270b0c392f5eeb869701130c6a9790f7f1ce8261d02201cbe777ad4e7998b4f78363497eaf8dd4166901daaeb9737ff2b1326b0451a5c05", "0x41 0x048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf CHECKSIG", "", "P2PK with undefined hashtype but no STRICTENC" ], [ - "0x47 0x304402207409b5b320296e5e2136a7b281a7f803028ca4ca44e2b83eebd46932677725de02202d4eea1c8d3c98e6f42614f54764e6e5e6542e213eb4d079737e9a8b6e9812ec05", + "0x47 0x304402200213672d90b1b99738e6c98f4a0798235b9f726ce1d674d8163fe5dac51b099802203a43ecb279d89dece434dc8d2bbf2347ee4b66147540a2e545c57135fa8d525105", "0x41 0x048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf CHECKSIG NOT", "", "P2PK NOT with invalid sig and undefined hashtype but no STRICTENC" ], [ - "1 0x47 0x3044022051254b9fb476a52d85530792b578f86fea70ec1ffb4393e661bcccb23d8d63d3022076505f94a403c86097841944e044c70c2045ce90e36de51f7e9d3828db98a07501 0x47 0x304402200a358f750934b3feb822f1966bfcd8bbec9eeaa3a8ca941e11ee5960e181fa01022050bf6b5a8e7750f70354ae041cb68a7bade67ec6c3ab19eb359638974410626e01 0x47 0x304402200955d031fff71d8653221e85e36c3c85533d2312fc3045314b19650b7ae2f81002202a6bb8505e36201909d0921f01abff390ae6b7ff97bbf959f98aedeb0a56730901", + "1 0x47 0x3044022019fa79ee8642d75cc7f89ee4c05610308363c25d459be356d333f5dd276548780220192af34c8fcd2d116c1a3cac43bebc9439de0e3435c3b5c946b7b0c6098a9ab701 0x47 0x304402203f967505faa2f69e3482e63d0c59f6e4b06599f59e7df9558bbb5f976cc190250220572c2a827b6a2ace87475acdc00bfbc4442ecaf6b4f54c489b0a5bd0ffc36d1d01 0x47 0x304402200400c0da6ef02d88af4d9ccdc97e5db3cd0e0f148024805089920c89742637af022040400714f61c99394f68422288b36399fa274561d9e6ca4d0f539cc680360f5d01", "3 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 3 CHECKMULTISIG", "", "3-of-3 with nonzero dummy but no NULLDUMMY" ], [ - "1 0x47 0x304402201bb2edab700a5d020236df174fefed78087697143731f659bea59642c759c16d022061f42cdbae5bcd3e8790f20bf76687443436e94a634321c16a72aa54cbc7c2ea01 0x47 0x304402204bb4a64f2a6e5c7fb2f07fef85ee56fde5e6da234c6a984262307a20e99842d702206f8303aaba5e625d223897e2ffd3f88ef1bcffef55f38dc3768e5f2e94c923f901 0x47 0x3044022040c2809b71fffb155ec8b82fe7a27f666bd97f941207be4e14ade85a1249dd4d02204d56c85ec525dd18e29a0533d5ddf61b6b1bb32980c2f63edf951aebf7a27bfe01", + "1 0x47 0x304402205ed72cf70a97fbb41a7a75710a843e15f8646993d95209fabdca3a5da51e714102204354e061ba74c65761a2543e4943ecde19e26f84d8ea169f910c7d83cc79d10b01 0x47 0x3044022027a6e542a9b5cc18c81638e836c16da213f959a368cdec1de0a945df59ce84950220349a2e3f4f7eef8b64dc134168ae67ef4e42bb5151ab0e13656249c77278733c01 0x47 0x304402202b747c3dfc7bc63e9e22e40a721fe05cc6356f737c92a427ac77fbde950aa35e02207625f28d3cb4186c5a9d665b0040b8bc59ab2a451b46cb8aa9e8e4c4cadefa3001", "3 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 3 CHECKMULTISIG NOT", "", "3-of-3 NOT with invalid sig and nonzero dummy but no NULLDUMMY" ], [ - "0 0x47 0x304402200abeb4bd07f84222f474aed558cfbdfc0b4e96cde3c2935ba7098b1ff0bd74c302204a04c1ca67b2a20abee210cf9a21023edccbbf8024b988812634233115c6b73901 DUP", + "0 0x47 0x3044022069335c200a859303ff1ab36c82aea0c0f71f8a841a5db2cd3b443d8ca98c395c02206afafd2571c690511ba64c26e7bb7ebef39967770f27fec0900e212f3992f1f201 DUP", "2 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 2 CHECKMULTISIG", "", "2-of-2 with two identical keys and sigs pushed using OP_DUP but no SIGPUSHONLY" ], [ - "0 0x47 0x304402200abeb4bd07f84222f474aed558cfbdfc0b4e96cde3c2935ba7098b1ff0bd74c302204a04c1ca67b2a20abee210cf9a21023edccbbf8024b988812634233115c6b73901 0x47 0x304402200abeb4bd07f84222f474aed558cfbdfc0b4e96cde3c2935ba7098b1ff0bd74c302204a04c1ca67b2a20abee210cf9a21023edccbbf8024b988812634233115c6b73901", + "0 0x47 0x3044022069335c200a859303ff1ab36c82aea0c0f71f8a841a5db2cd3b443d8ca98c395c02206afafd2571c690511ba64c26e7bb7ebef39967770f27fec0900e212f3992f1f201 0x47 0x3044022069335c200a859303ff1ab36c82aea0c0f71f8a841a5db2cd3b443d8ca98c395c02206afafd2571c690511ba64c26e7bb7ebef39967770f27fec0900e212f3992f1f201", "2 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 2 CHECKMULTISIG", "SIGPUSHONLY", "2-of-2 with two identical keys and sigs pushed" ], [ - "11 0x47 0x304402200a5c6163f07b8d3b013c4d1d6dba25e780b39658d79ba37af7057a3b7f15ffa102201fd9b4eaa9943f734928b99a83592c2e7bf342ea2680f6a2bb705167966b742001", + "11 0x47 0x3044022028704302bdbc0951b707a947fc76b0bc833fe73d105f6b65917993b6ba739052022056e4d465960125cd226963137b93c31e5831af98f3250bacae1245fa882f837801", "0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG", "P2SH", "P2PK with unnecessary input but no CLEANSTACK" ], [ - "11 0x47 0x304402202f7505132be14872581f35d74b759212d9da40482653f1ffa3116c3294a4a51702206adbf347a2240ca41c66522b1a22a41693610b76a8e7770645dc721d1635854f01 0x43 0x410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8ac", + "11 0x47 0x30440220785cd94c2ff5079a1423af355053c56c6a252f6806e3a6539f168709fbee533202203ba85578f85448a9ee4eb4c38e26b76367d992002eece1018273f043639ce06a01 0x43 0x410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8ac", "HASH160 0x14 0x31edc23bdafda4639e669f89ad6b2318dd79d032 EQUAL", "P2SH", "P2SH with unnecessary input but no CLEANSTACK" ], [ - "0x47 0x304402202f7505132be14872581f35d74b759212d9da40482653f1ffa3116c3294a4a51702206adbf347a2240ca41c66522b1a22a41693610b76a8e7770645dc721d1635854f01 0x43 0x410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8ac", + "0x47 0x30440220785cd94c2ff5079a1423af355053c56c6a252f6806e3a6539f168709fbee533202203ba85578f85448a9ee4eb4c38e26b76367d992002eece1018273f043639ce06a01 0x43 0x410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8ac", "HASH160 0x14 0x31edc23bdafda4639e669f89ad6b2318dd79d032 EQUAL", "CLEANSTACK,P2SH", "P2SH with CLEANSTACK" From 1e84d84d3ab26151192221f4fb2fd145a2a95bc0 Mon Sep 17 00:00:00 2001 From: Simon Date: Mon, 25 Jul 2016 11:25:00 -0700 Subject: [PATCH 06/16] Rename GetHash() method to GetSerializeHash(). When pulling from upstream we are now forced to examine GetHash() usage and replace with GetSerializeHash() if the caller wants a double SHA256 hash, or with GetTxid() if the caller wants a transaction id. --- src/primitives/transaction.cpp | 9 +++++---- src/primitives/transaction.h | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/primitives/transaction.cpp b/src/primitives/transaction.cpp index 510e0b5c5..393215207 100644 --- a/src/primitives/transaction.cpp +++ b/src/primitives/transaction.cpp @@ -116,7 +116,7 @@ CMutableTransaction::CMutableTransaction(const CTransaction& tx) : nVersion(tx.n } -uint256 CMutableTransaction::GetHash() const +uint256 CMutableTransaction::GetSerializeHash() const { return SerializeHash(*this); } @@ -211,8 +211,9 @@ unsigned int CTransaction::CalculateModifiedSize(unsigned int nTxSize) const std::string CTransaction::ToString() const { std::string str; - str += strprintf("CTransaction(hash=%s, ver=%d, vin.size=%u, vout.size=%u, nLockTime=%u)\n", - GetHash().ToString().substr(0,10), + str += strprintf("CTransaction(txid=%s, hash=%s, ver=%d, vin.size=%u, vout.size=%u, nLockTime=%u)\n", + GetTxid().ToString().substr(0,10), + GetSerializeHash().ToString().substr(0,10), nVersion, vin.size(), vout.size(), @@ -240,7 +241,7 @@ uint256 CTransaction::GetTxid() const tx.joinSplitSig.assign(0); // Return double SHA256 hash - return tx.GetHash(); + return tx.GetSerializeHash(); } diff --git a/src/primitives/transaction.h b/src/primitives/transaction.h index 0009fcf44..ed11e5c30 100644 --- a/src/primitives/transaction.h +++ b/src/primitives/transaction.h @@ -339,7 +339,7 @@ public: return vin.empty() && vout.empty(); } - const uint256& GetHash() const { + const uint256& GetSerializeHash() const { return hash; } @@ -414,7 +414,7 @@ struct CMutableTransaction /** Compute the hash of this CMutableTransaction. This is computed on the * fly, as opposed to GetHash() in CTransaction, which uses a cached result. */ - uint256 GetHash() const; + uint256 GetSerializeHash() const; // Compute a non-malleable txid on the fly. uint256 GetTxid() const; From 10d2c57c0dffaaf872ff7f322887ef055bc65f0a Mon Sep 17 00:00:00 2001 From: Simon Date: Mon, 25 Jul 2016 12:23:37 -0700 Subject: [PATCH 07/16] Replace calls to GetHash() with GetTxid() for transaction objects. Where the caller intends to receive a transaction id and not a double SHA256 hash. --- src/bitcoin-tx.cpp | 2 +- src/bloom.cpp | 2 +- src/core_write.cpp | 2 +- src/init.cpp | 2 +- src/main.cpp | 40 +++++++++++++++--------------- src/merkleblock.cpp | 4 +-- src/miner.cpp | 6 ++--- src/net.cpp | 2 +- src/policy/fees.cpp | 2 +- src/primitives/block.cpp | 2 +- src/qt/coincontroldialog.cpp | 4 +-- src/qt/transactiondesc.cpp | 2 +- src/qt/transactionrecord.cpp | 2 +- src/rpcblockchain.cpp | 2 +- src/rpcmining.cpp | 2 +- src/rpcrawtransaction.cpp | 6 ++--- src/test/DoS_tests.cpp | 4 +-- src/test/accounting_tests.cpp | 6 ++--- src/test/coins_tests.cpp | 2 +- src/test/mempool_tests.cpp | 16 ++++++------ src/test/miner_tests.cpp | 40 +++++++++++++++--------------- src/test/multisig_tests.cpp | 4 +-- src/test/pmt_tests.cpp | 2 +- src/test/policyestimator_tests.cpp | 6 ++--- src/test/script_P2SH_tests.cpp | 14 +++++------ src/test/script_tests.cpp | 2 +- src/test/transaction_tests.cpp | 12 ++++----- src/txmempool.cpp | 18 +++++++------- src/wallet/rpcwallet.cpp | 12 ++++----- src/wallet/wallet.cpp | 40 +++++++++++++++--------------- src/wallet/walletdb.cpp | 6 ++--- src/zcbenchmarks.cpp | 2 +- 32 files changed, 134 insertions(+), 134 deletions(-) diff --git a/src/bitcoin-tx.cpp b/src/bitcoin-tx.cpp index 319be2991..6541b4fa0 100644 --- a/src/bitcoin-tx.cpp +++ b/src/bitcoin-tx.cpp @@ -498,7 +498,7 @@ static void OutputTxJSON(const CTransaction& tx) static void OutputTxHash(const CTransaction& tx) { - string strHexHash = tx.GetHash().GetHex(); // the hex-encoded transaction hash (aka the transaction id) + string strHexHash = tx.GetTxid().GetHex(); // the hex-encoded transaction hash (aka the transaction id) fprintf(stdout, "%s\n", strHexHash.c_str()); } diff --git a/src/bloom.cpp b/src/bloom.cpp index de8720659..bd1e13679 100644 --- a/src/bloom.cpp +++ b/src/bloom.cpp @@ -142,7 +142,7 @@ bool CBloomFilter::IsRelevantAndUpdate(const CTransaction& tx) return true; if (isEmpty) return false; - const uint256& hash = tx.GetHash(); + const uint256& hash = tx.GetTxid(); if (contains(hash)) fFound = true; diff --git a/src/core_write.cpp b/src/core_write.cpp index c3babec2f..b7db39432 100644 --- a/src/core_write.cpp +++ b/src/core_write.cpp @@ -88,7 +88,7 @@ void ScriptPubKeyToUniv(const CScript& scriptPubKey, void TxToUniv(const CTransaction& tx, const uint256& hashBlock, UniValue& entry) { - entry.pushKV("txid", tx.GetHash().GetHex()); + entry.pushKV("txid", tx.GetTxid().GetHex()); entry.pushKV("version", tx.nVersion); entry.pushKV("locktime", (int64_t)tx.nLockTime); diff --git a/src/init.cpp b/src/init.cpp index 19ac9792d..6b3d9a1df 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1384,7 +1384,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler) BOOST_FOREACH(const CWalletTx& wtxOld, vWtx) { - uint256 hash = wtxOld.GetHash(); + uint256 hash = wtxOld.GetTxid(); std::map::iterator mi = pwalletMain->mapWallet.find(hash); if (mi != pwalletMain->mapWallet.end()) { diff --git a/src/main.cpp b/src/main.cpp index b9d58cd17..b5d4f3d94 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -553,7 +553,7 @@ CBlockTreeDB *pblocktree = NULL; bool AddOrphanTx(const CTransaction& tx, NodeId peer) { - uint256 hash = tx.GetHash(); + uint256 hash = tx.GetTxid(); if (mapOrphanTransactions.count(hash)) return false; @@ -607,7 +607,7 @@ void EraseOrphansFor(NodeId peer) map::iterator maybeErase = iter++; // increment to avoid iterator becoming invalid if (maybeErase->second.fromPeer == peer) { - EraseOrphanTx(maybeErase->second.tx.GetHash()); + EraseOrphanTx(maybeErase->second.tx.GetTxid()); ++nErased; } } @@ -1033,7 +1033,7 @@ CAmount GetMinRelayFee(const CTransaction& tx, unsigned int nBytes, bool fAllowF { { LOCK(mempool.cs); - uint256 hash = tx.GetHash(); + uint256 hash = tx.GetTxid(); double dPriorityDelta = 0; CAmount nFeeDelta = 0; mempool.ApplyDeltas(hash, dPriorityDelta, nFeeDelta); @@ -1088,7 +1088,7 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa return state.DoS(0, false, REJECT_NONSTANDARD, "non-final"); // is it already in the memory pool? - uint256 hash = tx.GetHash(); + uint256 hash = tx.GetTxid(); if (pool.exists(hash)) return false; @@ -1280,7 +1280,7 @@ bool GetTransaction(const uint256 &hash, CTransaction &txOut, uint256 &hashBlock return error("%s: Deserialize or I/O error - %s", __func__, e.what()); } hashBlock = header.GetHash(); - if (txOut.GetHash() != hash) + if (txOut.GetTxid() != hash) return error("%s: txid mismatch", __func__); return true; } @@ -1302,7 +1302,7 @@ bool GetTransaction(const uint256 &hash, CTransaction &txOut, uint256 &hashBlock CBlock block; if (ReadBlockFromDisk(block, pindexSlow)) { BOOST_FOREACH(const CTransaction &tx, block.vtx) { - if (tx.GetHash() == hash) { + if (tx.GetTxid() == hash) { txOut = tx; hashBlock = pindexSlow->GetBlockHash(); return true; @@ -1593,7 +1593,7 @@ void UpdateCoins(const CTransaction& tx, CValidationState &state, CCoinsViewCach } // add outputs - inputs.ModifyCoins(tx.GetHash())->FromTx(tx, nHeight); + inputs.ModifyCoins(tx.GetTxid())->FromTx(tx, nHeight); } void UpdateCoins(const CTransaction& tx, CValidationState &state, CCoinsViewCache &inputs, int nHeight) @@ -1605,7 +1605,7 @@ void UpdateCoins(const CTransaction& tx, CValidationState &state, CCoinsViewCach bool CScriptCheck::operator()() { const CScript &scriptSig = ptxTo->vin[nIn].scriptSig; if (!VerifyScript(scriptSig, scriptPubKey, nFlags, CachingTransactionSignatureChecker(ptxTo, nIn, cacheStore), &error)) { - return ::error("CScriptCheck(): %s:%d VerifySignature failed: %s", ptxTo->GetHash().ToString(), nIn, ScriptErrorString(error)); + return ::error("CScriptCheck(): %s:%d VerifySignature failed: %s", ptxTo->GetTxid().ToString(), nIn, ScriptErrorString(error)); } return true; } @@ -1620,11 +1620,11 @@ bool NonContextualCheckInputs(const CTransaction& tx, CValidationState &state, c // This doesn't trigger the DoS code on purpose; if it did, it would make it easier // for an attacker to attempt to split the network. if (!inputs.HaveInputs(tx)) - return state.Invalid(error("CheckInputs(): %s inputs unavailable", tx.GetHash().ToString())); + return state.Invalid(error("CheckInputs(): %s inputs unavailable", tx.GetTxid().ToString())); // are the JoinSplit's requirements met? if (!inputs.HaveJoinSplitRequirements(tx)) - return state.Invalid(error("CheckInputs(): %s JoinSplit requirements not met", tx.GetHash().ToString())); + return state.Invalid(error("CheckInputs(): %s JoinSplit requirements not met", tx.GetTxid().ToString())); CAmount nValueIn = 0; CAmount nFees = 0; @@ -1661,13 +1661,13 @@ bool NonContextualCheckInputs(const CTransaction& tx, CValidationState &state, c if (nValueIn < tx.GetValueOut()) return state.DoS(100, error("CheckInputs(): %s value in (%s) < value out (%s)", - tx.GetHash().ToString(), FormatMoney(nValueIn), FormatMoney(tx.GetValueOut())), + tx.GetTxid().ToString(), FormatMoney(nValueIn), FormatMoney(tx.GetValueOut())), REJECT_INVALID, "bad-txns-in-belowout"); // Tally transaction fees CAmount nTxFee = nValueIn - tx.GetValueOut(); if (nTxFee < 0) - return state.DoS(100, error("CheckInputs(): %s nTxFee < 0", tx.GetHash().ToString()), + return state.DoS(100, error("CheckInputs(): %s nTxFee < 0", tx.GetTxid().ToString()), REJECT_INVALID, "bad-txns-fee-negative"); nFees += nTxFee; if (!MoneyRange(nFees)) @@ -1886,7 +1886,7 @@ bool DisconnectBlock(CBlock& block, CValidationState& state, CBlockIndex* pindex // undo transactions in reverse order for (int i = block.vtx.size() - 1; i >= 0; i--) { const CTransaction &tx = block.vtx[i]; - uint256 hash = tx.GetHash(); + uint256 hash = tx.GetTxid(); // Check that all outputs are available and match the outputs in the block itself // exactly. @@ -2067,7 +2067,7 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin // Do not allow blocks that contain transactions which 'overwrite' older transactions, // unless those are already completely spent. BOOST_FOREACH(const CTransaction& tx, block.vtx) { - const CCoins* coins = view.AccessCoins(tx.GetHash()); + const CCoins* coins = view.AccessCoins(tx.GetTxid()); if (coins && !coins->IsPruned()) return state.DoS(100, error("ConnectBlock(): tried to overwrite transaction"), REJECT_INVALID, "bad-txns-BIP30"); @@ -2165,7 +2165,7 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin } } - vPos.push_back(std::make_pair(tx.GetHash(), pos)); + vPos.push_back(std::make_pair(tx.GetTxid(), pos)); pos.nTxOffset += ::GetSerializeSize(tx, SER_DISK, CLIENT_VERSION); } @@ -2222,7 +2222,7 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin // Watch for changes to the previous coinbase transaction. static uint256 hashPrevBestCoinBase; GetMainSignals().UpdatedTransaction(hashPrevBestCoinBase); - hashPrevBestCoinBase = block.vtx[0].GetHash(); + hashPrevBestCoinBase = block.vtx[0].GetTxid(); int64_t nTime4 = GetTimeMicros(); nTimeCallbacks += nTime4 - nTime3; LogPrint("bench", " - Callbacks: %.2fms [%.2fs]\n", 0.001 * (nTime4 - nTime3), nTimeCallbacks * 0.000001); @@ -4654,7 +4654,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, CTransaction tx; vRecv >> tx; - CInv inv(MSG_TX, tx.GetHash()); + CInv inv(MSG_TX, tx.GetTxid()); pfrom->AddInventoryKnown(inv); LOCK(cs_main); @@ -4676,7 +4676,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, LogPrint("mempool", "AcceptToMemoryPool: peer=%d %s: accepted %s (poolsz %u)\n", pfrom->id, pfrom->cleanSubVer, - tx.GetHash().ToString(), + tx.GetTxid().ToString(), mempool.mapTx.size()); // Recursively process any orphan transactions that depended on this one @@ -4745,7 +4745,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, LogPrint("mempool", "mapOrphan overflow, removed %u tx\n", nEvicted); } else { assert(recentRejects); - recentRejects->insert(tx.GetHash()); + recentRejects->insert(tx.GetTxid()); if (pfrom->fWhitelisted) { // Always relay transactions received from whitelisted peers, even @@ -4761,7 +4761,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, int nDoS = 0; if (state.IsInvalid(nDoS)) { - LogPrint("mempool", "%s from peer=%d %s was not accepted into the memory pool: %s\n", tx.GetHash().ToString(), + LogPrint("mempool", "%s from peer=%d %s was not accepted into the memory pool: %s\n", tx.GetTxid().ToString(), pfrom->id, pfrom->cleanSubVer, state.GetRejectReason()); pfrom->PushMessage("reject", strCommand, state.GetRejectCode(), diff --git a/src/merkleblock.cpp b/src/merkleblock.cpp index f8e877df2..1d1f41ecd 100644 --- a/src/merkleblock.cpp +++ b/src/merkleblock.cpp @@ -23,7 +23,7 @@ CMerkleBlock::CMerkleBlock(const CBlock& block, CBloomFilter& filter) for (unsigned int i = 0; i < block.vtx.size(); i++) { - const uint256& hash = block.vtx[i].GetHash(); + const uint256& hash = block.vtx[i].GetTxid(); if (filter.IsRelevantAndUpdate(block.vtx[i])) { vMatch.push_back(true); @@ -49,7 +49,7 @@ CMerkleBlock::CMerkleBlock(const CBlock& block, const std::set& txids) for (unsigned int i = 0; i < block.vtx.size(); i++) { - const uint256& hash = block.vtx[i].GetHash(); + const uint256& hash = block.vtx[i].GetTxid(); if (txids.count(hash)) vMatch.push_back(true); else diff --git a/src/miner.cpp b/src/miner.cpp index d110bb425..73a6c9bf7 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -211,7 +211,7 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn) unsigned int nTxSize = ::GetSerializeSize(tx, SER_NETWORK, PROTOCOL_VERSION); dPriority = tx.ComputePriority(dPriority, nTxSize); - uint256 hash = tx.GetHash(); + uint256 hash = tx.GetTxid(); mempool.ApplyDeltas(hash, dPriority, nTotalIn); CFeeRate feeRate(nTotalIn-tx.GetValueOut(), nTxSize); @@ -255,7 +255,7 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn) continue; // Skip free transactions if we're past the minimum block size: - const uint256& hash = tx.GetHash(); + const uint256& hash = tx.GetTxid(); double dPriorityDelta = 0; CAmount nFeeDelta = 0; mempool.ApplyDeltas(hash, dPriorityDelta, nFeeDelta); @@ -302,7 +302,7 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn) if (fPrintPriority) { LogPrintf("priority %.1f fee %s txid %s\n", - dPriority, feeRate.ToString(), tx.GetHash().ToString()); + dPriority, feeRate.ToString(), tx.GetTxid().ToString()); } // Add transactions that depend on this one to the priority queue diff --git a/src/net.cpp b/src/net.cpp index e4b22f9cc..412f4aa3d 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -1751,7 +1751,7 @@ void RelayTransaction(const CTransaction& tx) void RelayTransaction(const CTransaction& tx, const CDataStream& ss) { - CInv inv(MSG_TX, tx.GetHash()); + CInv inv(MSG_TX, tx.GetTxid()); { LOCK(cs_mapRelay); // Expire old relay messages diff --git a/src/policy/fees.cpp b/src/policy/fees.cpp index ffe31d194..b6b5afbcb 100644 --- a/src/policy/fees.cpp +++ b/src/policy/fees.cpp @@ -344,7 +344,7 @@ bool CBlockPolicyEstimator::isPriDataPoint(const CFeeRate &fee, double pri) void CBlockPolicyEstimator::processTransaction(const CTxMemPoolEntry& entry, bool fCurrentEstimate) { unsigned int txHeight = entry.GetHeight(); - uint256 hash = entry.GetTx().GetHash(); + uint256 hash = entry.GetTx().GetTxid(); if (mapMemPoolTxs[hash].stats != NULL) { LogPrint("estimatefee", "Blockpolicy error mempool tx %s already being tracked\n", hash.ToString().c_str()); diff --git a/src/primitives/block.cpp b/src/primitives/block.cpp index c2300c82a..9188274dd 100644 --- a/src/primitives/block.cpp +++ b/src/primitives/block.cpp @@ -55,7 +55,7 @@ uint256 CBlock::BuildMerkleTree(bool* fMutated) const vMerkleTree.clear(); vMerkleTree.reserve(vtx.size() * 2 + 16); // Safe upper bound for the number of total nodes. for (std::vector::const_iterator it(vtx.begin()); it != vtx.end(); ++it) - vMerkleTree.push_back(it->GetHash()); + vMerkleTree.push_back(it->GetTxid()); int j = 0; bool mutated = false; for (int nSize = vtx.size(); nSize > 1; nSize = (nSize + 1) / 2) diff --git a/src/qt/coincontroldialog.cpp b/src/qt/coincontroldialog.cpp index 6a527429e..5aa3939c3 100644 --- a/src/qt/coincontroldialog.cpp +++ b/src/qt/coincontroldialog.cpp @@ -496,7 +496,7 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog) { // unselect already spent, very unlikely scenario, this could happen // when selected are spent elsewhere, like rpc or another computer - uint256 txhash = out.tx->GetHash(); + uint256 txhash = out.tx->GetTxid(); COutPoint outpt(txhash, out.i); if (model->isSpent(outpt)) { @@ -782,7 +782,7 @@ void CoinControlDialog::updateView() nInputSum += nInputSize; // transaction hash - uint256 txhash = out.tx->GetHash(); + uint256 txhash = out.tx->GetTxid(); itemOutput->setText(COLUMN_TXHASH, QString::fromStdString(txhash.GetHex())); // vout index diff --git a/src/qt/transactiondesc.cpp b/src/qt/transactiondesc.cpp index d7ee3d4c7..f897f49e3 100644 --- a/src/qt/transactiondesc.cpp +++ b/src/qt/transactiondesc.cpp @@ -240,7 +240,7 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx, TransactionReco if (wtx.mapValue.count("comment") && !wtx.mapValue["comment"].empty()) strHTML += "
" + tr("Comment") + ":
" + GUIUtil::HtmlEscape(wtx.mapValue["comment"], true) + "
"; - strHTML += "" + tr("Transaction ID") + ": " + TransactionRecord::formatSubTxId(wtx.GetHash(), rec->idx) + "
"; + strHTML += "" + tr("Transaction ID") + ": " + TransactionRecord::formatSubTxId(wtx.GetTxid(), rec->idx) + "
"; // Message from normal bitcoin:URI (bitcoin:123...?message=example) Q_FOREACH (const PAIRTYPE(string, string)& r, wtx.vOrderForm) diff --git a/src/qt/transactionrecord.cpp b/src/qt/transactionrecord.cpp index 15d13e9fc..f802bcf30 100644 --- a/src/qt/transactionrecord.cpp +++ b/src/qt/transactionrecord.cpp @@ -39,7 +39,7 @@ QList TransactionRecord::decomposeTransaction(const CWallet * CAmount nCredit = wtx.GetCredit(ISMINE_ALL); CAmount nDebit = wtx.GetDebit(ISMINE_ALL); CAmount nNet = nCredit - nDebit; - uint256 hash = wtx.GetHash(); + uint256 hash = wtx.GetTxid(); std::map mapValue = wtx.mapValue; if (nNet > 0 || wtx.IsCoinBase()) diff --git a/src/rpcblockchain.cpp b/src/rpcblockchain.cpp index 0450a5a3b..ac7102265 100644 --- a/src/rpcblockchain.cpp +++ b/src/rpcblockchain.cpp @@ -80,7 +80,7 @@ Object blockToJSON(const CBlock& block, const CBlockIndex* blockindex, bool txDe txs.push_back(objTx); } else - txs.push_back(tx.GetHash().GetHex()); + txs.push_back(tx.GetTxid().GetHex()); } result.push_back(Pair("tx", txs)); result.push_back(Pair("time", block.GetBlockTime())); diff --git a/src/rpcmining.cpp b/src/rpcmining.cpp index 95b32df96..952ecd3a0 100644 --- a/src/rpcmining.cpp +++ b/src/rpcmining.cpp @@ -567,7 +567,7 @@ Value getblocktemplate(const Array& params, bool fHelp) int i = 0; BOOST_FOREACH (CTransaction& tx, pblock->vtx) { - uint256 txHash = tx.GetHash(); + uint256 txHash = tx.GetTxid(); setTxIndex[txHash] = i++; if (tx.IsCoinBase()) diff --git a/src/rpcrawtransaction.cpp b/src/rpcrawtransaction.cpp index 617dc7785..513df78d1 100644 --- a/src/rpcrawtransaction.cpp +++ b/src/rpcrawtransaction.cpp @@ -57,7 +57,7 @@ void ScriptPubKeyToJSON(const CScript& scriptPubKey, Object& out, bool fIncludeH void TxToJSON(const CTransaction& tx, const uint256 hashBlock, Object& entry) { - entry.push_back(Pair("txid", tx.GetHash().GetHex())); + entry.push_back(Pair("txid", tx.GetTxid().GetHex())); entry.push_back(Pair("version", tx.nVersion)); entry.push_back(Pair("locktime", (int64_t)tx.nLockTime)); Array vin; @@ -307,7 +307,7 @@ Value gettxoutproof(const Array& params, bool fHelp) unsigned int ntxFound = 0; BOOST_FOREACH(const CTransaction&tx, block.vtx) - if (setTxids.count(tx.GetHash())) + if (setTxids.count(tx.GetTxid())) ntxFound++; if (ntxFound != setTxids.size()) throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "(Not all) transactions not found in specified block"); @@ -818,7 +818,7 @@ Value sendrawtransaction(const Array& params, bool fHelp) CTransaction tx; if (!DecodeHexTx(tx, params[0].get_str())) throw JSONRPCError(RPC_DESERIALIZATION_ERROR, "TX decode failed"); - uint256 hashTx = tx.GetHash(); + uint256 hashTx = tx.GetTxid(); bool fOverrideFees = false; if (params.size() > 1) diff --git a/src/test/DoS_tests.cpp b/src/test/DoS_tests.cpp index bf2554875..1c3b79c65 100644 --- a/src/test/DoS_tests.cpp +++ b/src/test/DoS_tests.cpp @@ -147,7 +147,7 @@ BOOST_AUTO_TEST_CASE(DoS_mapOrphans) CMutableTransaction tx; tx.vin.resize(1); tx.vin[0].prevout.n = 0; - tx.vin[0].prevout.hash = txPrev.GetHash(); + tx.vin[0].prevout.hash = txPrev.GetTxid(); tx.vout.resize(1); tx.vout[0].nValue = 1*CENT; tx.vout[0].scriptPubKey = GetScriptForDestination(key.GetPubKey().GetID()); @@ -169,7 +169,7 @@ BOOST_AUTO_TEST_CASE(DoS_mapOrphans) for (unsigned int j = 0; j < tx.vin.size(); j++) { tx.vin[j].prevout.n = j; - tx.vin[j].prevout.hash = txPrev.GetHash(); + tx.vin[j].prevout.hash = txPrev.GetTxid(); } SignSignature(keystore, txPrev, tx, 0); // Re-use same signature for other inputs diff --git a/src/test/accounting_tests.cpp b/src/test/accounting_tests.cpp index 0c2ade48d..c624d1953 100644 --- a/src/test/accounting_tests.cpp +++ b/src/test/accounting_tests.cpp @@ -49,7 +49,7 @@ BOOST_AUTO_TEST_CASE(acc_orderupgrade) wtx.mapValue["comment"] = "z"; pwalletMain->AddToWallet(wtx, false, &walletdb); - vpwtx.push_back(&pwalletMain->mapWallet[wtx.GetHash()]); + vpwtx.push_back(&pwalletMain->mapWallet[wtx.GetTxid()]); vpwtx[0]->nTimeReceived = (unsigned int)1333333335; vpwtx[0]->nOrderPos = -1; @@ -91,7 +91,7 @@ BOOST_AUTO_TEST_CASE(acc_orderupgrade) *static_cast(&wtx) = CTransaction(tx); } pwalletMain->AddToWallet(wtx, false, &walletdb); - vpwtx.push_back(&pwalletMain->mapWallet[wtx.GetHash()]); + vpwtx.push_back(&pwalletMain->mapWallet[wtx.GetTxid()]); vpwtx[1]->nTimeReceived = (unsigned int)1333333336; wtx.mapValue["comment"] = "x"; @@ -101,7 +101,7 @@ BOOST_AUTO_TEST_CASE(acc_orderupgrade) *static_cast(&wtx) = CTransaction(tx); } pwalletMain->AddToWallet(wtx, false, &walletdb); - vpwtx.push_back(&pwalletMain->mapWallet[wtx.GetHash()]); + vpwtx.push_back(&pwalletMain->mapWallet[wtx.GetTxid()]); vpwtx[2]->nTimeReceived = (unsigned int)1333333329; vpwtx[2]->nOrderPos = -1; diff --git a/src/test/coins_tests.cpp b/src/test/coins_tests.cpp index 695a8b05d..77fb3f3b5 100644 --- a/src/test/coins_tests.cpp +++ b/src/test/coins_tests.cpp @@ -504,7 +504,7 @@ BOOST_AUTO_TEST_CASE(coins_coinbase_spends) // Create coinbase spend CMutableTransaction mtx2; mtx2.vin.resize(1); - mtx2.vin[0].prevout = COutPoint(tx.GetHash(), 0); + mtx2.vin[0].prevout = COutPoint(tx.GetTxid(), 0); mtx2.vin[0].scriptSig = CScript() << OP_1; mtx2.vin[0].nSequence = 0; diff --git a/src/test/mempool_tests.cpp b/src/test/mempool_tests.cpp index 0996e13c4..294e0f159 100644 --- a/src/test/mempool_tests.cpp +++ b/src/test/mempool_tests.cpp @@ -33,7 +33,7 @@ BOOST_AUTO_TEST_CASE(MempoolRemoveTest) { txChild[i].vin.resize(1); txChild[i].vin[0].scriptSig = CScript() << OP_11; - txChild[i].vin[0].prevout.hash = txParent.GetHash(); + txChild[i].vin[0].prevout.hash = txParent.GetTxid(); txChild[i].vin[0].prevout.n = i; txChild[i].vout.resize(1); txChild[i].vout[0].scriptPubKey = CScript() << OP_11 << OP_EQUAL; @@ -44,7 +44,7 @@ BOOST_AUTO_TEST_CASE(MempoolRemoveTest) { txGrandChild[i].vin.resize(1); txGrandChild[i].vin[0].scriptSig = CScript() << OP_11; - txGrandChild[i].vin[0].prevout.hash = txChild[i].GetHash(); + txGrandChild[i].vin[0].prevout.hash = txChild[i].GetTxid(); txGrandChild[i].vin[0].prevout.n = 0; txGrandChild[i].vout.resize(1); txGrandChild[i].vout[0].scriptPubKey = CScript() << OP_11 << OP_EQUAL; @@ -60,17 +60,17 @@ BOOST_AUTO_TEST_CASE(MempoolRemoveTest) BOOST_CHECK_EQUAL(removed.size(), 0); // Just the parent: - testPool.addUnchecked(txParent.GetHash(), CTxMemPoolEntry(txParent, 0, 0, 0.0, 1)); + testPool.addUnchecked(txParent.GetTxid(), CTxMemPoolEntry(txParent, 0, 0, 0.0, 1)); testPool.remove(txParent, removed, true); BOOST_CHECK_EQUAL(removed.size(), 1); removed.clear(); // Parent, children, grandchildren: - testPool.addUnchecked(txParent.GetHash(), CTxMemPoolEntry(txParent, 0, 0, 0.0, 1)); + testPool.addUnchecked(txParent.GetTxid(), CTxMemPoolEntry(txParent, 0, 0, 0.0, 1)); for (int i = 0; i < 3; i++) { - testPool.addUnchecked(txChild[i].GetHash(), CTxMemPoolEntry(txChild[i], 0, 0, 0.0, 1)); - testPool.addUnchecked(txGrandChild[i].GetHash(), CTxMemPoolEntry(txGrandChild[i], 0, 0, 0.0, 1)); + testPool.addUnchecked(txChild[i].GetTxid(), CTxMemPoolEntry(txChild[i], 0, 0, 0.0, 1)); + testPool.addUnchecked(txGrandChild[i].GetTxid(), CTxMemPoolEntry(txGrandChild[i], 0, 0, 0.0, 1)); } // Remove Child[0], GrandChild[0] should be removed: testPool.remove(txChild[0], removed, true); @@ -90,8 +90,8 @@ BOOST_AUTO_TEST_CASE(MempoolRemoveTest) // Add children and grandchildren, but NOT the parent (simulate the parent being in a block) for (int i = 0; i < 3; i++) { - testPool.addUnchecked(txChild[i].GetHash(), CTxMemPoolEntry(txChild[i], 0, 0, 0.0, 1)); - testPool.addUnchecked(txGrandChild[i].GetHash(), CTxMemPoolEntry(txGrandChild[i], 0, 0, 0.0, 1)); + testPool.addUnchecked(txChild[i].GetTxid(), CTxMemPoolEntry(txChild[i], 0, 0, 0.0, 1)); + testPool.addUnchecked(txGrandChild[i].GetTxid(), CTxMemPoolEntry(txGrandChild[i], 0, 0, 0.0, 1)); } // Now remove the parent, as might happen if a block-re-org occurs but the parent cannot be // put into the mempool (maybe because it is non-standard): diff --git a/src/test/miner_tests.cpp b/src/test/miner_tests.cpp index 930155225..a6df44652 100644 --- a/src/test/miner_tests.cpp +++ b/src/test/miner_tests.cpp @@ -253,14 +253,14 @@ BOOST_AUTO_TEST_CASE(CreateNewBlock_validity) tx.vin.resize(1); // NOTE: OP_NOP is used to force 20 SigOps for the CHECKMULTISIG tx.vin[0].scriptSig = CScript() << OP_0 << OP_0 << OP_0 << OP_NOP << OP_CHECKMULTISIG << OP_1; - tx.vin[0].prevout.hash = txFirst[0]->GetHash(); + tx.vin[0].prevout.hash = txFirst[0]->GetTxid(); tx.vin[0].prevout.n = 0; tx.vout.resize(1); tx.vout[0].nValue = 50000LL; for (unsigned int i = 0; i < 1001; ++i) { tx.vout[0].nValue -= 10; - hash = tx.GetHash(); + hash = tx.GetTxid(); mempool.addUnchecked(hash, CTxMemPoolEntry(tx, 11, GetTime(), 111.0, 11)); tx.vin[0].prevout.hash = hash; } @@ -275,12 +275,12 @@ BOOST_AUTO_TEST_CASE(CreateNewBlock_validity) for (unsigned int i = 0; i < 18; ++i) tx.vin[0].scriptSig << vchData << OP_DROP; tx.vin[0].scriptSig << OP_1; - tx.vin[0].prevout.hash = txFirst[0]->GetHash(); + tx.vin[0].prevout.hash = txFirst[0]->GetTxid(); tx.vout[0].nValue = 50000LL; for (unsigned int i = 0; i < 128; ++i) { tx.vout[0].nValue -= 350; - hash = tx.GetHash(); + hash = tx.GetTxid(); mempool.addUnchecked(hash, CTxMemPoolEntry(tx, 11, GetTime(), 111.0, 11)); tx.vin[0].prevout.hash = hash; } @@ -289,7 +289,7 @@ BOOST_AUTO_TEST_CASE(CreateNewBlock_validity) mempool.clear(); // orphan in mempool - hash = tx.GetHash(); + hash = tx.GetTxid(); mempool.addUnchecked(hash, CTxMemPoolEntry(tx, 11, GetTime(), 111.0, 11)); BOOST_CHECK(pblocktemplate = CreateNewBlock(scriptPubKey)); delete pblocktemplate; @@ -297,17 +297,17 @@ BOOST_AUTO_TEST_CASE(CreateNewBlock_validity) // child with higher priority than parent tx.vin[0].scriptSig = CScript() << OP_1; - tx.vin[0].prevout.hash = txFirst[1]->GetHash(); + tx.vin[0].prevout.hash = txFirst[1]->GetTxid(); tx.vout[0].nValue = 39000LL; - hash = tx.GetHash(); + hash = tx.GetTxid(); mempool.addUnchecked(hash, CTxMemPoolEntry(tx, 11, GetTime(), 111.0, 11)); tx.vin[0].prevout.hash = hash; tx.vin.resize(2); tx.vin[1].scriptSig = CScript() << OP_1; - tx.vin[1].prevout.hash = txFirst[0]->GetHash(); + tx.vin[1].prevout.hash = txFirst[0]->GetTxid(); tx.vin[1].prevout.n = 0; tx.vout[0].nValue = 49000LL; - hash = tx.GetHash(); + hash = tx.GetTxid(); mempool.addUnchecked(hash, CTxMemPoolEntry(tx, 11, GetTime(), 111.0, 11)); BOOST_CHECK(pblocktemplate = CreateNewBlock(scriptPubKey)); delete pblocktemplate; @@ -318,39 +318,39 @@ BOOST_AUTO_TEST_CASE(CreateNewBlock_validity) tx.vin[0].prevout.SetNull(); tx.vin[0].scriptSig = CScript() << OP_0 << OP_1; tx.vout[0].nValue = 0; - hash = tx.GetHash(); + hash = tx.GetTxid(); mempool.addUnchecked(hash, CTxMemPoolEntry(tx, 11, GetTime(), 111.0, 11)); BOOST_CHECK(pblocktemplate = CreateNewBlock(scriptPubKey)); delete pblocktemplate; mempool.clear(); // invalid (pre-p2sh) txn in mempool - tx.vin[0].prevout.hash = txFirst[0]->GetHash(); + tx.vin[0].prevout.hash = txFirst[0]->GetTxid(); tx.vin[0].prevout.n = 0; tx.vin[0].scriptSig = CScript() << OP_1; tx.vout[0].nValue = 49000LL; script = CScript() << OP_0; tx.vout[0].scriptPubKey = GetScriptForDestination(CScriptID(script)); - hash = tx.GetHash(); + hash = tx.GetTxid(); mempool.addUnchecked(hash, CTxMemPoolEntry(tx, 11, GetTime(), 111.0, 11)); tx.vin[0].prevout.hash = hash; tx.vin[0].scriptSig = CScript() << (std::vector)script; tx.vout[0].nValue -= 10000; - hash = tx.GetHash(); + hash = tx.GetTxid(); mempool.addUnchecked(hash, CTxMemPoolEntry(tx, 11, GetTime(), 111.0, 11)); BOOST_CHECK(pblocktemplate = CreateNewBlock(scriptPubKey)); delete pblocktemplate; mempool.clear(); // double spend txn pair in mempool - tx.vin[0].prevout.hash = txFirst[0]->GetHash(); + tx.vin[0].prevout.hash = txFirst[0]->GetTxid(); tx.vin[0].scriptSig = CScript() << OP_1; tx.vout[0].nValue = 49000LL; tx.vout[0].scriptPubKey = CScript() << OP_1; - hash = tx.GetHash(); + hash = tx.GetTxid(); mempool.addUnchecked(hash, CTxMemPoolEntry(tx, 11, GetTime(), 111.0, 11)); tx.vout[0].scriptPubKey = CScript() << OP_2; - hash = tx.GetHash(); + hash = tx.GetTxid(); mempool.addUnchecked(hash, CTxMemPoolEntry(tx, 11, GetTime(), 111.0, 11)); BOOST_CHECK(pblocktemplate = CreateNewBlock(scriptPubKey)); delete pblocktemplate; @@ -370,19 +370,19 @@ BOOST_AUTO_TEST_CASE(CreateNewBlock_validity) SetMockTime(chainActive.Tip()->GetMedianTimePast()+1); // height locked - tx.vin[0].prevout.hash = txFirst[0]->GetHash(); + tx.vin[0].prevout.hash = txFirst[0]->GetTxid(); tx.vin[0].scriptSig = CScript() << OP_1; tx.vin[0].nSequence = 0; tx.vout[0].nValue = 49000LL; tx.vout[0].scriptPubKey = CScript() << OP_1; tx.nLockTime = chainActive.Tip()->nHeight+1; - hash = tx.GetHash(); + hash = tx.GetTxid(); mempool.addUnchecked(hash, CTxMemPoolEntry(tx, 11, GetTime(), 111.0, 11)); BOOST_CHECK(!CheckFinalTx(tx, LOCKTIME_MEDIAN_TIME_PAST)); // time locked tx2.vin.resize(1); - tx2.vin[0].prevout.hash = txFirst[1]->GetHash(); + tx2.vin[0].prevout.hash = txFirst[1]->GetTxid(); tx2.vin[0].prevout.n = 0; tx2.vin[0].scriptSig = CScript() << OP_1; tx2.vin[0].nSequence = 0; @@ -390,7 +390,7 @@ BOOST_AUTO_TEST_CASE(CreateNewBlock_validity) tx2.vout[0].nValue = 79000LL; tx2.vout[0].scriptPubKey = CScript() << OP_1; tx2.nLockTime = chainActive.Tip()->GetMedianTimePast()+1; - hash = tx2.GetHash(); + hash = tx2.GetTxid(); mempool.addUnchecked(hash, CTxMemPoolEntry(tx2, 11, GetTime(), 111.0, 11)); BOOST_CHECK(!CheckFinalTx(tx2, LOCKTIME_MEDIAN_TIME_PAST)); diff --git a/src/test/multisig_tests.cpp b/src/test/multisig_tests.cpp index 6b189a6b5..cc6f6acbf 100644 --- a/src/test/multisig_tests.cpp +++ b/src/test/multisig_tests.cpp @@ -72,7 +72,7 @@ BOOST_AUTO_TEST_CASE(multisig_verify) txTo[i].vin.resize(1); txTo[i].vout.resize(1); txTo[i].vin[0].prevout.n = i; - txTo[i].vin[0].prevout.hash = txFrom.GetHash(); + txTo[i].vin[0].prevout.hash = txFrom.GetTxid(); txTo[i].vout[0].nValue = 1; } @@ -306,7 +306,7 @@ BOOST_AUTO_TEST_CASE(multisig_Sign) txTo[i].vin.resize(1); txTo[i].vout.resize(1); txTo[i].vin[0].prevout.n = i; - txTo[i].vin[0].prevout.hash = txFrom.GetHash(); + txTo[i].vin[0].prevout.hash = txFrom.GetTxid(); txTo[i].vout[0].nValue = 1; } diff --git a/src/test/pmt_tests.cpp b/src/test/pmt_tests.cpp index f6d06d680..e39aff233 100644 --- a/src/test/pmt_tests.cpp +++ b/src/test/pmt_tests.cpp @@ -51,7 +51,7 @@ BOOST_AUTO_TEST_CASE(pmt_test1) uint256 merkleRoot1 = block.BuildMerkleTree(); std::vector vTxid(nTx, uint256()); for (unsigned int j=0; j 1) { nTx_ = (nTx_+1)/2; diff --git a/src/test/policyestimator_tests.cpp b/src/test/policyestimator_tests.cpp index cb64ee7c6..b6ef9e573 100644 --- a/src/test/policyestimator_tests.cpp +++ b/src/test/policyestimator_tests.cpp @@ -62,7 +62,7 @@ BOOST_AUTO_TEST_CASE(BlockPolicyEstimates) for (int j = 0; j < 10; j++) { // For each fee/pri multiple for (int k = 0; k < 5; k++) { // add 4 fee txs for every priority tx tx.vin[0].prevout.n = 10000*blocknum+100*j+k; // make transaction unique - uint256 hash = tx.GetHash(); + uint256 hash = tx.GetTxid(); mpool.addUnchecked(hash, CTxMemPoolEntry(tx, feeV[k/4][j], GetTime(), priV[k/4][j], blocknum, mpool.HasNoInputsOf(tx))); txHashes[j].push_back(hash); } @@ -131,7 +131,7 @@ BOOST_AUTO_TEST_CASE(BlockPolicyEstimates) for (int j = 0; j < 10; j++) { // For each fee/pri multiple for (int k = 0; k < 5; k++) { // add 4 fee txs for every priority tx tx.vin[0].prevout.n = 10000*blocknum+100*j+k; - uint256 hash = tx.GetHash(); + uint256 hash = tx.GetTxid(); mpool.addUnchecked(hash, CTxMemPoolEntry(tx, feeV[k/4][j], GetTime(), priV[k/4][j], blocknum, mpool.HasNoInputsOf(tx))); txHashes[j].push_back(hash); } @@ -167,7 +167,7 @@ BOOST_AUTO_TEST_CASE(BlockPolicyEstimates) for (int j = 0; j < 10; j++) { // For each fee/pri multiple for (int k = 0; k < 5; k++) { // add 4 fee txs for every priority tx tx.vin[0].prevout.n = 10000*blocknum+100*j+k; - uint256 hash = tx.GetHash(); + uint256 hash = tx.GetTxid(); mpool.addUnchecked(hash, CTxMemPoolEntry(tx, feeV[k/4][j], GetTime(), priV[k/4][j], blocknum, mpool.HasNoInputsOf(tx))); CTransaction btx; if (mpool.lookup(hash, btx)) diff --git a/src/test/script_P2SH_tests.cpp b/src/test/script_P2SH_tests.cpp index c8cfe2872..cc8c5662d 100644 --- a/src/test/script_P2SH_tests.cpp +++ b/src/test/script_P2SH_tests.cpp @@ -40,7 +40,7 @@ Verify(const CScript& scriptSig, const CScript& scriptPubKey, bool fStrict, Scri txTo.vin.resize(1); txTo.vout.resize(1); txTo.vin[0].prevout.n = 0; - txTo.vin[0].prevout.hash = txFrom.GetHash(); + txTo.vin[0].prevout.hash = txFrom.GetTxid(); txTo.vin[0].scriptSig = scriptSig; txTo.vout[0].nValue = 1; @@ -98,7 +98,7 @@ BOOST_AUTO_TEST_CASE(sign) txTo[i].vin.resize(1); txTo[i].vout.resize(1); txTo[i].vin[0].prevout.n = i; - txTo[i].vin[0].prevout.hash = txFrom.GetHash(); + txTo[i].vin[0].prevout.hash = txFrom.GetTxid(); txTo[i].vout[0].nValue = 1; #ifdef ENABLE_WALLET BOOST_CHECK_MESSAGE(IsMine(keystore, txFrom.vout[i].scriptPubKey), strprintf("IsMine %d", i)); @@ -194,7 +194,7 @@ BOOST_AUTO_TEST_CASE(set) txTo[i].vin.resize(1); txTo[i].vout.resize(1); txTo[i].vin[0].prevout.n = i; - txTo[i].vin[0].prevout.hash = txFrom.GetHash(); + txTo[i].vin[0].prevout.hash = txFrom.GetTxid(); txTo[i].vout[0].nValue = 1*CENT; txTo[i].vout[0].scriptPubKey = inner[i]; #ifdef ENABLE_WALLET @@ -320,7 +320,7 @@ BOOST_AUTO_TEST_CASE(AreInputsStandard) txFrom.vout[6].scriptPubKey = GetScriptForDestination(CScriptID(twentySigops)); txFrom.vout[6].nValue = 6000; - coins.ModifyCoins(txFrom.GetHash())->FromTx(txFrom, 0); + coins.ModifyCoins(txFrom.GetTxid())->FromTx(txFrom, 0); CMutableTransaction txTo; txTo.vout.resize(1); @@ -330,7 +330,7 @@ BOOST_AUTO_TEST_CASE(AreInputsStandard) for (int i = 0; i < 5; i++) { txTo.vin[i].prevout.n = i; - txTo.vin[i].prevout.hash = txFrom.GetHash(); + txTo.vin[i].prevout.hash = txFrom.GetTxid(); } BOOST_CHECK(SignSignature(keystore, txFrom, txTo, 0)); BOOST_CHECK(SignSignature(keystore, txFrom, txTo, 1)); @@ -360,7 +360,7 @@ BOOST_AUTO_TEST_CASE(AreInputsStandard) txToNonStd1.vout[0].nValue = 1000; txToNonStd1.vin.resize(1); txToNonStd1.vin[0].prevout.n = 5; - txToNonStd1.vin[0].prevout.hash = txFrom.GetHash(); + txToNonStd1.vin[0].prevout.hash = txFrom.GetTxid(); txToNonStd1.vin[0].scriptSig << static_cast >(sixteenSigops); BOOST_CHECK(!::AreInputsStandard(txToNonStd1, coins)); @@ -372,7 +372,7 @@ BOOST_AUTO_TEST_CASE(AreInputsStandard) txToNonStd2.vout[0].nValue = 1000; txToNonStd2.vin.resize(1); txToNonStd2.vin[0].prevout.n = 6; - txToNonStd2.vin[0].prevout.hash = txFrom.GetHash(); + txToNonStd2.vin[0].prevout.hash = txFrom.GetTxid(); txToNonStd2.vin[0].scriptSig << static_cast >(twentySigops); BOOST_CHECK(!::AreInputsStandard(txToNonStd2, coins)); diff --git a/src/test/script_tests.cpp b/src/test/script_tests.cpp index c0614cca4..c6b4ed39e 100644 --- a/src/test/script_tests.cpp +++ b/src/test/script_tests.cpp @@ -79,7 +79,7 @@ CMutableTransaction BuildSpendingTransaction(const CScript& scriptSig, const CMu txSpend.nLockTime = 0; txSpend.vin.resize(1); txSpend.vout.resize(1); - txSpend.vin[0].prevout.hash = txCredit.GetHash(); + txSpend.vin[0].prevout.hash = txCredit.GetTxid(); txSpend.vin[0].prevout.n = 0; txSpend.vin[0].scriptSig = scriptSig; txSpend.vin[0].nSequence = std::numeric_limits::max(); diff --git a/src/test/transaction_tests.cpp b/src/test/transaction_tests.cpp index 0c6c068f4..2e701b15e 100644 --- a/src/test/transaction_tests.cpp +++ b/src/test/transaction_tests.cpp @@ -279,14 +279,14 @@ SetupDummyInputs(CBasicKeyStore& keystoreRet, CCoinsViewCache& coinsRet) dummyTransactions[0].vout[0].scriptPubKey << ToByteVector(key[0].GetPubKey()) << OP_CHECKSIG; dummyTransactions[0].vout[1].nValue = 50*CENT; dummyTransactions[0].vout[1].scriptPubKey << ToByteVector(key[1].GetPubKey()) << OP_CHECKSIG; - coinsRet.ModifyCoins(dummyTransactions[0].GetHash())->FromTx(dummyTransactions[0], 0); + coinsRet.ModifyCoins(dummyTransactions[0].GetTxid())->FromTx(dummyTransactions[0], 0); dummyTransactions[1].vout.resize(2); dummyTransactions[1].vout[0].nValue = 21*CENT; dummyTransactions[1].vout[0].scriptPubKey = GetScriptForDestination(key[2].GetPubKey().GetID()); dummyTransactions[1].vout[1].nValue = 22*CENT; dummyTransactions[1].vout[1].scriptPubKey = GetScriptForDestination(key[3].GetPubKey().GetID()); - coinsRet.ModifyCoins(dummyTransactions[1].GetHash())->FromTx(dummyTransactions[1], 0); + coinsRet.ModifyCoins(dummyTransactions[1].GetTxid())->FromTx(dummyTransactions[1], 0); return dummyTransactions; } @@ -508,13 +508,13 @@ BOOST_AUTO_TEST_CASE(test_Get) CMutableTransaction t1; t1.vin.resize(3); - t1.vin[0].prevout.hash = dummyTransactions[0].GetHash(); + t1.vin[0].prevout.hash = dummyTransactions[0].GetTxid(); t1.vin[0].prevout.n = 1; t1.vin[0].scriptSig << std::vector(65, 0); - t1.vin[1].prevout.hash = dummyTransactions[1].GetHash(); + t1.vin[1].prevout.hash = dummyTransactions[1].GetTxid(); t1.vin[1].prevout.n = 0; t1.vin[1].scriptSig << std::vector(65, 0) << std::vector(33, 4); - t1.vin[2].prevout.hash = dummyTransactions[1].GetHash(); + t1.vin[2].prevout.hash = dummyTransactions[1].GetTxid(); t1.vin[2].prevout.n = 1; t1.vin[2].scriptSig << std::vector(65, 0) << std::vector(33, 4); t1.vout.resize(2); @@ -543,7 +543,7 @@ BOOST_AUTO_TEST_CASE(test_IsStandard) CMutableTransaction t; t.vin.resize(1); - t.vin[0].prevout.hash = dummyTransactions[0].GetHash(); + t.vin[0].prevout.hash = dummyTransactions[0].GetTxid(); t.vin[0].prevout.n = 1; t.vin[0].scriptSig << std::vector(65, 0); t.vout.resize(1); diff --git a/src/txmempool.cpp b/src/txmempool.cpp index e9c846485..77dcc0153 100644 --- a/src/txmempool.cpp +++ b/src/txmempool.cpp @@ -118,17 +118,17 @@ void CTxMemPool::remove(const CTransaction &origTx, std::list& rem { LOCK(cs); std::deque txToRemove; - txToRemove.push_back(origTx.GetHash()); - if (fRecursive && !mapTx.count(origTx.GetHash())) { + txToRemove.push_back(origTx.GetTxid()); + if (fRecursive && !mapTx.count(origTx.GetTxid())) { // If recursively removing but origTx isn't in the mempool // be sure to remove any children that are in the pool. This can // happen during chain re-orgs if origTx isn't re-accepted into // the mempool for any reason. for (unsigned int i = 0; i < origTx.vout.size(); i++) { - std::map::iterator it = mapNextTx.find(COutPoint(origTx.GetHash(), i)); + std::map::iterator it = mapNextTx.find(COutPoint(origTx.GetTxid(), i)); if (it == mapNextTx.end()) continue; - txToRemove.push_back(it->second.ptx->GetHash()); + txToRemove.push_back(it->second.ptx->GetTxid()); } } while (!txToRemove.empty()) @@ -143,7 +143,7 @@ void CTxMemPool::remove(const CTransaction &origTx, std::list& rem std::map::iterator it = mapNextTx.find(COutPoint(hash, i)); if (it == mapNextTx.end()) continue; - txToRemove.push_back(it->second.ptx->GetHash()); + txToRemove.push_back(it->second.ptx->GetTxid()); } } BOOST_FOREACH(const CTxIn& txin, tx.vin) @@ -254,7 +254,7 @@ void CTxMemPool::removeForBlock(const std::vector& vtx, unsigned i std::vector entries; BOOST_FOREACH(const CTransaction& tx, vtx) { - uint256 hash = tx.GetHash(); + uint256 hash = tx.GetTxid(); if (mapTx.count(hash)) entries.push_back(mapTx[hash]); } @@ -263,7 +263,7 @@ void CTxMemPool::removeForBlock(const std::vector& vtx, unsigned i std::list dummy; remove(tx, dummy, false); removeConflicts(tx, conflicts); - ClearPrioritisation(tx.GetHash()); + ClearPrioritisation(tx.GetTxid()); } // After the txs in the new block have been removed from the mempool, update policy estimates minerPolicyEstimator->processBlock(nBlockHeight, entries, fCurrentEstimate); @@ -361,7 +361,7 @@ void CTxMemPool::check(const CCoinsViewCache *pcoins) const } } for (std::map::const_iterator it = mapNextTx.begin(); it != mapNextTx.end(); it++) { - uint256 hash = it->second.ptx->GetHash(); + uint256 hash = it->second.ptx->GetTxid(); map::const_iterator it2 = mapTx.find(hash); const CTransaction& tx = it2->second.GetTx(); assert(it2 != mapTx.end()); @@ -371,7 +371,7 @@ void CTxMemPool::check(const CCoinsViewCache *pcoins) const } for (std::map::const_iterator it = mapNullifiers.begin(); it != mapNullifiers.end(); it++) { - uint256 hash = it->second->GetHash(); + uint256 hash = it->second->GetTxid(); map::const_iterator it2 = mapTx.find(hash); const CTransaction& tx = it2->second.GetTx(); assert(it2 != mapTx.end()); diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index ed8aec4c6..6cbd55373 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -74,7 +74,7 @@ void WalletTxToJSON(const CWalletTx& wtx, Object& entry) entry.push_back(Pair("blockindex", wtx.nIndex)); entry.push_back(Pair("blocktime", mapBlockIndex[wtx.hashBlock]->GetBlockTime())); } - uint256 hash = wtx.GetHash(); + uint256 hash = wtx.GetTxid(); entry.push_back(Pair("txid", hash.GetHex())); Array conflicts; BOOST_FOREACH(const uint256& conflict, wtx.GetConflicts()) @@ -439,7 +439,7 @@ Value sendtoaddress(const Array& params, bool fHelp) SendMoney(address.Get(), nAmount, fSubtractFeeFromAmount, wtx); - return wtx.GetHash().GetHex(); + return wtx.GetTxid().GetHex(); } Value listaddressgroupings(const Array& params, bool fHelp) @@ -916,7 +916,7 @@ Value sendfrom(const Array& params, bool fHelp) SendMoney(address.Get(), nAmount, false, wtx); - return wtx.GetHash().GetHex(); + return wtx.GetTxid().GetHex(); } @@ -1023,7 +1023,7 @@ Value sendmany(const Array& params, bool fHelp) if (!pwalletMain->CommitTransaction(wtx, keyChange)) throw JSONRPCError(RPC_WALLET_ERROR, "Transaction commit failed"); - return wtx.GetHash().GetHex(); + return wtx.GetTxid().GetHex(); } // Defined in rpcmisc.cpp @@ -1135,7 +1135,7 @@ Value ListReceived(const Array& params, bool fByAccounts) tallyitem& item = mapTally[address]; item.nAmount += txout.nValue; item.nConf = min(item.nConf, nDepth); - item.txids.push_back(wtx.GetHash()); + item.txids.push_back(wtx.GetTxid()); if (mine & ISMINE_WATCH_ONLY) item.fIsWatchonly = true; } @@ -2324,7 +2324,7 @@ Value listunspent(const Array& params, bool fHelp) CAmount nValue = out.tx->vout[out.i].nValue; const CScript& pk = out.tx->vout[out.i].scriptPubKey; Object entry; - entry.push_back(Pair("txid", out.tx->GetHash().GetHex())); + entry.push_back(Pair("txid", out.tx->GetTxid().GetHex())); entry.push_back(Pair("vout", out.i)); CTxDestination address; if (ExtractDestination(out.tx->vout[out.i].scriptPubKey, address)) { diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp index 242442061..f8215c939 100644 --- a/src/wallet/wallet.cpp +++ b/src/wallet/wallet.cpp @@ -58,7 +58,7 @@ struct CompareValueOnly std::string COutput::ToString() const { - return strprintf("COutput(%s, %d, %d) [%s]", tx->GetHash().ToString(), i, nDepth, FormatMoney(tx->vout[i].nValue)); + return strprintf("COutput(%s, %d, %d) [%s]", tx->GetTxid().ToString(), i, nDepth, FormatMoney(tx->vout[i].nValue)); } const CWalletTx* CWallet::GetWalletTx(const uint256& hash) const @@ -613,7 +613,7 @@ void CWallet::MarkDirty() bool CWallet::AddToWallet(const CWalletTx& wtxIn, bool fFromLoadWallet, CWalletDB* pwalletdb) { - uint256 hash = wtxIn.GetHash(); + uint256 hash = wtxIn.GetTxid(); if (fFromLoadWallet) { @@ -676,7 +676,7 @@ bool CWallet::AddToWallet(const CWalletTx& wtxIn, bool fFromLoadWallet, CWalletD } else LogPrintf("AddToWallet(): found %s in block %s not in index\n", - wtxIn.GetHash().ToString(), + wtxIn.GetTxid().ToString(), wtxIn.hashBlock.ToString()); } AddToSpends(hash); @@ -705,7 +705,7 @@ bool CWallet::AddToWallet(const CWalletTx& wtxIn, bool fFromLoadWallet, CWalletD } //// debug print - LogPrintf("AddToWallet %s %s%s\n", wtxIn.GetHash().ToString(), (fInsertedNew ? "new" : ""), (fUpdated ? "update" : "")); + LogPrintf("AddToWallet %s %s%s\n", wtxIn.GetTxid().ToString(), (fInsertedNew ? "new" : ""), (fUpdated ? "update" : "")); // Write to disk if (fInsertedNew || fUpdated) @@ -723,7 +723,7 @@ bool CWallet::AddToWallet(const CWalletTx& wtxIn, bool fFromLoadWallet, CWalletD if ( !strCmd.empty()) { - boost::replace_all(strCmd, "%s", wtxIn.GetHash().GetHex()); + boost::replace_all(strCmd, "%s", wtxIn.GetTxid().GetHex()); boost::thread t(runCommand, strCmd); // thread runs free } @@ -740,7 +740,7 @@ bool CWallet::AddToWalletIfInvolvingMe(const CTransaction& tx, const CBlock* pbl { { AssertLockHeld(cs_wallet); - bool fExisted = mapWallet.count(tx.GetHash()) != 0; + bool fExisted = mapWallet.count(tx.GetTxid()) != 0; if (fExisted && !fUpdate) return false; if (fExisted || IsMine(tx) || IsFromMe(tx)) { @@ -935,7 +935,7 @@ int CWalletTx::GetRequestCount() const else { // Did anyone request this transaction? - map::const_iterator mi = pwallet->mapRequestCount.find(GetHash()); + map::const_iterator mi = pwallet->mapRequestCount.find(GetTxid()); if (mi != pwallet->mapRequestCount.end()) { nRequests = (*mi).second; @@ -993,7 +993,7 @@ void CWalletTx::GetAmounts(list& listReceived, if (!ExtractDestination(txout.scriptPubKey, address)) { LogPrintf("CWalletTx::GetAmounts: Unknown transaction type found, txid %s\n", - this->GetHash().ToString()); + this->GetTxid().ToString()); address = CNoDestination(); } @@ -1048,7 +1048,7 @@ void CWalletTx::GetAccountAmounts(const string& strAccount, CAmount& nReceived, bool CWalletTx::WriteToDisk(CWalletDB *pwalletdb) { - return pwalletdb->WriteTx(GetHash(), *this); + return pwalletdb->WriteTx(GetTxid(), *this); } void CWallet::WitnessNoteCommitment(std::vector commitments, @@ -1167,7 +1167,7 @@ void CWallet::ReacceptWalletTransactions() { const uint256& wtxid = item.first; CWalletTx& wtx = item.second; - assert(wtx.GetHash() == wtxid); + assert(wtx.GetTxid() == wtxid); int nDepth = wtx.GetDepthInMainChain(); @@ -1192,7 +1192,7 @@ bool CWalletTx::RelayWalletTransaction() if (!IsCoinBase()) { if (GetDepthInMainChain() == 0) { - LogPrintf("Relaying wtx %s\n", GetHash().ToString()); + LogPrintf("Relaying wtx %s\n", GetTxid().ToString()); RelayTransaction((CTransaction)*this); return true; } @@ -1205,7 +1205,7 @@ set CWalletTx::GetConflicts() const set result; if (pwallet != NULL) { - uint256 myHash = GetHash(); + uint256 myHash = GetTxid(); result = pwallet->GetConflicts(myHash); result.erase(myHash); } @@ -1303,7 +1303,7 @@ CAmount CWalletTx::GetAvailableCredit(bool fUseCache) const return nAvailableCreditCached; CAmount nCredit = 0; - uint256 hashTx = GetHash(); + uint256 hashTx = GetTxid(); for (unsigned int i = 0; i < vout.size(); i++) { if (!pwallet->IsSpent(hashTx, i)) @@ -1349,7 +1349,7 @@ CAmount CWalletTx::GetAvailableWatchOnlyCredit(const bool& fUseCache) const CAmount nCredit = 0; for (unsigned int i = 0; i < vout.size(); i++) { - if (!pwallet->IsSpent(GetHash(), i)) + if (!pwallet->IsSpent(GetTxid(), i)) { const CTxOut &txout = vout[i]; nCredit += pwallet->GetCredit(txout, ISMINE_WATCH_ONLY); @@ -1418,7 +1418,7 @@ std::vector CWallet::ResendWalletTransactionsBefore(int64_t nTime) { CWalletTx& wtx = *item.second; if (wtx.RelayWalletTransaction()) - result.push_back(wtx.GetHash()); + result.push_back(wtx.GetTxid()); } return result; } @@ -1954,7 +1954,7 @@ bool CWallet::CreateTransaction(const vector& vecSend, // Note how the sequence number is set to max()-1 so that the // nLockTime set above actually works. BOOST_FOREACH(const PAIRTYPE(const CWalletTx*,unsigned int)& coin, setCoins) - txNew.vin.push_back(CTxIn(coin.first->GetHash(),coin.second,CScript(), + txNew.vin.push_back(CTxIn(coin.first->GetTxid(),coin.second,CScript(), std::numeric_limits::max()-1)); // Sign @@ -2042,7 +2042,7 @@ bool CWallet::CommitTransaction(CWalletTx& wtxNew, CReserveKey& reservekey) { CWalletTx &coin = mapWallet[txin.prevout.hash]; coin.BindWallet(this); - NotifyTransactionChanged(this, coin.GetHash(), CT_UPDATED); + NotifyTransactionChanged(this, coin.GetTxid(), CT_UPDATED); } if (fFileBacked) @@ -2050,7 +2050,7 @@ bool CWallet::CommitTransaction(CWalletTx& wtxNew, CReserveKey& reservekey) } // Track how many getdata requests our transaction gets - mapRequestCount[wtxNew.GetHash()] = 0; + mapRequestCount[wtxNew.GetTxid()] = 0; if (fBroadcastTransactions) { @@ -2781,7 +2781,7 @@ int CMerkleTx::GetDepthInMainChainINTERNAL(const CBlockIndex* &pindexRet) const // Make sure the merkle branch connects to this block if (!fMerkleVerified) { - if (CBlock::CheckMerkleBranch(GetHash(), vMerkleBranch, nIndex) != pindex->hashMerkleRoot) + if (CBlock::CheckMerkleBranch(GetTxid(), vMerkleBranch, nIndex) != pindex->hashMerkleRoot) return 0; fMerkleVerified = true; } @@ -2794,7 +2794,7 @@ int CMerkleTx::GetDepthInMainChain(const CBlockIndex* &pindexRet) const { AssertLockHeld(cs_main); int nResult = GetDepthInMainChainINTERNAL(pindexRet); - if (nResult == 0 && !mempool.exists(GetHash())) + if (nResult == 0 && !mempool.exists(GetTxid())) return -1; // Not in chain, not in mempool return nResult; diff --git a/src/wallet/walletdb.cpp b/src/wallet/walletdb.cpp index f777926e7..6f08ad681 100644 --- a/src/wallet/walletdb.cpp +++ b/src/wallet/walletdb.cpp @@ -288,7 +288,7 @@ DBErrors CWalletDB::ReorderTransactions(CWallet* pwallet) if (pwtx) { - if (!WriteTx(pwtx->GetHash(), *pwtx)) + if (!WriteTx(pwtx->GetTxid(), *pwtx)) return DB_LOAD_FAIL; } else @@ -312,7 +312,7 @@ DBErrors CWalletDB::ReorderTransactions(CWallet* pwallet) // Since we're changing the order, write it back if (pwtx) { - if (!WriteTx(pwtx->GetHash(), *pwtx)) + if (!WriteTx(pwtx->GetTxid(), *pwtx)) return DB_LOAD_FAIL; } else @@ -371,7 +371,7 @@ ReadKeyValue(CWallet* pwallet, CDataStream& ssKey, CDataStream& ssValue, CWalletTx wtx; ssValue >> wtx; CValidationState state; - if (!(CheckTransaction(wtx, state) && (wtx.GetHash() == hash) && state.IsValid())) + if (!(CheckTransaction(wtx, state) && (wtx.GetTxid() == hash) && state.IsValid())) return false; // Undo serialize changes in 31600 diff --git a/src/zcbenchmarks.cpp b/src/zcbenchmarks.cpp index 5e90c55b5..19ddf8c19 100644 --- a/src/zcbenchmarks.cpp +++ b/src/zcbenchmarks.cpp @@ -155,7 +155,7 @@ double benchmark_large_tx() auto orig_tx = CTransaction(m_orig_tx); CMutableTransaction spending_tx; - auto input_hash = orig_tx.GetHash(); + auto input_hash = orig_tx.GetTxid(); // Add NUM_INPUTS inputs for (size_t i = 0; i < NUM_INPUTS; i++) { spending_tx.vin.emplace_back(input_hash, 0); From 29306269f4c4a09201087025407b7d914912baad Mon Sep 17 00:00:00 2001 From: Simon Date: Mon, 25 Jul 2016 23:23:43 -0700 Subject: [PATCH 08/16] Set nLockTime in CreateNewBlock() so coinbase txs do not have the same txid. Update test data in miner_tests. --- src/miner.cpp | 5 + src/test/miner_tests.cpp | 218 +++++++++++++++++++-------------------- 2 files changed, 114 insertions(+), 109 deletions(-) diff --git a/src/miner.cpp b/src/miner.cpp index 73a6c9bf7..fd5032252 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -335,6 +335,11 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn) txNew.vout[0].scriptPubKey = scriptPubKeyIn; txNew.vout[0].nValue = GetBlockSubsidy(nHeight, chainparams.GetConsensus()); + // If nLockTime is 0, coinbase txs with the same inputs and outputs may have the same non-malleable txid. + // So we set nLockTime to the previous block height to ensure this coinbase tx will be accepted into + // the next block. This replicates the behaviour of having nLockTime of 0. + txNew.nLockTime = pindexPrev->nHeight; + if ((nHeight > 0) && (nHeight < chainparams.GetConsensus().nSubsidyHalvingInterval)) { // Founders reward is 20% of the block subsidy auto vFoundersReward = txNew.vout[0].nValue / 5; diff --git a/src/test/miner_tests.cpp b/src/test/miner_tests.cpp index a6df44652..2f3557ee5 100644 --- a/src/test/miner_tests.cpp +++ b/src/test/miner_tests.cpp @@ -25,115 +25,115 @@ struct { uint32_t vSolutions[NUM_EQUIHASH_SOLUTIONS]; } blockinfo[] = { {"0000000000000000000000000000000000000000000000000000000000000000", {1113402,26940724,29426619,29650324,1651155,28182833,2919013,20269474,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {2541603,14114747,21660764,25879244,5433179,8124465,25666254,26548855,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {11929257,25158964,16095230,24841514,12867411,15686246,25441631,29728310,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {5105680,21328455,16152510,29495600,12443572,24958281,15815721,19841625,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {35834,7761680,14791216,18834970,10322825,29492625,10893714,26525542,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {1102283,26829250,13659455,22864463,3780400,22478846,21827356,30064470,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {2037605,12627800,15388193,32785696,20790459,24445774,23758535,27841410,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {3701973,27733118,20055632,32981287,11852035,23473816,12069611,24241138,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {1239069,7235416,16525930,24221834,17217527,18522923,28626536,33160290,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {257184,24892410,5577177,28973426,3838592,21876018,10548097,32849787,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {594750,25868567,15236813,21639078,695051,6577690,7049607,26122407,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {2953230,27002289,15387579,25612682,19679247,22183247,27483477,29772736,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {14264159,31139880,19405862,22349908,20538800,32612497,22946641,29253443,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {43271,13347426,4967623,27686294,2049029,10643471,26256712,27072023,}}, - {"0000000000000000000000000000000000000000000000000000000000000002", {4264458,5957348,10688362,25520226,5289719,25026457,7796449,22800689,}}, - {"0000000000000000000000000000000000000000000000000000000000000002", {826381,32629643,2098678,20063524,2756556,20471197,7523623,30720049,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {4448010,24132030,18245842,18676702,5480533,22770981,6876675,13164821,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {3619321,9958701,24513456,30709357,6570637,29783605,12349463,19460957,}}, - {"0000000000000000000000000000000000000000000000000000000000000003", {3338352,22879126,22388799,28738999,6338378,26770353,11615580,32570967,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {583162,28968143,8506860,10059788,1382777,17695787,7898822,28735790,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {689723,33265955,4951038,26417615,2878474,15296534,17067304,23912090,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {13387048,24067520,19933907,26756676,25442786,31637164,25467610,28623833,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {1082504,8652408,9758889,10565277,2825000,24483755,8669404,26856495,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {832465,1290760,8314106,21253530,7392507,18386499,17437969,17897762,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {402809,14238247,8846864,15628890,1394254,25476988,9768531,20445018,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {4724342,31383028,17023768,33283980,5666748,16675392,21273019,24165352,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {3671473,32986995,19868903,33549652,7343386,19607857,11053667,30367575,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {3776234,23322341,13313550,32344754,10577747,13162296,26428875,26771723,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {243097,14613552,5611701,6484778,5891882,23132752,8395009,22156516,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {21983,28268666,9568230,19429881,6008006,24008050,20887568,30451447,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {3238065,9482522,10764938,25814521,6563812,8831677,10735823,21915536,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {799412,3035304,15262733,26884054,1434085,10521995,16124208,28240181,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {3710111,16217715,18716479,21610969,21762189,23363300,22420670,24987885,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {172576,26167943,14646569,28316841,10493579,28798168,20021148,30720082,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {8420872,31076256,22609922,24941675,15649275,31768823,27195092,27455312,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {2635709,28723033,19580012,22376948,11090157,15926084,17679411,24519876,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {1753128,10357146,2144657,23878125,5910904,9054774,7382210,24872417,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {2453644,32518876,5369995,25186399,12698634,21512754,20357931,32882156,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {8829271,26693212,14001925,27298324,11910802,12882699,13181357,14940933,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {1679170,31059898,6265694,10641735,12015435,23038105,19962212,28620913,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {2643519,33504705,4356599,17500202,9172412,21700003,15721847,33350879,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {2807039,33438306,19754745,32233210,15667749,20376362,18620055,28064823,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {3281486,27251459,14067966,23523487,8259568,22590380,13893561,28476964,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {946954,5651933,12745771,23620660,1348853,30591707,18939991,26188704,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {1194714,20322323,21075964,26871057,2565364,4491315,8937294,22653696,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {637235,3860119,19707990,20376031,13004891,30800108,13847285,27717772,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {3234016,30828372,12722347,24300538,6920497,19090937,7198341,13648746,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {621868,31862815,4019117,8337759,19276345,22342537,30559974,30941776,}}, - {"0000000000000000000000000000000000000000000000000000000000000003", {1732075,20994666,6155543,25866809,3635886,22477080,5123596,13432247,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {2204518,20921515,12777053,25132755,5063934,14554392,10702268,29914364,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {6406067,20218961,20634617,28827338,11295835,16458724,18683265,31436074,}}, - {"0000000000000000000000000000000000000000000000000000000000000004", {7878007,21165294,8071789,31641431,8904023,17259094,10000563,31794352,}}, - {"0000000000000000000000000000000000000000000000000000000000000006", {5750028,25950324,14832510,30742754,19289275,33373074,19551765,30334371,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {785374,3657166,13462872,17039025,841360,21122444,3591794,8663192,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {6663135,16014329,8015567,27532870,8214530,20513665,14329688,20074961,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {10420672,15431588,30669813,32122115,16834934,23685740,17373413,31595830,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {1738923,3877533,5126100,15281834,6162636,24311468,15242152,24469387,}}, - {"0000000000000000000000000000000000000000000000000000000000000002", {3729011,33320159,26077521,26772495,12079870,20340043,18905055,20848710,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {1899782,12613196,7447739,12133044,6983605,21589090,28189402,28320756,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {3684861,24853041,27961196,32686824,6336696,29822601,7668660,16571990,}}, - {"0000000000000000000000000000000000000000000000000000000000000002", {4325123,10679550,7352744,15939111,20554616,27073737,26855425,31062910,}}, - {"0000000000000000000000000000000000000000000000000000000000000002", {6287964,21839182,8649920,14421276,10805018,12118354,12085375,17757398,}}, - {"0000000000000000000000000000000000000000000000000000000000000002", {9517507,20768654,17832112,32506789,16973867,29314279,19522774,31882006,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {4593507,11801862,22776242,27239522,5315575,32178272,19359679,29246067,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {70220,9824590,8585166,32653223,2471066,32929905,28303302,30995340,}}, - {"0000000000000000000000000000000000000000000000000000000000000002", {2112329,13887696,8915094,9388164,2979335,18058216,6638144,7655413,}}, - {"0000000000000000000000000000000000000000000000000000000000000002", {1598751,18664509,3464189,26549834,14569725,21446311,17294910,17945457,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {7407097,11289078,17774594,26390835,12546942,13428469,13407054,25035467,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {2381661,12510873,4702134,8667532,17569183,30421813,19155815,22067174,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {269914,9618692,314041,2748558,8267376,27166809,19380913,22511695,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {4539289,7888502,12855014,22139555,5618221,22440563,12938906,13283299,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {8734566,31269742,18087135,28734273,21477794,21932806,24439753,27006766,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {1188262,29875085,1555802,17924476,12140044,20111770,25232645,25355017,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {1832397,3831442,13088327,29103907,12436658,30784086,21692723,27401659,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {2199576,12822824,3157494,23072288,5198744,17718433,26926524,32792676,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {6419439,25870304,7393245,18802491,7791936,18552601,9473880,22310729,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {7013069,23660256,16998725,21932905,13990149,25724364,16911298,27581808,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {471581,12203475,2723947,7113047,15786079,24354137,19011625,22309954,}}, - {"0000000000000000000000000000000000000000000000000000000000000002", {8896196,16963078,19359299,32096019,8995579,32939764,9810638,25878351,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {1181248,19238611,3809164,29162138,7154558,12567104,13080848,19703519,}}, - {"0000000000000000000000000000000000000000000000000000000000000003", {3159364,30879003,25864645,28052580,7950194,24790693,16701888,16864466,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {1351562,12572515,1820009,2236616,10623632,13443650,12213300,29122917,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {6395614,31532576,7311043,10903613,15213720,21843676,24512158,30509942,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {6477837,27167216,10603653,31769971,9994098,10362636,13678858,20335701,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {10221363,31336574,14990834,18930315,11237243,19825663,19539543,32836293,}}, - {"0000000000000000000000000000000000000000000000000000000000000002", {4367295,26169439,17762319,25998417,9130819,26381016,17089620,33519140,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {4613517,6512918,24599762,26414995,12681444,18904943,17798602,31427364,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {3860451,17465681,12090048,25390051,9715631,26138619,15482251,25481590,}}, - {"0000000000000000000000000000000000000000000000000000000000000003", {784501,11148617,8619935,12096717,19509386,30494905,20301666,25869317,}}, - {"0000000000000000000000000000000000000000000000000000000000000004", {15985863,17262436,29269412,30002853,23454792,31616235,30450428,32986536,}}, - {"0000000000000000000000000000000000000000000000000000000000000004", {9262794,31375100,19724049,31709447,11614400,21767376,12567350,27208647,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {1930259,27620340,9374147,16209672,12127207,15790862,18749713,24745295,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {2037675,14809883,2478700,3880212,4322485,32315203,12270271,16346556,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {117986,8138393,9924260,20860963,4853158,13921015,10507877,17593395,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {11692683,14336396,22099757,23606002,23949189,25590567,24622458,29590174,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {3043651,6225687,17084299,32798569,3588547,5990245,19014563,24645345,}}, - {"0000000000000000000000000000000000000000000000000000000000000002", {568573,17369049,11024897,21817275,3636340,13669739,13852461,23632810,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {2363919,17767456,14656543,28392801,12503350,16087276,13869110,31665137,}}, - {"0000000000000000000000000000000000000000000000000000000000000002", {2199578,6335833,6936547,24494327,6477788,29903938,15516514,31970217,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {10830339,25496585,13882123,33083752,15548721,31652248,19757093,21446046,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {374835,17320644,27040413,32847830,7963957,12019127,12706216,22517651,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {2609477,6610225,19929451,26914203,13981212,26886006,16125588,25033208,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {9363335,29523412,28912941,29371268,16114010,28531419,20059905,28948000,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {3391197,19317083,15555354,32678769,5616378,18941218,14472636,15965627,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {3715073,28701443,13820848,27234602,4891795,9601840,23734794,25942841,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {3971271,14389739,12618800,28651336,13312973,15535545,24816839,29576036,}}, - {"0000000000000000000000000000000000000000000000000000000000000002", {2144617,32079731,14138184,14863508,5648295,15898822,13407115,26261273,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {8688716,28058207,9670766,27031282,10808709,20387419,23177453,30815061,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {2156330,19076434,5724654,8006651,2841915,3402602,21290399,26647339,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {40417,20280746,10776364,31468848,2879925,21985288,27692340,31524552,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {1177894,27738650,6675492,28604467,5392054,11226311,7955710,26013230,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {13757404,24612785,16592045,28164144,15847098,23783079,30472529,32186394,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {1564774,27323218,19106817,30336285,8770246,12085107,13421297,27684511,}}, + {"0000000000000000000000000000000000000000000000000000000000000003", {1214715,19792419,9555746,16848940,3912654,27149310,22248748,28349834,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {465380,21153671,6976118,9334318,11175832,26840118,20829091,24989124,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {7770071,28627113,10014117,19356236,9848234,9949205,16955539,17109877,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {10886035,16462121,11402801,18676699,18863182,22750783,27913287,29266804,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {1459257,20810647,19808682,20039494,5031430,8354170,19960466,32459829,}}, + {"0000000000000000000000000000000000000000000000000000000000000002", {178433,26826911,1771363,26729460,5642989,24206105,12393762,32840152,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {2983962,12671764,5207290,10330737,4588089,13866899,17946574,26945938,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {113569,14976652,20199317,20667441,6579132,22530896,14397318,23059086,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {1632382,17304127,15141824,16463064,7295399,16644827,18572067,20669996,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {4749456,26536198,20482514,27288026,5717270,9845012,13548614,28971963,}}, + {"0000000000000000000000000000000000000000000000000000000000000003", {2055837,16448853,17705896,25631610,7236935,15115012,17575734,29552166,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {877170,13910144,9449434,31536711,6943373,33381494,10663014,25302057,}}, + {"0000000000000000000000000000000000000000000000000000000000000002", {9784626,25888644,20907209,33051489,11883655,14965373,16474297,23765916,}}, + {"0000000000000000000000000000000000000000000000000000000000000002", {5738953,22771027,7773450,28347898,17307918,31820567,18592662,20555597,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {2820619,5939580,10962894,31649072,17310288,22866383,28287661,28558214,}}, + {"0000000000000000000000000000000000000000000000000000000000000002", {1099504,15420400,4135476,20459176,6270569,26126093,14610608,25097930,}}, + {"0000000000000000000000000000000000000000000000000000000000000006", {11005153,20120756,15438817,19194345,11890098,24911591,14550596,19598819,}}, + {"0000000000000000000000000000000000000000000000000000000000000002", {811437,13416821,3695389,4980869,3304015,11488217,25631114,28719138,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {3159269,16968786,24550538,29557236,7803747,17822649,8653377,28912768,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {504712,18932458,23483962,32887330,1961796,3859308,4143374,21979566,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {1297991,25566210,1398484,9944035,2097862,5362235,10031470,28382554,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {102676,32911897,7721281,31740499,10620001,23816423,16491577,25954318,}}, + {"0000000000000000000000000000000000000000000000000000000000000003", {212571,4679973,23085832,31700385,290181,3123715,2520892,9829998,}}, + {"0000000000000000000000000000000000000000000000000000000000000004", {1960800,33289718,10543297,28317859,10240961,23992025,13883111,29268877,}}, + {"0000000000000000000000000000000000000000000000000000000000000003", {1295735,3541429,19196941,26229671,2075807,7744035,13892791,16359393,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {83756,13963510,24364674,28161836,3559525,6157435,5068480,30119769,}}, + {"0000000000000000000000000000000000000000000000000000000000000003", {1598060,14996774,17503918,32025260,4028700,4185348,9943169,19766624,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {2036259,12977312,18211980,25676830,9854809,23688296,20492062,29424122,}}, + {"0000000000000000000000000000000000000000000000000000000000000003", {928558,10520944,7857560,29946487,7820310,28906271,23449676,30806524,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {94218,13807430,13196201,14249183,19791079,23217539,20038334,31034870,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {1758244,27525162,10779849,22581442,8027113,15876676,17454231,21792768,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {6569294,8336577,15646092,30968838,20697786,22064795,20785097,30483610,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {4689186,22004168,22418974,29001467,5786496,9907973,8587341,33248381,}}, + {"0000000000000000000000000000000000000000000000000000000000000003", {339519,28863919,3272519,4244748,20886307,33137120,28756344,32931237,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {2007251,9819636,2382668,14448240,9055007,23797812,16776484,30849221,}}, + {"0000000000000000000000000000000000000000000000000000000000000002", {100639,15413331,5451445,31189400,5954930,14153867,20329951,32020557,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {3628427,6969355,11360897,31781667,18525364,22618303,22981181,31888430,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {7110249,21386177,8382166,21176232,16536185,31399855,17464767,19530536,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {2277574,30780181,16112914,17000014,8773633,33091585,14048873,20149459,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {2550665,14213654,4242870,4903655,12958653,26655325,16169076,21002376,}}, + {"0000000000000000000000000000000000000000000000000000000000000002", {8599195,17050362,14378242,32227198,27632983,28111101,30005170,30066859,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {7392426,31454969,17393740,27621919,14492199,15806556,30071524,31923579,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {3441267,24920721,14858570,25338679,26756803,28296345,27899023,29642105,}}, + {"0000000000000000000000000000000000000000000000000000000000000004", {6132931,17329281,7403622,11516026,17955185,33453794,29812795,29957180,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {1817438,12293835,9508966,28929257,4881606,27883893,10672774,13799976,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {1592008,26013415,3056820,12115596,5721438,22851473,8306360,23832416,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {1658911,2372970,2049420,26063504,7254450,17497653,10989879,20867973,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {3844166,11413008,7536711,26263212,3913457,22440558,4734959,25245717,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {3846824,18789393,8479261,23359846,7357578,15815377,27655724,30991674,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {1122706,12234238,1437114,21745512,3042285,7829266,9640973,32099155,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {1657055,1741471,6612631,17394399,1771475,2649394,2482138,26380069,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {1321865,26432770,1978944,29079168,10432765,16839727,15225774,31509058,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {2389998,2427492,16530305,32805965,8721899,21857166,21131122,30763466,}}, + {"0000000000000000000000000000000000000000000000000000000000000002", {5142519,31007337,19221500,21637824,10174290,21723998,33158246,33446815,}}, + {"0000000000000000000000000000000000000000000000000000000000000002", {654077,14175251,14384173,31117918,18777910,19829161,20073018,31076902,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {490172,27119077,9416149,27036452,9202405,32397812,14789585,30586120,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {1426168,8551526,27117488,28956737,7182468,19534844,22573428,24148541,}}, + {"0000000000000000000000000000000000000000000000000000000000000003", {3568239,7479271,26848916,28028164,10316849,13221502,13076005,25136771,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {2259593,20403947,8752132,24787922,2498248,28355872,12369155,32419366,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {501613,33095679,8486139,12192635,12664951,25303125,26438872,28500516,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {2374990,29703045,16601100,22135948,2808865,10410817,4873403,11423815,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {3820273,11176433,18037071,28084364,9137913,16151134,12587475,25680991,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {3108998,4479515,7553371,16546950,8436773,14725341,12707928,17008882,}}, + {"0000000000000000000000000000000000000000000000000000000000000003", {6578517,8614911,18615575,33486778,8226936,31136878,10769236,15300924,}}, + {"0000000000000000000000000000000000000000000000000000000000000002", {6129524,27095542,26824782,27959481,11065482,26547800,29288038,32005262,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {8474,30237217,9482038,29054803,4781077,10950607,6745549,32886977,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {1211506,19019150,8708723,13874779,6950181,11142331,19174286,20076915,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {1688667,24236288,9285246,12989008,14301446,30852413,23907591,25087224,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {8870159,23093851,15080659,28957365,13034803,21764451,25571497,32229377,}}, + {"0000000000000000000000000000000000000000000000000000000000000003", {1533183,5661840,26047327,33275547,9546764,10489532,16575096,20438816,}}, + {"0000000000000000000000000000000000000000000000000000000000000002", {155170,11688838,8463756,8762265,861970,2097310,1687008,8229727,}}, + {"0000000000000000000000000000000000000000000000000000000000000003", {4363095,28366890,14920354,22598934,12250321,29200126,12268459,13241216,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {3232004,25476628,8264172,32689379,11710053,22028333,13203433,32903338,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {310014,25211270,9028052,31811694,4976848,26452941,11047133,19665723,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {576900,2104019,6469363,6683826,3080847,5111320,28147384,28650213,}}, + {"0000000000000000000000000000000000000000000000000000000000000005", {1532187,21848241,7123572,12545782,3881386,7978429,5434081,28331220,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {388562,4005372,7234172,29049575,7223667,14805722,10878566,33393207,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {5850262,32677763,15556500,16735812,11341911,17951156,13922062,14410547,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {2424054,11014354,9779764,21557113,3111131,8166331,4859205,14574649,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {801937,12980814,16785187,26496355,3080644,32489047,6453334,16622214,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {202609,8154906,11662127,27093535,2030772,14156122,28634426,31111028,}}, + {"0000000000000000000000000000000000000000000000000000000000000006", {325499,8756842,4808323,32441916,15410067,31808785,25390711,32205778,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {1166390,21819687,19693253,33102452,7921702,13369411,22436213,30088108,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {777300,27199773,12777655,30048491,9643279,32805170,22663801,23464043,}}, + {"0000000000000000000000000000000000000000000000000000000000000002", {1008164,33481804,5980171,8538640,7610328,18980163,20521032,33254832,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {881598,14389174,6105333,7062127,5566689,18077097,7461556,11154426,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {1339637,23466773,2803293,20456584,6947870,28635426,9834951,33068674,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {1723002,2963927,10155602,32745822,6241452,20915262,16337613,24849765,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {2161203,4371222,19041750,20784444,3720141,25974149,19064987,23359092,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {2876839,25605592,22613353,32322921,7640014,8241405,14912558,16715717,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {2483067,5388280,12085418,16625867,6364517,16365140,21978108,28922151,}}, + {"0000000000000000000000000000000000000000000000000000000000000002", {1219910,13649699,15817745,21343281,17410892,17554172,18698843,22991164,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {1240982,13018635,12806785,16813220,1848080,12964338,5040783,19040748,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {6012000,25212426,13475157,17396160,7563959,27657052,17189044,30836716,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {7856443,31534474,13787279,29019766,12879952,28711973,14288089,27358381,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {424699,25193206,11746962,14461021,623744,20147894,8098101,24213779,}}, + {"0000000000000000000000000000000000000000000000000000000000000002", {4441173,26265491,8225467,8917949,5364511,15543455,22937473,32124778,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {1200582,16316000,4043019,18041061,19343454,25757784,26565048,33237015,}}, + {"0000000000000000000000000000000000000000000000000000000000000002", {757446,15752870,10558842,29838164,11505137,28967804,14190960,26120932,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {4607691,18648889,8504702,15574030,6974736,33492450,24791405,32775597,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {99730,18423493,4667626,29947237,9820438,30506336,20122752,29685762,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {1075001,26105351,1967981,6264350,20852748,29843814,28119876,29893576,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {1591400,9613349,27352831,31596759,15855520,31366449,24703378,31819045,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {1807796,26897061,2327536,9518175,12634385,28816117,16732365,31443476,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {11514565,33453820,26026963,29208850,12383145,31894222,20059767,27374118,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {14176825,16056472,30276898,32522827,15873156,24924038,20529628,31256168,}}, }; // NOTE: These tests rely on CreateNewBlock doing its own self-validation! From 07e6d5b02533d829e6333ac4cbac671dff3104b9 Mon Sep 17 00:00:00 2001 From: Simon Date: Tue, 26 Jul 2016 17:06:55 -0700 Subject: [PATCH 09/16] Refactor GetTxid() into UpdateTxid() to match coding style of hash member variable. UpdateTxid() is called alongside UpdateHash() when a CTransaction is deserialized or constructed. GetTxid() now returns a const reference. --- src/primitives/transaction.cpp | 7 ++++--- src/primitives/transaction.h | 13 +++++++++---- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/primitives/transaction.cpp b/src/primitives/transaction.cpp index 393215207..114aaf372 100644 --- a/src/primitives/transaction.cpp +++ b/src/primitives/transaction.cpp @@ -132,6 +132,7 @@ CTransaction::CTransaction(const CMutableTransaction &tx) : nVersion(tx.nVersion joinSplitPubKey(tx.joinSplitPubKey), joinSplitSig(tx.joinSplitSig) { UpdateHash(); + UpdateTxid(); } CTransaction& CTransaction::operator=(const CTransaction &tx) { @@ -143,6 +144,7 @@ CTransaction& CTransaction::operator=(const CTransaction &tx) { *const_cast(&joinSplitPubKey) = tx.joinSplitPubKey; *const_cast(&joinSplitSig) = tx.joinSplitSig; *const_cast(&hash) = tx.hash; + *const_cast(&txid) = tx.txid; return *this; } @@ -227,7 +229,7 @@ std::string CTransaction::ToString() const // Return a txid which is non-malleable. // Signature data is cleared before the transaction is serialized and hashed. -uint256 CTransaction::GetTxid() const +void CTransaction::UpdateTxid() const { // Create a deep copy of this transaction CMutableTransaction tx(*this); @@ -241,10 +243,9 @@ uint256 CTransaction::GetTxid() const tx.joinSplitSig.assign(0); // Return double SHA256 hash - return tx.GetSerializeHash(); + *const_cast(&txid) = tx.GetSerializeHash(); } - // Return a txid which is non-malleable. uint256 CMutableTransaction::GetTxid() const { diff --git a/src/primitives/transaction.h b/src/primitives/transaction.h index ed11e5c30..ab3f60883 100644 --- a/src/primitives/transaction.h +++ b/src/primitives/transaction.h @@ -288,6 +288,8 @@ private: /** Memory only. */ const uint256 hash; void UpdateHash() const; + uint256 txid; + void UpdateTxid() const; public: typedef boost::array joinsplit_sig_t; @@ -331,8 +333,10 @@ public: READWRITE(*const_cast(&joinSplitSig)); } } - if (ser_action.ForRead()) + if (ser_action.ForRead()) { UpdateHash(); + UpdateTxid(); + } } bool IsNull() const { @@ -374,9 +378,10 @@ public: std::string ToString() const; - // Return the txid which is the double SHA256 hash of the transaction. - uint256 GetTxid() const; - + // Return the txid, which is the double SHA256 hash over portions of the transaction. + const uint256& GetTxid() const { + return txid; + } }; /** A mutable version of CTransaction. */ From 2481bab2b87a3ff885d67c1f23ba074265ee69d7 Mon Sep 17 00:00:00 2001 From: Simon Date: Wed, 27 Jul 2016 00:41:26 -0700 Subject: [PATCH 10/16] Revert "Set nLockTime in CreateNewBlock() so coinbase txs do not have the same txid." This reverts commit 29306269f4c4a09201087025407b7d914912baad. --- src/miner.cpp | 5 - src/test/miner_tests.cpp | 218 +++++++++++++++++++-------------------- 2 files changed, 109 insertions(+), 114 deletions(-) diff --git a/src/miner.cpp b/src/miner.cpp index fd5032252..73a6c9bf7 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -335,11 +335,6 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn) txNew.vout[0].scriptPubKey = scriptPubKeyIn; txNew.vout[0].nValue = GetBlockSubsidy(nHeight, chainparams.GetConsensus()); - // If nLockTime is 0, coinbase txs with the same inputs and outputs may have the same non-malleable txid. - // So we set nLockTime to the previous block height to ensure this coinbase tx will be accepted into - // the next block. This replicates the behaviour of having nLockTime of 0. - txNew.nLockTime = pindexPrev->nHeight; - if ((nHeight > 0) && (nHeight < chainparams.GetConsensus().nSubsidyHalvingInterval)) { // Founders reward is 20% of the block subsidy auto vFoundersReward = txNew.vout[0].nValue / 5; diff --git a/src/test/miner_tests.cpp b/src/test/miner_tests.cpp index 2f3557ee5..a6df44652 100644 --- a/src/test/miner_tests.cpp +++ b/src/test/miner_tests.cpp @@ -25,115 +25,115 @@ struct { uint32_t vSolutions[NUM_EQUIHASH_SOLUTIONS]; } blockinfo[] = { {"0000000000000000000000000000000000000000000000000000000000000000", {1113402,26940724,29426619,29650324,1651155,28182833,2919013,20269474,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {1177894,27738650,6675492,28604467,5392054,11226311,7955710,26013230,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {13757404,24612785,16592045,28164144,15847098,23783079,30472529,32186394,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {1564774,27323218,19106817,30336285,8770246,12085107,13421297,27684511,}}, - {"0000000000000000000000000000000000000000000000000000000000000003", {1214715,19792419,9555746,16848940,3912654,27149310,22248748,28349834,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {465380,21153671,6976118,9334318,11175832,26840118,20829091,24989124,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {7770071,28627113,10014117,19356236,9848234,9949205,16955539,17109877,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {10886035,16462121,11402801,18676699,18863182,22750783,27913287,29266804,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {1459257,20810647,19808682,20039494,5031430,8354170,19960466,32459829,}}, - {"0000000000000000000000000000000000000000000000000000000000000002", {178433,26826911,1771363,26729460,5642989,24206105,12393762,32840152,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {2983962,12671764,5207290,10330737,4588089,13866899,17946574,26945938,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {113569,14976652,20199317,20667441,6579132,22530896,14397318,23059086,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {1632382,17304127,15141824,16463064,7295399,16644827,18572067,20669996,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {4749456,26536198,20482514,27288026,5717270,9845012,13548614,28971963,}}, - {"0000000000000000000000000000000000000000000000000000000000000003", {2055837,16448853,17705896,25631610,7236935,15115012,17575734,29552166,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {877170,13910144,9449434,31536711,6943373,33381494,10663014,25302057,}}, - {"0000000000000000000000000000000000000000000000000000000000000002", {9784626,25888644,20907209,33051489,11883655,14965373,16474297,23765916,}}, - {"0000000000000000000000000000000000000000000000000000000000000002", {5738953,22771027,7773450,28347898,17307918,31820567,18592662,20555597,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {2820619,5939580,10962894,31649072,17310288,22866383,28287661,28558214,}}, - {"0000000000000000000000000000000000000000000000000000000000000002", {1099504,15420400,4135476,20459176,6270569,26126093,14610608,25097930,}}, - {"0000000000000000000000000000000000000000000000000000000000000006", {11005153,20120756,15438817,19194345,11890098,24911591,14550596,19598819,}}, - {"0000000000000000000000000000000000000000000000000000000000000002", {811437,13416821,3695389,4980869,3304015,11488217,25631114,28719138,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {3159269,16968786,24550538,29557236,7803747,17822649,8653377,28912768,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {504712,18932458,23483962,32887330,1961796,3859308,4143374,21979566,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {1297991,25566210,1398484,9944035,2097862,5362235,10031470,28382554,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {102676,32911897,7721281,31740499,10620001,23816423,16491577,25954318,}}, - {"0000000000000000000000000000000000000000000000000000000000000003", {212571,4679973,23085832,31700385,290181,3123715,2520892,9829998,}}, - {"0000000000000000000000000000000000000000000000000000000000000004", {1960800,33289718,10543297,28317859,10240961,23992025,13883111,29268877,}}, - {"0000000000000000000000000000000000000000000000000000000000000003", {1295735,3541429,19196941,26229671,2075807,7744035,13892791,16359393,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {83756,13963510,24364674,28161836,3559525,6157435,5068480,30119769,}}, - {"0000000000000000000000000000000000000000000000000000000000000003", {1598060,14996774,17503918,32025260,4028700,4185348,9943169,19766624,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {2036259,12977312,18211980,25676830,9854809,23688296,20492062,29424122,}}, - {"0000000000000000000000000000000000000000000000000000000000000003", {928558,10520944,7857560,29946487,7820310,28906271,23449676,30806524,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {94218,13807430,13196201,14249183,19791079,23217539,20038334,31034870,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {1758244,27525162,10779849,22581442,8027113,15876676,17454231,21792768,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {6569294,8336577,15646092,30968838,20697786,22064795,20785097,30483610,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {4689186,22004168,22418974,29001467,5786496,9907973,8587341,33248381,}}, - {"0000000000000000000000000000000000000000000000000000000000000003", {339519,28863919,3272519,4244748,20886307,33137120,28756344,32931237,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {2007251,9819636,2382668,14448240,9055007,23797812,16776484,30849221,}}, - {"0000000000000000000000000000000000000000000000000000000000000002", {100639,15413331,5451445,31189400,5954930,14153867,20329951,32020557,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {3628427,6969355,11360897,31781667,18525364,22618303,22981181,31888430,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {7110249,21386177,8382166,21176232,16536185,31399855,17464767,19530536,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {2277574,30780181,16112914,17000014,8773633,33091585,14048873,20149459,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {2550665,14213654,4242870,4903655,12958653,26655325,16169076,21002376,}}, - {"0000000000000000000000000000000000000000000000000000000000000002", {8599195,17050362,14378242,32227198,27632983,28111101,30005170,30066859,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {7392426,31454969,17393740,27621919,14492199,15806556,30071524,31923579,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {3441267,24920721,14858570,25338679,26756803,28296345,27899023,29642105,}}, - {"0000000000000000000000000000000000000000000000000000000000000004", {6132931,17329281,7403622,11516026,17955185,33453794,29812795,29957180,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {1817438,12293835,9508966,28929257,4881606,27883893,10672774,13799976,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {1592008,26013415,3056820,12115596,5721438,22851473,8306360,23832416,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {1658911,2372970,2049420,26063504,7254450,17497653,10989879,20867973,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {3844166,11413008,7536711,26263212,3913457,22440558,4734959,25245717,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {3846824,18789393,8479261,23359846,7357578,15815377,27655724,30991674,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {1122706,12234238,1437114,21745512,3042285,7829266,9640973,32099155,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {1657055,1741471,6612631,17394399,1771475,2649394,2482138,26380069,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {1321865,26432770,1978944,29079168,10432765,16839727,15225774,31509058,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {2389998,2427492,16530305,32805965,8721899,21857166,21131122,30763466,}}, - {"0000000000000000000000000000000000000000000000000000000000000002", {5142519,31007337,19221500,21637824,10174290,21723998,33158246,33446815,}}, - {"0000000000000000000000000000000000000000000000000000000000000002", {654077,14175251,14384173,31117918,18777910,19829161,20073018,31076902,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {490172,27119077,9416149,27036452,9202405,32397812,14789585,30586120,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {1426168,8551526,27117488,28956737,7182468,19534844,22573428,24148541,}}, - {"0000000000000000000000000000000000000000000000000000000000000003", {3568239,7479271,26848916,28028164,10316849,13221502,13076005,25136771,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {2259593,20403947,8752132,24787922,2498248,28355872,12369155,32419366,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {501613,33095679,8486139,12192635,12664951,25303125,26438872,28500516,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {2374990,29703045,16601100,22135948,2808865,10410817,4873403,11423815,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {3820273,11176433,18037071,28084364,9137913,16151134,12587475,25680991,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {3108998,4479515,7553371,16546950,8436773,14725341,12707928,17008882,}}, - {"0000000000000000000000000000000000000000000000000000000000000003", {6578517,8614911,18615575,33486778,8226936,31136878,10769236,15300924,}}, - {"0000000000000000000000000000000000000000000000000000000000000002", {6129524,27095542,26824782,27959481,11065482,26547800,29288038,32005262,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {8474,30237217,9482038,29054803,4781077,10950607,6745549,32886977,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {1211506,19019150,8708723,13874779,6950181,11142331,19174286,20076915,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {1688667,24236288,9285246,12989008,14301446,30852413,23907591,25087224,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {8870159,23093851,15080659,28957365,13034803,21764451,25571497,32229377,}}, - {"0000000000000000000000000000000000000000000000000000000000000003", {1533183,5661840,26047327,33275547,9546764,10489532,16575096,20438816,}}, - {"0000000000000000000000000000000000000000000000000000000000000002", {155170,11688838,8463756,8762265,861970,2097310,1687008,8229727,}}, - {"0000000000000000000000000000000000000000000000000000000000000003", {4363095,28366890,14920354,22598934,12250321,29200126,12268459,13241216,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {3232004,25476628,8264172,32689379,11710053,22028333,13203433,32903338,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {310014,25211270,9028052,31811694,4976848,26452941,11047133,19665723,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {576900,2104019,6469363,6683826,3080847,5111320,28147384,28650213,}}, - {"0000000000000000000000000000000000000000000000000000000000000005", {1532187,21848241,7123572,12545782,3881386,7978429,5434081,28331220,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {388562,4005372,7234172,29049575,7223667,14805722,10878566,33393207,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {5850262,32677763,15556500,16735812,11341911,17951156,13922062,14410547,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {2424054,11014354,9779764,21557113,3111131,8166331,4859205,14574649,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {801937,12980814,16785187,26496355,3080644,32489047,6453334,16622214,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {202609,8154906,11662127,27093535,2030772,14156122,28634426,31111028,}}, - {"0000000000000000000000000000000000000000000000000000000000000006", {325499,8756842,4808323,32441916,15410067,31808785,25390711,32205778,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {1166390,21819687,19693253,33102452,7921702,13369411,22436213,30088108,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {777300,27199773,12777655,30048491,9643279,32805170,22663801,23464043,}}, - {"0000000000000000000000000000000000000000000000000000000000000002", {1008164,33481804,5980171,8538640,7610328,18980163,20521032,33254832,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {881598,14389174,6105333,7062127,5566689,18077097,7461556,11154426,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {1339637,23466773,2803293,20456584,6947870,28635426,9834951,33068674,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {1723002,2963927,10155602,32745822,6241452,20915262,16337613,24849765,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {2161203,4371222,19041750,20784444,3720141,25974149,19064987,23359092,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {2876839,25605592,22613353,32322921,7640014,8241405,14912558,16715717,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {2483067,5388280,12085418,16625867,6364517,16365140,21978108,28922151,}}, - {"0000000000000000000000000000000000000000000000000000000000000002", {1219910,13649699,15817745,21343281,17410892,17554172,18698843,22991164,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {1240982,13018635,12806785,16813220,1848080,12964338,5040783,19040748,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {6012000,25212426,13475157,17396160,7563959,27657052,17189044,30836716,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {7856443,31534474,13787279,29019766,12879952,28711973,14288089,27358381,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {424699,25193206,11746962,14461021,623744,20147894,8098101,24213779,}}, - {"0000000000000000000000000000000000000000000000000000000000000002", {4441173,26265491,8225467,8917949,5364511,15543455,22937473,32124778,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {1200582,16316000,4043019,18041061,19343454,25757784,26565048,33237015,}}, - {"0000000000000000000000000000000000000000000000000000000000000002", {757446,15752870,10558842,29838164,11505137,28967804,14190960,26120932,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {4607691,18648889,8504702,15574030,6974736,33492450,24791405,32775597,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {99730,18423493,4667626,29947237,9820438,30506336,20122752,29685762,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {1075001,26105351,1967981,6264350,20852748,29843814,28119876,29893576,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {1591400,9613349,27352831,31596759,15855520,31366449,24703378,31819045,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {1807796,26897061,2327536,9518175,12634385,28816117,16732365,31443476,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {11514565,33453820,26026963,29208850,12383145,31894222,20059767,27374118,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {14176825,16056472,30276898,32522827,15873156,24924038,20529628,31256168,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {2541603,14114747,21660764,25879244,5433179,8124465,25666254,26548855,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {11929257,25158964,16095230,24841514,12867411,15686246,25441631,29728310,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {5105680,21328455,16152510,29495600,12443572,24958281,15815721,19841625,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {35834,7761680,14791216,18834970,10322825,29492625,10893714,26525542,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {1102283,26829250,13659455,22864463,3780400,22478846,21827356,30064470,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {2037605,12627800,15388193,32785696,20790459,24445774,23758535,27841410,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {3701973,27733118,20055632,32981287,11852035,23473816,12069611,24241138,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {1239069,7235416,16525930,24221834,17217527,18522923,28626536,33160290,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {257184,24892410,5577177,28973426,3838592,21876018,10548097,32849787,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {594750,25868567,15236813,21639078,695051,6577690,7049607,26122407,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {2953230,27002289,15387579,25612682,19679247,22183247,27483477,29772736,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {14264159,31139880,19405862,22349908,20538800,32612497,22946641,29253443,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {43271,13347426,4967623,27686294,2049029,10643471,26256712,27072023,}}, + {"0000000000000000000000000000000000000000000000000000000000000002", {4264458,5957348,10688362,25520226,5289719,25026457,7796449,22800689,}}, + {"0000000000000000000000000000000000000000000000000000000000000002", {826381,32629643,2098678,20063524,2756556,20471197,7523623,30720049,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {4448010,24132030,18245842,18676702,5480533,22770981,6876675,13164821,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {3619321,9958701,24513456,30709357,6570637,29783605,12349463,19460957,}}, + {"0000000000000000000000000000000000000000000000000000000000000003", {3338352,22879126,22388799,28738999,6338378,26770353,11615580,32570967,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {583162,28968143,8506860,10059788,1382777,17695787,7898822,28735790,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {689723,33265955,4951038,26417615,2878474,15296534,17067304,23912090,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {13387048,24067520,19933907,26756676,25442786,31637164,25467610,28623833,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {1082504,8652408,9758889,10565277,2825000,24483755,8669404,26856495,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {832465,1290760,8314106,21253530,7392507,18386499,17437969,17897762,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {402809,14238247,8846864,15628890,1394254,25476988,9768531,20445018,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {4724342,31383028,17023768,33283980,5666748,16675392,21273019,24165352,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {3671473,32986995,19868903,33549652,7343386,19607857,11053667,30367575,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {3776234,23322341,13313550,32344754,10577747,13162296,26428875,26771723,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {243097,14613552,5611701,6484778,5891882,23132752,8395009,22156516,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {21983,28268666,9568230,19429881,6008006,24008050,20887568,30451447,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {3238065,9482522,10764938,25814521,6563812,8831677,10735823,21915536,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {799412,3035304,15262733,26884054,1434085,10521995,16124208,28240181,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {3710111,16217715,18716479,21610969,21762189,23363300,22420670,24987885,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {172576,26167943,14646569,28316841,10493579,28798168,20021148,30720082,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {8420872,31076256,22609922,24941675,15649275,31768823,27195092,27455312,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {2635709,28723033,19580012,22376948,11090157,15926084,17679411,24519876,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {1753128,10357146,2144657,23878125,5910904,9054774,7382210,24872417,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {2453644,32518876,5369995,25186399,12698634,21512754,20357931,32882156,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {8829271,26693212,14001925,27298324,11910802,12882699,13181357,14940933,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {1679170,31059898,6265694,10641735,12015435,23038105,19962212,28620913,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {2643519,33504705,4356599,17500202,9172412,21700003,15721847,33350879,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {2807039,33438306,19754745,32233210,15667749,20376362,18620055,28064823,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {3281486,27251459,14067966,23523487,8259568,22590380,13893561,28476964,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {946954,5651933,12745771,23620660,1348853,30591707,18939991,26188704,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {1194714,20322323,21075964,26871057,2565364,4491315,8937294,22653696,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {637235,3860119,19707990,20376031,13004891,30800108,13847285,27717772,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {3234016,30828372,12722347,24300538,6920497,19090937,7198341,13648746,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {621868,31862815,4019117,8337759,19276345,22342537,30559974,30941776,}}, + {"0000000000000000000000000000000000000000000000000000000000000003", {1732075,20994666,6155543,25866809,3635886,22477080,5123596,13432247,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {2204518,20921515,12777053,25132755,5063934,14554392,10702268,29914364,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {6406067,20218961,20634617,28827338,11295835,16458724,18683265,31436074,}}, + {"0000000000000000000000000000000000000000000000000000000000000004", {7878007,21165294,8071789,31641431,8904023,17259094,10000563,31794352,}}, + {"0000000000000000000000000000000000000000000000000000000000000006", {5750028,25950324,14832510,30742754,19289275,33373074,19551765,30334371,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {785374,3657166,13462872,17039025,841360,21122444,3591794,8663192,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {6663135,16014329,8015567,27532870,8214530,20513665,14329688,20074961,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {10420672,15431588,30669813,32122115,16834934,23685740,17373413,31595830,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {1738923,3877533,5126100,15281834,6162636,24311468,15242152,24469387,}}, + {"0000000000000000000000000000000000000000000000000000000000000002", {3729011,33320159,26077521,26772495,12079870,20340043,18905055,20848710,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {1899782,12613196,7447739,12133044,6983605,21589090,28189402,28320756,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {3684861,24853041,27961196,32686824,6336696,29822601,7668660,16571990,}}, + {"0000000000000000000000000000000000000000000000000000000000000002", {4325123,10679550,7352744,15939111,20554616,27073737,26855425,31062910,}}, + {"0000000000000000000000000000000000000000000000000000000000000002", {6287964,21839182,8649920,14421276,10805018,12118354,12085375,17757398,}}, + {"0000000000000000000000000000000000000000000000000000000000000002", {9517507,20768654,17832112,32506789,16973867,29314279,19522774,31882006,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {4593507,11801862,22776242,27239522,5315575,32178272,19359679,29246067,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {70220,9824590,8585166,32653223,2471066,32929905,28303302,30995340,}}, + {"0000000000000000000000000000000000000000000000000000000000000002", {2112329,13887696,8915094,9388164,2979335,18058216,6638144,7655413,}}, + {"0000000000000000000000000000000000000000000000000000000000000002", {1598751,18664509,3464189,26549834,14569725,21446311,17294910,17945457,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {7407097,11289078,17774594,26390835,12546942,13428469,13407054,25035467,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {2381661,12510873,4702134,8667532,17569183,30421813,19155815,22067174,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {269914,9618692,314041,2748558,8267376,27166809,19380913,22511695,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {4539289,7888502,12855014,22139555,5618221,22440563,12938906,13283299,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {8734566,31269742,18087135,28734273,21477794,21932806,24439753,27006766,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {1188262,29875085,1555802,17924476,12140044,20111770,25232645,25355017,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {1832397,3831442,13088327,29103907,12436658,30784086,21692723,27401659,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {2199576,12822824,3157494,23072288,5198744,17718433,26926524,32792676,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {6419439,25870304,7393245,18802491,7791936,18552601,9473880,22310729,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {7013069,23660256,16998725,21932905,13990149,25724364,16911298,27581808,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {471581,12203475,2723947,7113047,15786079,24354137,19011625,22309954,}}, + {"0000000000000000000000000000000000000000000000000000000000000002", {8896196,16963078,19359299,32096019,8995579,32939764,9810638,25878351,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {1181248,19238611,3809164,29162138,7154558,12567104,13080848,19703519,}}, + {"0000000000000000000000000000000000000000000000000000000000000003", {3159364,30879003,25864645,28052580,7950194,24790693,16701888,16864466,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {1351562,12572515,1820009,2236616,10623632,13443650,12213300,29122917,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {6395614,31532576,7311043,10903613,15213720,21843676,24512158,30509942,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {6477837,27167216,10603653,31769971,9994098,10362636,13678858,20335701,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {10221363,31336574,14990834,18930315,11237243,19825663,19539543,32836293,}}, + {"0000000000000000000000000000000000000000000000000000000000000002", {4367295,26169439,17762319,25998417,9130819,26381016,17089620,33519140,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {4613517,6512918,24599762,26414995,12681444,18904943,17798602,31427364,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {3860451,17465681,12090048,25390051,9715631,26138619,15482251,25481590,}}, + {"0000000000000000000000000000000000000000000000000000000000000003", {784501,11148617,8619935,12096717,19509386,30494905,20301666,25869317,}}, + {"0000000000000000000000000000000000000000000000000000000000000004", {15985863,17262436,29269412,30002853,23454792,31616235,30450428,32986536,}}, + {"0000000000000000000000000000000000000000000000000000000000000004", {9262794,31375100,19724049,31709447,11614400,21767376,12567350,27208647,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {1930259,27620340,9374147,16209672,12127207,15790862,18749713,24745295,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {2037675,14809883,2478700,3880212,4322485,32315203,12270271,16346556,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {117986,8138393,9924260,20860963,4853158,13921015,10507877,17593395,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {11692683,14336396,22099757,23606002,23949189,25590567,24622458,29590174,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {3043651,6225687,17084299,32798569,3588547,5990245,19014563,24645345,}}, + {"0000000000000000000000000000000000000000000000000000000000000002", {568573,17369049,11024897,21817275,3636340,13669739,13852461,23632810,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {2363919,17767456,14656543,28392801,12503350,16087276,13869110,31665137,}}, + {"0000000000000000000000000000000000000000000000000000000000000002", {2199578,6335833,6936547,24494327,6477788,29903938,15516514,31970217,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {10830339,25496585,13882123,33083752,15548721,31652248,19757093,21446046,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {374835,17320644,27040413,32847830,7963957,12019127,12706216,22517651,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {2609477,6610225,19929451,26914203,13981212,26886006,16125588,25033208,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {9363335,29523412,28912941,29371268,16114010,28531419,20059905,28948000,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {3391197,19317083,15555354,32678769,5616378,18941218,14472636,15965627,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {3715073,28701443,13820848,27234602,4891795,9601840,23734794,25942841,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {3971271,14389739,12618800,28651336,13312973,15535545,24816839,29576036,}}, + {"0000000000000000000000000000000000000000000000000000000000000002", {2144617,32079731,14138184,14863508,5648295,15898822,13407115,26261273,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {8688716,28058207,9670766,27031282,10808709,20387419,23177453,30815061,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {2156330,19076434,5724654,8006651,2841915,3402602,21290399,26647339,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {40417,20280746,10776364,31468848,2879925,21985288,27692340,31524552,}}, }; // NOTE: These tests rely on CreateNewBlock doing its own self-validation! From 90a9019387450e4e22285daff3b4f2ccdb42c598 Mon Sep 17 00:00:00 2001 From: Simon Date: Wed, 27 Jul 2016 00:52:27 -0700 Subject: [PATCH 11/16] Fix issue where a coinbase tx should have it's sigscript hashed to avoid duplicate txids, as discussed in BIP34 and BIP30. --- src/primitives/transaction.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/primitives/transaction.cpp b/src/primitives/transaction.cpp index 114aaf372..5d157a5c3 100644 --- a/src/primitives/transaction.cpp +++ b/src/primitives/transaction.cpp @@ -234,13 +234,16 @@ void CTransaction::UpdateTxid() const // Create a deep copy of this transaction CMutableTransaction tx(*this); - // Clear sigscript from all transaction inputs. - for (CTxIn & txIn : tx.vin) { - txIn.scriptSig.clear(); - } + // We keep the sigscript for coinbase txs to avoid duplicate txids (BIP34 and BIP30) + if (!IsCoinBase()) { + // Clear sigscript from all transaction inputs. + for (CTxIn & txIn : tx.vin) { + txIn.scriptSig.clear(); + } - // Clear joinSplitSig by filling the buffer with zero - tx.joinSplitSig.assign(0); + // Clear joinSplitSig by filling the buffer with zero + tx.joinSplitSig.assign(0); + } // Return double SHA256 hash *const_cast(&txid) = tx.GetSerializeHash(); From 0ccb650b5abe87ddb3ef570d4a321a840ee24a59 Mon Sep 17 00:00:00 2001 From: Simon Date: Wed, 27 Jul 2016 00:55:48 -0700 Subject: [PATCH 12/16] Update genesis block hashes and test data. --- src/chainparams.cpp | 18 +-- src/test/bloom_tests.cpp | 140 +++++++++---------- src/test/data/script_invalid.json | 81 +++++------ src/test/data/script_valid.json | 63 ++++----- src/test/miner_tests.cpp | 220 +++++++++++++++--------------- 5 files changed, 258 insertions(+), 264 deletions(-) diff --git a/src/chainparams.cpp b/src/chainparams.cpp index 2349a9e92..17c961f13 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -88,12 +88,12 @@ public: // TODO generate harder genesis block //genesis.nBits = 0x1d00ffff; genesis.nBits = 0x207fffff; - genesis.nNonce = uint256S("0x0000000000000000000000000000000000000000000000000000000000000000"); - genesis.nSolution = {4237673, 21615556, 16494180, 22743674, 18002967, 22758107, 25855579, 32268516}; + genesis.nNonce = uint256S("0x0000000000000000000000000000000000000000000000000000000000000001"); + genesis.nSolution = {400496, 12965800, 7933378, 26516310, 3573504, 12897574, 9332739, 12534918 }; consensus.hashGenesisBlock = genesis.GetHash(); - assert(consensus.hashGenesisBlock == uint256S("0x73401d7f5470de6619fd3d469dcfdec7d22f7d2946d3c704e0dfccf9aa868750")); - assert(genesis.hashMerkleRoot == uint256S("0x2a9487e467412bc4b0a993a770bc73d5f4230f0ea5907b3f5df2669f0d7e78c1")); + assert(consensus.hashGenesisBlock == uint256S("0x5ff8e250c158c0694814582883343e8a0de5b7e7a5236324d4bf3293a56b6bc5")); + assert(genesis.hashMerkleRoot == uint256S("0x4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b")); vSeeds.push_back(CDNSSeedData("bitcoin.sipa.be", "seed.bitcoin.sipa.be")); // Pieter Wuille vSeeds.push_back(CDNSSeedData("bluematt.me", "dnsseed.bluematt.me")); // Matt Corallo @@ -159,9 +159,9 @@ public: genesis.nTime = 1296688602; genesis.nBits = 0x207fffff; genesis.nNonce = uint256S("0x0000000000000000000000000000000000000000000000000000000000000001"); - genesis.nSolution = {959935, 4504066, 2918279, 21569892, 13720252, 17756975, 14743389, 14769307}; + genesis.nSolution = {72259, 18942116, 2293670, 7851750, 998282, 2855279, 12981515, 15324503}; consensus.hashGenesisBlock = genesis.GetHash(); - assert(consensus.hashGenesisBlock == uint256S("0x3dfdae8ba1db1b2c449704632d27dda27fbd96eb954b53cd041ad02afd977a3b")); + assert(consensus.hashGenesisBlock == uint256S("0x20a21e2f7d7079d517cb19f8db30bafd396652d34c2705093531d0172e40ebc6")); vFixedSeeds.clear(); vSeeds.clear(); @@ -226,11 +226,11 @@ public: nEquihashK = 5; genesis.nTime = 1296688602; genesis.nBits = 0x207fffff; - genesis.nNonce = uint256S("0x0000000000000000000000000000000000000000000000000000000000000004"); - genesis.nSolution = {26, 109, 273, 377, 31, 150, 145, 379, 57, 324, 271, 442, 129, 186, 217, 448, 76, 165, 224, 325, 120, 250, 329, 497, 78, 307, 410, 491, 184, 414, 301, 479}; + genesis.nNonce = uint256S("0x0000000000000000000000000000000000000000000000000000000000000005"); + genesis.nSolution = {8, 205, 95, 334, 13, 385, 266, 399, 58, 389, 129, 383, 110, 284, 460, 499, 45, 496, 269, 348, 65, 242, 212, 272, 141, 477, 394, 469, 175, 185, 270, 365}; consensus.hashGenesisBlock = genesis.GetHash(); nDefaultPort = 18444; - assert(consensus.hashGenesisBlock == uint256S("0x417aa74a9162c47cb5713d819f01c56919cb063ecbcf1c07c3a9ac3555e2254d")); + assert(consensus.hashGenesisBlock == uint256S("0x0d5badaa07ac1914c9b2429825cafe9273763f2c5d44eadabf1e333e50a9e281")); nPruneAfterHeight = 1000; vFixedSeeds.clear(); //! Regtest mode doesn't have any fixed seeds. diff --git a/src/test/bloom_tests.cpp b/src/test/bloom_tests.cpp index 889c90761..77b16fd4e 100644 --- a/src/test/bloom_tests.cpp +++ b/src/test/bloom_tests.cpp @@ -113,13 +113,13 @@ BOOST_AUTO_TEST_CASE(bloom_create_insert_key) BOOST_AUTO_TEST_CASE(bloom_match) { - // Random zcash transaction (dd5ffaa97eb9327b04fa1a73cf2af28e81527b6ad612d728840a7ae3c1093803) + // Random zcash transaction (19cfa5db35f33a2e67fe1b9b738731b62e548d2f27c55a2f28523fec52b71525) CTransaction tx; - CDataStream stream(ParseHex("0100000001d49715970a6b5c491f1d874011973df322a27453e2fdb5a507829893fce22a69000000006a47304402201cfc09e6cfd278289e7312494dfe08be0d18346dc4283e8a78f18a6d8a124556022014042b86888110791bfd95d67c0a88986f2ad24f892d8088f82bc87b88d3bdb1012103a990a2a91a478d867e09e0ce9d48df3e3220423e057e6442dacf7bce14bb29dfffffffff01f0490200000000001976a9144816c219a422243b154337c56562f07ad6ff404d88ac00000000"), SER_DISK, CLIENT_VERSION); + CDataStream stream(ParseHex("01000000015ad78be5497476bbf84869d8156761ca850b6e82e48ad1315069a3726516a3d1010000006b483045022100ba5e90204e83c5f961b67c6232c1cc6c360afd36d43fcfae0de7af2e75f4cda7022012fec415a12048dbb70511fda6195b090b56735232281dc1144409833a092edc012102c322382e17c9ed4f47183f219cc5dd7853f939fb8eebae3c943622e0abf8d5e5feffffff0280969800000000001976a91430271a250e92135ce0db0783ebb63aaeb58e47f988acd694693a000000001976a9145f0d00adba6489150808feb4108d7be582cbb2e188ac0a000000"), SER_DISK, CLIENT_VERSION); stream >> tx; - // and one which spends it (071921cd01ec92e2d8e4aaf6bbf395858576b4bd979da9f88a521d1e619d8c8f) - CDataStream spendStream(ParseHex("0100000001033809c1e37a0a8428d712d66a7b52818ef22acf731afa047b32b97ea9fa5fdd000000006b483045022100da3bce63d1c8904bad436f06109ab90a1380c560d21fb2298bb3802d8d3f1206022063c5581894818a5a56a22292fc81efc168eeccd69f5642de612b071f129f90f50121020cdf9b096dc2cd4718a05a3c1fa4d317dff2ab6837e0c2f6fd3988fd84b95524ffffffff01f0490200000000001976a9144816c219a422243b154337c56562f07ad6ff404d88ac00000000"), SER_DISK, CLIENT_VERSION); + // and one which spends it (1079621bf638e8bea9ee2f8d15287ae31a269969c360006d68d8ee07a7f532e6) + CDataStream spendStream(ParseHex("01000000012515b752ec3f52282f5ac5272f8d542eb63187739b1bfe672e3af335dba5cf19000000006b4830450221009e496c27d1ec174666da187815407c5b7b4d71ed8935e427a334df6d5d7c9e2c022007ca48eabad68cdec0a7d3be15d64a950bb3d80ac2b988fcd82394064a0a32a0012102afe67a769ff6a19f6a227b05d7e1a6b0a2e6851481c8c92f232979d33bb2bc0cffffffff01808d5b00000000001976a9146d1c88970e614202031a4f2ba13846f8ce91019e88ac00000000"), SER_DISK, CLIENT_VERSION); //unsigned char ch[] = {0x01, 0x00, 0x00, 0x00, 0x01, 0x6b, 0xff, 0x7f, 0xcd, 0x4f, 0x85, 0x65, 0xef, 0x40, 0x6d, 0xd5, 0xd6, 0x3d, 0x4f, 0xf9, 0x4f, 0x31, 0x8f, 0xe8, 0x20, 0x27, 0xfd, 0x4d, 0xc4, 0x51, 0xb0, 0x44, 0x74, 0x01, 0x9f, 0x74, 0xb4, 0x00, 0x00, 0x00, 0x00, 0x8c, 0x49, 0x30, 0x46, 0x02, 0x21, 0x00, 0xda, 0x0d, 0xc6, 0xae, 0xce, 0xfe, 0x1e, 0x06, 0xef, 0xdf, 0x05, 0x77, 0x37, 0x57, 0xde, 0xb1, 0x68, 0x82, 0x09, 0x30, 0xe3, 0xb0, 0xd0, 0x3f, 0x46, 0xf5, 0xfc, 0xf1, 0x50, 0xbf, 0x99, 0x0c, 0x02, 0x21, 0x00, 0xd2, 0x5b, 0x5c, 0x87, 0x04, 0x00, 0x76, 0xe4, 0xf2, 0x53, 0xf8, 0x26, 0x2e, 0x76, 0x3e, 0x2d, 0xd5, 0x1e, 0x7f, 0xf0, 0xbe, 0x15, 0x77, 0x27, 0xc4, 0xbc, 0x42, 0x80, 0x7f, 0x17, 0xbd, 0x39, 0x01, 0x41, 0x04, 0xe6, 0xc2, 0x6e, 0xf6, 0x7d, 0xc6, 0x10, 0xd2, 0xcd, 0x19, 0x24, 0x84, 0x78, 0x9a, 0x6c, 0xf9, 0xae, 0xa9, 0x93, 0x0b, 0x94, 0x4b, 0x7e, 0x2d, 0xb5, 0x34, 0x2b, 0x9d, 0x9e, 0x5b, 0x9f, 0xf7, 0x9a, 0xff, 0x9a, 0x2e, 0xe1, 0x97, 0x8d, 0xd7, 0xfd, 0x01, 0xdf, 0xc5, 0x22, 0xee, 0x02, 0x28, 0x3d, 0x3b, 0x06, 0xa9, 0xd0, 0x3a, 0xcf, 0x80, 0x96, 0x96, 0x8d, 0x7d, 0xbb, 0x0f, 0x91, 0x78, 0xff, 0xff, 0xff, 0xff, 0x02, 0x8b, 0xa7, 0x94, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x19, 0x76, 0xa9, 0x14, 0xba, 0xde, 0xec, 0xfd, 0xef, 0x05, 0x07, 0x24, 0x7f, 0xc8, 0xf7, 0x42, 0x41, 0xd7, 0x3b, 0xc0, 0x39, 0x97, 0x2d, 0x7b, 0x88, 0xac, 0x40, 0x94, 0xa8, 0x02, 0x00, 0x00, 0x00, 0x00, 0x19, 0x76, 0xa9, 0x14, 0xc1, 0x09, 0x32, 0x48, 0x3f, 0xec, 0x93, 0xed, 0x51, 0xf5, 0xfe, 0x95, 0xe7, 0x25, 0x59, 0xf2, 0xcc, 0x70, 0x43, 0xf9, 0x88, 0xac, 0x00, 0x00, 0x00, 0x00, 0x00}; //vector vch(ch, ch + sizeof(ch) -1); @@ -129,40 +129,39 @@ BOOST_AUTO_TEST_CASE(bloom_match) spendStream >> spendingTx; CBloomFilter filter(10, 0.000001, 0, BLOOM_UPDATE_ALL); - filter.insert(uint256S("0xdd5ffaa97eb9327b04fa1a73cf2af28e81527b6ad612d728840a7ae3c1093803")); + filter.insert(uint256S("0x19cfa5db35f33a2e67fe1b9b738731b62e548d2f27c55a2f28523fec52b71525")); BOOST_CHECK_MESSAGE(filter.IsRelevantAndUpdate(tx), "Simple Bloom filter didn't match tx hash"); filter = CBloomFilter(10, 0.000001, 0, BLOOM_UPDATE_ALL); // byte-reversed tx hash - filter.insert(ParseHex("033809c1e37a0a8428d712d66a7b52818ef22acf731afa047b32b97ea9fa5fdd")); + filter.insert(ParseHex("2515b752ec3f52282f5ac5272f8d542eb63187739b1bfe672e3af335dba5cf19")); BOOST_CHECK_MESSAGE(filter.IsRelevantAndUpdate(tx), "Simple Bloom filter didn't match manually serialized tx hash"); filter = CBloomFilter(10, 0.000001, 0, BLOOM_UPDATE_ALL); - filter.insert(ParseHex("304402201cfc09e6cfd278289e7312494dfe08be0d18346dc4283e8a78f18a6d8a124556022014042b86888110791bfd95d67c0a88986f2ad24f892d8088f82bc87b88d3bdb101")); + filter.insert(ParseHex("3045022100ba5e90204e83c5f961b67c6232c1cc6c360afd36d43fcfae0de7af2e75f4cda7022012fec415a12048dbb70511fda6195b090b56735232281dc1144409833a092edc01")); BOOST_CHECK_MESSAGE(filter.IsRelevantAndUpdate(tx), "Simple Bloom filter didn't match input signature"); filter = CBloomFilter(10, 0.000001, 0, BLOOM_UPDATE_ALL); - filter.insert(ParseHex("03a990a2a91a478d867e09e0ce9d48df3e3220423e057e6442dacf7bce14bb29df")); + filter.insert(ParseHex("02c322382e17c9ed4f47183f219cc5dd7853f939fb8eebae3c943622e0abf8d5e5")); BOOST_CHECK_MESSAGE(filter.IsRelevantAndUpdate(tx), "Simple Bloom filter didn't match input pub key"); filter = CBloomFilter(10, 0.000001, 0, BLOOM_UPDATE_ALL); - filter.insert(ParseHex("4816c219a422243b154337c56562f07ad6ff404d")); + filter.insert(ParseHex("30271a250e92135ce0db0783ebb63aaeb58e47f9")); BOOST_CHECK_MESSAGE(filter.IsRelevantAndUpdate(tx), "Simple Bloom filter didn't match output address"); BOOST_CHECK_MESSAGE(filter.IsRelevantAndUpdate(spendingTx), "Simple Bloom filter didn't add output"); // Need a second output for this. - /* filter = CBloomFilter(10, 0.000001, 0, BLOOM_UPDATE_ALL); - filter.insert(ParseHex("a266436d2965547608b9e15d9032a7b9d64fa431")); + filter.insert(ParseHex("5f0d00adba6489150808feb4108d7be582cbb2e1")); BOOST_CHECK_MESSAGE(filter.IsRelevantAndUpdate(tx), "Simple Bloom filter didn't match output address"); - */ + // This prev output has index of 1 filter = CBloomFilter(10, 0.000001, 0, BLOOM_UPDATE_ALL); - filter.insert(COutPoint(uint256S("0x692ae2fc93988207a5b5fde25374a222f33d971140871d1f495c6b0a971597d4"), 0)); + filter.insert(COutPoint(uint256S("0xd1a3166572a3695031d18ae4826e0b85ca616715d86948f8bb767449e58bd75a"), 1)); BOOST_CHECK_MESSAGE(filter.IsRelevantAndUpdate(tx), "Simple Bloom filter didn't match COutPoint"); filter = CBloomFilter(10, 0.000001, 0, BLOOM_UPDATE_ALL); - COutPoint prevOutPoint(uint256S("0x692ae2fc93988207a5b5fde25374a222f33d971140871d1f495c6b0a971597d4"), 0); + COutPoint prevOutPoint(uint256S("0xd1a3166572a3695031d18ae4826e0b85ca616715d86948f8bb767449e58bd75a"), 1); { vector data(32 + sizeof(unsigned int)); memcpy(&data[0], prevOutPoint.hash.begin(), 32); @@ -190,15 +189,15 @@ BOOST_AUTO_TEST_CASE(bloom_match) BOOST_AUTO_TEST_CASE(merkle_block_1) { - // Random zcash block (0a18aa311b3c81284754677e66e3a78e5390680e54e4d9c1a716a74bf7bdd850) + // zcash regtest block 25abec437fb3e176fc3058076b78ec95249f20ceb4e2cff69f90525d964440b5 // With 6 txes CBlock block; - CDataStream stream(ParseHex("0400000088804e46ac93ae538cc4977aa65752be37e5af84cffdbab6d329b907622d324afd2edd33b94f6d28167d53a815af40448150897061caa5ebd85074525a9c2c3100000000000000000000000000000000000000000000000000000000000000006b019457ffff7f200000bfc18df0babc36d4e1d6ef8a6e343c15c3bec1b7b936440f839d99d1000008cf940200d0e6730013b2580060577f00f3c74a0041951001e43707015a1f1b010601000000010000000000000000000000000000000000000000000000000000000000000000ffffffff035e0101ffffffff0283c70a0000000000232102ffa90cf88320e4cbaa282506f6b2c1df39b0fabdcd0ceb685979bb6345acfd95ac98ab02000000000017a9146708e6670db0b950dac68031025cc5b63213a49187000000000100000001a2d8e5984af5f902ce8ee42a431f2211cd92e0347eb8304794bb29a95385eeab000000004847304402200b8b7d29ac534c83d57771215b1af572a96b41283ced1a2a8c3b7258a5687c7c02202e989869b11085745e04d5a23bdcca5e02ef6263270f5b8c55e400a10fcc31ed01feffffff02602c0500000000001976a91482d75bc161b2230c6fbbeb586d10c66c3f962fc288ac10270000000000001976a9142b891e223001d0d68bdbcc9d339057aaaa86f92188ac0200000001000000015339144fde1f417adeabc7d3e8fcf01bee9cc5da5fe7a5f80a93fdd1b69393430000000049483045022100cb6d1d202701d5a13a896048731426f7bddc7c03e85009dc6533709bdbf6e339022056fa5c9cfb60cb5c55af6c90583e079049545c7ec082452b69b7df6bdd322e3501feffffff02b0ef0500000000001976a91457db1edd2585f4140bbcd0d9e27821f04fcca4b688ac10270000000000001976a9142b891e223001d0d68bdbcc9d339057aaaa86f92188ac020000000100000001f503717810123e7f40a6ab13c7866102d137fc2b077dfca39ff61f3879e37ceb0000000049483045022100a4063874bb0ae4710c75ab45d437cc30894bfc89c7bb2ad0cc7739785d25879d02204783c8a6b99f50134539697a7ce86ed80a9f2ea2975c5386e66154b2a6c0a55401feffffff0210270000000000001976a9142b891e223001d0d68bdbcc9d339057aaaa86f92188ac10690400000000001976a914e50a70d55a860cb7e73f7584cff7875ed620919a88ac020000000100000001b077d12d457292c4d8b2e0e853eea6eb19eba20984e0cffc8441ba78111f9b89000000004847304402205ef1baaa781496b89d34aaae4c98b7e36f3235fc91e7e94481ce1b401eae758702200ae0b18264154229fc8d0a63df6737f1be63fe8b50401394f03711bf92d5ea3201feffffff0205b30600000000001976a914aa3f898ea469eb2fc2e404ed145dc53cc586ce9e88ac10270000000000001976a9142b891e223001d0d68bdbcc9d339057aaaa86f92188ac02000000010000000399a7a65dcc321f2586b61d091b663cd68042804b583540924591ae20f4f26cd9000000006a47304402202508bd6e4d2e0c93275beffa034b55f0aabde470147606cedb794534eac4a3c80220098a202bd0863ed621abe251f31b26d01cb5c652d7da51c4ed582f5ff13d0458012103fb660ee1d5341e4e908d8d779af7a5afd05906142cd5f84ff30fc34264408b2dfeffffff1122a4ff1174c6d3e022dd56a0940a2a937bd90493a7b4f2711f75c9a6ecdade000000006a473044022002d71379dd96afb965ae88992b5b809c08805a1235e9ce25737131f08b1f81160220316b075e4f137729023e81b54278baa6cfb3c2dd327e8fff763c255787b347a9012102fd61e686c93ef2881c60b9635d53559445de6ef6cb6ba2f91a7ac11ab6eaff87feffffff21d123d2ea376cd4a671678145e34cf1a3322bd569866d59ca0edf425da0d1cc010000006b483045022100ae2709f53a71a7be9acb46bd2571352bfecf33ddbb0796b87c13884038fed5e20220784b8895c3a3c9784a6184a323f6324d6997e9cfae907bcdd3377a73334cb3370121037c0af65516ad1cd82ff72e3582aea350d98844713ed4088cad27c67ed98a73b7feffffff0210270000000000001976a9142b891e223001d0d68bdbcc9d339057aaaa86f92188ace8530f00000000001976a9142306e76c457f7ba143eb0ecc7dbeb2d493f4b5d088ac02000000"), SER_NETWORK, PROTOCOL_VERSION); + CDataStream stream(ParseHex("040000008e0fd453540d05e9a718b02c4643ad30f56bc76b3ae4339b95cc162d272b064b23f737f85b3e014364614b706e37e032820c9b924cf3496d3dd2f5b267f2aa790000000000000000000000000000000000000000000000000000000000000000974b9857ffff7f200400180af05909e4db334305b55e0876b79eaa64ebdd64d56f8a8b503e99000020080000003301000069000000880000004e000000f6010000d9000000e40000001f00000032010000150100002101000036000000ec010000620000000d0100003d00000078010000df0000004b01000070000000e0010000f1000000e70100006c000000ce0100007e010000e30100006f000000b3000000ba010000bf0100000601000000010000000000000000000000000000000000000000000000000000000000000000ffffffff035c0101ffffffff0256dd9a3b0000000023210262e10da104f17773769ad0bfb03bbb98c51e1389e372fcc528bece7ded083955ac80b2e60e0000000017a9146708e6670db0b950dac68031025cc5b63213a491870000000001000000018252cdb4d1d1a7417fb063a09b0fb89318fd8b792d93af80e27b8b477df4738c0000000048473044022068ad43fc1c4fb6d37c369ea2ee4120023380753ed7f01fd349b14d86f34acc4a02202b6852e81505e756781c396e99161e8627933730bb057181b94f3e40cd80a57901feffffff02400d0300000000001976a914c390a7a91a06692d15e50eae443018bae3434a3188ac05b9973b000000001976a91492a07418ce1a941746b22bf51bc5d33e8394cf2688ac0100000001000000019f726046a4fb8c30815afe55fd6799eb898c8948e9605c397294a8f25592fba300000000484730440220116b3265320e4b1dece005978b2194009693e5773496ef51ed599400275abd44022025bcf8e76b1399204b36929f6e6e1266d5dcc7939e45d7cb8334bd42dab4868401feffffff02a03f993b000000001976a914899e43d2889647d3c3eefd741e15c1373a4f895188aca0860100000000001976a914202662c4d7b0164bd21f64d5af99a7fdb6eb0d5d88ac0100000001000000012343cf08fa9ab78c3ed238e76c678efcfa54ed52e496eda7873e019a294eff30000000004847304402201c1b8318cd3f869a0a6e69f0577a27a10f531805330ab17f69d61711ee00ab6902207515fbebace064948eba406b541108fe1ad771c9005f849a97bb82a3212a3aaf01feffffff02557c983b000000001976a914ead7e8b79a77c04fe65cb52b969c0cfcf97d632d88acf0490200000000001976a9148298e83e54bf2b016697b5bdebae79f190bbec5588ac000000000100000001d9ce0f8646d4c5ce03d00250bdefd0c268b902f194b6ac6de9e79010f10ea3d1000000004847304402207f68d9fcb9d2376d7755e5819ba905bd6862839a929dc79e9cf0e2fd56b9ded80220600b7aa879d1bcce4c77561c3f3229fd0fa14cf65247cee9ad62d03eb2580d2401feffffff02f0490200000000001976a9148298e83e54bf2b016697b5bdebae79f190bbec5588ac557c983b000000001976a914a97a3406f9b8f7a3720e5d35ff785e756552084188ac010000000100000001394e4d8af2a70d68d1048a91625289e79bc1f3b6e9627eb83b802e6eec46d47a010000006a473044022044d71071d687954d0a72788121b8f5284fbe39bd34ac7c08824ea3b190fb1ad80220255c7820980fd0e0040fed568f00c200d7b564dc452e7e82b8287bb7d67447450121033f69ce5e46b834ef6ac60b50b0e053fab3f2a41fc8656b73296e91415af85a9ffeffffff02400d0300000000001976a914c390a7a91a06692d15e50eae443018bae3434a3188ac5b694b3b000000001976a9146a9912375a85f2bb9137a1bbcd8dd6517763497088ac01000000"), SER_NETWORK, PROTOCOL_VERSION); stream >> block; CBloomFilter filter(10, 0.000001, 0, BLOOM_UPDATE_ALL); // Match the last transaction - filter.insert(uint256S("0xa562d78f7a20d11e43fe5eabbcf90a25b60f28cd59363c4250ad3a9024057c9e")); + filter.insert(uint256S("0xe9ad9403edde19b31c09a9b5fd6fbbcaaab9e9905906d04b8acd0528671c6172")); CMerkleBlock merkleBlock(block, filter); BOOST_CHECK(merkleBlock.header.GetHash() == block.GetHash()); @@ -206,7 +205,7 @@ BOOST_AUTO_TEST_CASE(merkle_block_1) BOOST_CHECK(merkleBlock.vMatchedTxn.size() == 1); pair pair = merkleBlock.vMatchedTxn[0]; - BOOST_CHECK(merkleBlock.vMatchedTxn[0].second == uint256S("0xa562d78f7a20d11e43fe5eabbcf90a25b60f28cd59363c4250ad3a9024057c9e")); + BOOST_CHECK(merkleBlock.vMatchedTxn[0].second == uint256S("0xe9ad9403edde19b31c09a9b5fd6fbbcaaab9e9905906d04b8acd0528671c6172")); BOOST_CHECK(merkleBlock.vMatchedTxn[0].first == 5); vector vMatched; BOOST_CHECK(merkleBlock.txn.ExtractMatches(vMatched) == block.hashMerkleRoot); @@ -215,7 +214,7 @@ BOOST_AUTO_TEST_CASE(merkle_block_1) BOOST_CHECK(vMatched[i] == merkleBlock.vMatchedTxn[i].second); // Also match the 2nd last - filter.insert(uint256S("0x028ab77cd33e7bbd91a7119d755bc7c151f8fb3cd307066fde28a87dc669fa4f")); + filter.insert(uint256S("0x8282c7e860d707964a7bdeec5adca426195abc60d295189ca505e79038b6d6e5")); merkleBlock = CMerkleBlock(block, filter); BOOST_CHECK(merkleBlock.header.GetHash() == block.GetHash()); @@ -223,7 +222,7 @@ BOOST_AUTO_TEST_CASE(merkle_block_1) BOOST_CHECK(merkleBlock.vMatchedTxn[1] == pair); - BOOST_CHECK(merkleBlock.vMatchedTxn[0].second == uint256S("0x028ab77cd33e7bbd91a7119d755bc7c151f8fb3cd307066fde28a87dc669fa4f")); + BOOST_CHECK(merkleBlock.vMatchedTxn[0].second == uint256S("0x8282c7e860d707964a7bdeec5adca426195abc60d295189ca505e79038b6d6e5")); BOOST_CHECK(merkleBlock.vMatchedTxn[0].first == 4); BOOST_CHECK(merkleBlock.txn.ExtractMatches(vMatched) == block.hashMerkleRoot); @@ -235,15 +234,15 @@ BOOST_AUTO_TEST_CASE(merkle_block_1) BOOST_AUTO_TEST_CASE(merkle_block_2) { - // Random zcash block (7d7f21eed27f0cef570542da3f3221c9e3ce5378539b8a241a3b627ae87112f1) + // Regtest zcash block 78d1747c76b6e226a141283fa989b7b4b758ef49f6e329b45f1ea927b5b06582 // With 5 txes CBlock block; - CDataStream stream(ParseHex("0400000086fc337f4d96ad6fe26922993aff7f460610f023947fb1524a9796c6039e336e9e3f50e8efd148368f28751b175acc0a2f84e90d95804b0240ed77805208d7140000000000000000000000000000000000000000000000000000000000000000085f9457ffff7f200000eeab3b01a349c2321e62021d3127a7453012509b43b617b84d8ade01000008ad2d65008026b20155667d00e6102901b0ff6800ff82f10088cc9500c51eff010501000000010000000000000000000000000000000000000000000000000000000000000000ffffffff0502a0000101ffffffff02e1e3c100000000002321032b5658ac8bc397cb7eec32bda5e0126b07237ad06416c4b0c26515d200f271abac80841e000000000017a9146708e6670db0b950dac68031025cc5b63213a4918700000000010000000219e8b9f1338a730a196b90c9cade66f30da41ee3b887216ca938debc1e4ab49f0000000048473044022027471af3b10251d4246e0d2835a06e4db14cc0395d0b366f520401768fd959a902203cbf3bcfe6223a475fe768eec6f4e799c37c0b68eecde417a1c52d0df25211e901feffffff7586bc0810ba8f280ebfd28331cbbc9d0340f1e0843d591c85434355aedf5af60000000049483045022100e74bb84b3ff5173db4ac0e1bfd662585a29015e30939ef702bcc1b78e585e46102202dfa012c71c1f57a6d8abf95f028b565523fc781435bc157157fc211e1948dae01feffffff0280969800000000001976a914c580c53320dea648a03a97593d8a1c808da144e688ac39530f00000000001976a9144e208bf1ea539cfc42abba2ed9ed471dd37273ce88ac950000000100000002bb040278a4d7db142130f76cad84a73c92acbf4d09b14a1b4b4a20e3f03813ff0000000049483045022100a26a7b988da9ec27c5296da2284d98caf000b4eac1228755020fb081fb087520022046d3afe1ac0e272a2dc471a4c428330889dd2105a0b0522eb048e336fd15e1f101feffffff0c142569ea608b72f23b0865c631fdc7e1f121934a2c4ae4d38927922c162089010000006b483045022100ddc61e56211a99738b4d6f5a23b1b6e5e3cbea61c2f4450aa805fcb89f8af79502200802e6b51b56624942edf13a5e1acf37e670d7bd91de2b2ee02b4494c9cce0a5012103a3097a1563701a2e7f49986980d7e771837bae6500776c555916e9251fe30bd3feffffff02d8590f00000000001976a914a4456fc397881ed5f12dea3fd0dea651320f49d388ac00093d00000000001976a914c580c53320dea648a03a97593d8a1c808da144e688ac950000000100000003669fb2f8f1bd9108db56b69ac744c5c99c4bc2007450f0d583f62b547d0dba7e0000000048473044022072fdbcd8824d8b24c3f28a2a47d041e206bf8d04ba87b0cda501961dcbfc1de7022076ec3a543b2c2577e91ff575353d29203eeaafd5acd5563f4782e80494da75d301feffffff810f324b04fc23388ea298b07333eb61c332ac18ff956930c7159d2f1f3e7e71000000006a4730440220686bb245a82628d546f4cd707080106f49344aeda007f579fc4d65f39ffa9478022015ebda540b1cc62859fb388c5ee886c072ef0b2bcacfca9cdf59f66994e3e03d012103f795e1424eab94769f4652dd54ab14d7a8e404620c0e8b66586dde70485f723bfeffffff0c142569ea608b72f23b0865c631fdc7e1f121934a2c4ae4d38927922c162089000000006b483045022100f6de5dd27bba83f56a47f92aa196899bee0d8bd64198c5b4e5ff28bb410fb2d002204058b435554da16a7a9551ed3186e6eb5322b24886435aa75f50f91735e7ee60012102ce64b6712044dae5a45b4167a28a746ba2053b300ad1eae2f873a7b93ba4417efeffffff02404b4c00000000001976a914c580c53320dea648a03a97593d8a1c808da144e688acfc4e0f00000000001976a91471738f751839f99768c4a2e9c689acd9b184225488ac950000000100000001880a0b5d9e485fee5e457c41451e7fc9ca947bd1a8f5cc92f94ac6a42aa1c178000000006b483045022100c0345a7fdeabdfa6178b4ffff027c50c9ae8ba6ee13f70889d36063e863a326302202c7bc4146cf2b4d6f225db5ad2cf6bafeac04f4d121cf2428318d3795890dffb012102a7c4ed2842941f56e666820b4fd2db00ad04c2336c4e22d89c9c6a632cc10721ffffffff01e0930400000000001976a91472dd7e185c3f069223560a1df310c81d4d12804c88ac00000000"), SER_NETWORK, PROTOCOL_VERSION); + CDataStream stream(ParseHex("0400000058d318a0ce55f9f9fda7456c0c608ed68653776010cb6c6dcfc9657641506e1cce61be33285db054c4b3f1f2e069c759e94570e4902bcb0dbe549a39e4d98f6b0000000000000000000000000000000000000000000000000000000000000000a7559857fbff7f2003001c9c71914ce8f872f4dbc7c7d8b1615d6f6a1f78d04e07ceb619f0b700002001000000fd00000036000000f90100002600000058010000420000008301000083000000b8000000050100002301000094000000ab0000000d0100007e010000370000004500000006010000d10100007f000000330100009f010000d501000058000000aa000000a100000057010000b600000002010000be010000e10100000401000000010000000000000000000000000000000000000000000000000000000000000000ffffffff0401150101ffffffff02d4dbd73b00000000232102498e387bed66f7ccd4a039208a46ea3e04680501b7a9c574df38bb2f172cbe0fac80b2e60e0000000017a9146708e6670db0b950dac68031025cc5b63213a49187000000000100000001451bb020824ae2d6440576e58e9fa9c58086c547f0168c4cafe10f7b4285cded0000000049483045022100cf73e16190bc1a45451d9e603bb828b7b95f0bbae11865b8917bd3aa55f1699b0220454dce223ce17a266d2d193103bdc403378378a6dc9f0ad763537885fb55c69c01feffffff02567a4e3b000000001976a9146b18cb96f32a92fbeefb7cea7eaf0dd2bf95da3c88ac404b4c00000000001976a91430271a250e92135ce0db0783ebb63aaeb58e47f988ac0a00000001000000015ad78be5497476bbf84869d8156761ca850b6e82e48ad1315069a3726516a3d1010000006b483045022100ba5e90204e83c5f961b67c6232c1cc6c360afd36d43fcfae0de7af2e75f4cda7022012fec415a12048dbb70511fda6195b090b56735232281dc1144409833a092edc012102c322382e17c9ed4f47183f219cc5dd7853f939fb8eebae3c943622e0abf8d5e5feffffff0280969800000000001976a91430271a250e92135ce0db0783ebb63aaeb58e47f988acd694693a000000001976a9145f0d00adba6489150808feb4108d7be582cbb2e188ac0a00000001000000012515b752ec3f52282f5ac5272f8d542eb63187739b1bfe672e3af335dba5cf19000000006b4830450221009e496c27d1ec174666da187815407c5b7b4d71ed8935e427a334df6d5d7c9e2c022007ca48eabad68cdec0a7d3be15d64a950bb3d80ac2b988fcd82394064a0a32a0012102afe67a769ff6a19f6a227b05d7e1a6b0a2e6851481c8c92f232979d33bb2bc0cffffffff01808d5b00000000001976a9146d1c88970e614202031a4f2ba13846f8ce91019e88ac00000000"), SER_NETWORK, PROTOCOL_VERSION); stream >> block; CBloomFilter filter(10, 0.000001, 0, BLOOM_UPDATE_ALL); // Match the first transaction - filter.insert(uint256S("0xbadc26343ec0d00d1106e5715a15aa10d4000c2211dca8cb76db51560302367e")); + filter.insert(uint256S("0x2c713883648f44be99ff858b283517f571aa725a4fc032ca52c952fc68058d6e")); CMerkleBlock merkleBlock(block, filter); BOOST_CHECK(merkleBlock.header.GetHash() == block.GetHash()); @@ -251,7 +250,7 @@ BOOST_AUTO_TEST_CASE(merkle_block_2) BOOST_CHECK(merkleBlock.vMatchedTxn.size() == 1); pair pair = merkleBlock.vMatchedTxn[0]; - BOOST_CHECK(merkleBlock.vMatchedTxn[0].second == uint256S("0xbadc26343ec0d00d1106e5715a15aa10d4000c2211dca8cb76db51560302367e")); + BOOST_CHECK(merkleBlock.vMatchedTxn[0].second == uint256S("0x2c713883648f44be99ff858b283517f571aa725a4fc032ca52c952fc68058d6e")); BOOST_CHECK(merkleBlock.vMatchedTxn[0].first == 0); vector vMatched; @@ -260,31 +259,27 @@ BOOST_AUTO_TEST_CASE(merkle_block_2) for (unsigned int i = 0; i < vMatched.size(); i++) BOOST_CHECK(vMatched[i] == merkleBlock.vMatchedTxn[i].second); - // Match an output from the second transaction (the pubkey for address myXFfxnnizWcNmgeA7iccxZgCcoL2g9RjC) + // Match an output from the second transaction (the pubkey for address mjuZa8Dy12HKyUNjc1whNTxRaGU4gGGLxY) // It also matches the third transaction, which spends to the pubkey again - // It also matches the fourth transaction, which spends to the pubkey again // This should match the last transaction because it spends the output matched - filter.insert(ParseHex("c580c53320dea648a03a97593d8a1c808da144e6")); + filter.insert(ParseHex("30271a250e92135ce0db0783ebb63aaeb58e47f9")); merkleBlock = CMerkleBlock(block, filter); BOOST_CHECK(merkleBlock.header.GetHash() == block.GetHash()); - BOOST_CHECK(merkleBlock.vMatchedTxn.size() == 5); + BOOST_CHECK(merkleBlock.vMatchedTxn.size() == 4); BOOST_CHECK(pair == merkleBlock.vMatchedTxn[0]); - BOOST_CHECK(merkleBlock.vMatchedTxn[1].second == uint256S("0x9042d2c9222e7b6ee8901950ae2fd4b2be10a9914f282bb6b01c98bc66630dae")); + BOOST_CHECK(merkleBlock.vMatchedTxn[1].second == uint256S("0x77a47fdfefde8c91d0e0b14e61f1fd480913d609b7f655152abe14b40f4ffea9")); BOOST_CHECK(merkleBlock.vMatchedTxn[1].first == 1); - BOOST_CHECK(merkleBlock.vMatchedTxn[2].second == uint256S("0x3a691704797375f98ea0c48ed60b8c4c8e616e4031ca43a2300df105ef47dee3")); + BOOST_CHECK(merkleBlock.vMatchedTxn[2].second == uint256S("0x19cfa5db35f33a2e67fe1b9b738731b62e548d2f27c55a2f28523fec52b71525")); BOOST_CHECK(merkleBlock.vMatchedTxn[2].first == 2); - BOOST_CHECK(merkleBlock.vMatchedTxn[3].second == uint256S("0x78c1a12aa4c64af992ccf5a8d17b94cac97f1e45417c455eee5f489e5d0b0a88")); + BOOST_CHECK(merkleBlock.vMatchedTxn[3].second == uint256S("0x1079621bf638e8bea9ee2f8d15287ae31a269969c360006d68d8ee07a7f532e6")); BOOST_CHECK(merkleBlock.vMatchedTxn[3].first == 3); - BOOST_CHECK(merkleBlock.vMatchedTxn[4].second == uint256S("0x55a46dbe172f7a453caf98bcc144d732e62b2a2f91615cd21e0571491e13ade6")); - BOOST_CHECK(merkleBlock.vMatchedTxn[4].first == 4); - BOOST_CHECK(merkleBlock.txn.ExtractMatches(vMatched) == block.hashMerkleRoot); BOOST_CHECK(vMatched.size() == merkleBlock.vMatchedTxn.size()); for (unsigned int i = 0; i < vMatched.size(); i++) @@ -293,15 +288,15 @@ BOOST_AUTO_TEST_CASE(merkle_block_2) BOOST_AUTO_TEST_CASE(merkle_block_2_with_update_none) { - // Random zcash block (7d7f21eed27f0cef570542da3f3221c9e3ce5378539b8a241a3b627ae87112f1) + // Regtest zcash block 78d1747c76b6e226a141283fa989b7b4b758ef49f6e329b45f1ea927b5b06582 // With 5 txes CBlock block; - CDataStream stream(ParseHex("0400000086fc337f4d96ad6fe26922993aff7f460610f023947fb1524a9796c6039e336e9e3f50e8efd148368f28751b175acc0a2f84e90d95804b0240ed77805208d7140000000000000000000000000000000000000000000000000000000000000000085f9457ffff7f200000eeab3b01a349c2321e62021d3127a7453012509b43b617b84d8ade01000008ad2d65008026b20155667d00e6102901b0ff6800ff82f10088cc9500c51eff010501000000010000000000000000000000000000000000000000000000000000000000000000ffffffff0502a0000101ffffffff02e1e3c100000000002321032b5658ac8bc397cb7eec32bda5e0126b07237ad06416c4b0c26515d200f271abac80841e000000000017a9146708e6670db0b950dac68031025cc5b63213a4918700000000010000000219e8b9f1338a730a196b90c9cade66f30da41ee3b887216ca938debc1e4ab49f0000000048473044022027471af3b10251d4246e0d2835a06e4db14cc0395d0b366f520401768fd959a902203cbf3bcfe6223a475fe768eec6f4e799c37c0b68eecde417a1c52d0df25211e901feffffff7586bc0810ba8f280ebfd28331cbbc9d0340f1e0843d591c85434355aedf5af60000000049483045022100e74bb84b3ff5173db4ac0e1bfd662585a29015e30939ef702bcc1b78e585e46102202dfa012c71c1f57a6d8abf95f028b565523fc781435bc157157fc211e1948dae01feffffff0280969800000000001976a914c580c53320dea648a03a97593d8a1c808da144e688ac39530f00000000001976a9144e208bf1ea539cfc42abba2ed9ed471dd37273ce88ac950000000100000002bb040278a4d7db142130f76cad84a73c92acbf4d09b14a1b4b4a20e3f03813ff0000000049483045022100a26a7b988da9ec27c5296da2284d98caf000b4eac1228755020fb081fb087520022046d3afe1ac0e272a2dc471a4c428330889dd2105a0b0522eb048e336fd15e1f101feffffff0c142569ea608b72f23b0865c631fdc7e1f121934a2c4ae4d38927922c162089010000006b483045022100ddc61e56211a99738b4d6f5a23b1b6e5e3cbea61c2f4450aa805fcb89f8af79502200802e6b51b56624942edf13a5e1acf37e670d7bd91de2b2ee02b4494c9cce0a5012103a3097a1563701a2e7f49986980d7e771837bae6500776c555916e9251fe30bd3feffffff02d8590f00000000001976a914a4456fc397881ed5f12dea3fd0dea651320f49d388ac00093d00000000001976a914c580c53320dea648a03a97593d8a1c808da144e688ac950000000100000003669fb2f8f1bd9108db56b69ac744c5c99c4bc2007450f0d583f62b547d0dba7e0000000048473044022072fdbcd8824d8b24c3f28a2a47d041e206bf8d04ba87b0cda501961dcbfc1de7022076ec3a543b2c2577e91ff575353d29203eeaafd5acd5563f4782e80494da75d301feffffff810f324b04fc23388ea298b07333eb61c332ac18ff956930c7159d2f1f3e7e71000000006a4730440220686bb245a82628d546f4cd707080106f49344aeda007f579fc4d65f39ffa9478022015ebda540b1cc62859fb388c5ee886c072ef0b2bcacfca9cdf59f66994e3e03d012103f795e1424eab94769f4652dd54ab14d7a8e404620c0e8b66586dde70485f723bfeffffff0c142569ea608b72f23b0865c631fdc7e1f121934a2c4ae4d38927922c162089000000006b483045022100f6de5dd27bba83f56a47f92aa196899bee0d8bd64198c5b4e5ff28bb410fb2d002204058b435554da16a7a9551ed3186e6eb5322b24886435aa75f50f91735e7ee60012102ce64b6712044dae5a45b4167a28a746ba2053b300ad1eae2f873a7b93ba4417efeffffff02404b4c00000000001976a914c580c53320dea648a03a97593d8a1c808da144e688acfc4e0f00000000001976a91471738f751839f99768c4a2e9c689acd9b184225488ac950000000100000001880a0b5d9e485fee5e457c41451e7fc9ca947bd1a8f5cc92f94ac6a42aa1c178000000006b483045022100c0345a7fdeabdfa6178b4ffff027c50c9ae8ba6ee13f70889d36063e863a326302202c7bc4146cf2b4d6f225db5ad2cf6bafeac04f4d121cf2428318d3795890dffb012102a7c4ed2842941f56e666820b4fd2db00ad04c2336c4e22d89c9c6a632cc10721ffffffff01e0930400000000001976a91472dd7e185c3f069223560a1df310c81d4d12804c88ac00000000"), SER_NETWORK, PROTOCOL_VERSION); + CDataStream stream(ParseHex("0400000058d318a0ce55f9f9fda7456c0c608ed68653776010cb6c6dcfc9657641506e1cce61be33285db054c4b3f1f2e069c759e94570e4902bcb0dbe549a39e4d98f6b0000000000000000000000000000000000000000000000000000000000000000a7559857fbff7f2003001c9c71914ce8f872f4dbc7c7d8b1615d6f6a1f78d04e07ceb619f0b700002001000000fd00000036000000f90100002600000058010000420000008301000083000000b8000000050100002301000094000000ab0000000d0100007e010000370000004500000006010000d10100007f000000330100009f010000d501000058000000aa000000a100000057010000b600000002010000be010000e10100000401000000010000000000000000000000000000000000000000000000000000000000000000ffffffff0401150101ffffffff02d4dbd73b00000000232102498e387bed66f7ccd4a039208a46ea3e04680501b7a9c574df38bb2f172cbe0fac80b2e60e0000000017a9146708e6670db0b950dac68031025cc5b63213a49187000000000100000001451bb020824ae2d6440576e58e9fa9c58086c547f0168c4cafe10f7b4285cded0000000049483045022100cf73e16190bc1a45451d9e603bb828b7b95f0bbae11865b8917bd3aa55f1699b0220454dce223ce17a266d2d193103bdc403378378a6dc9f0ad763537885fb55c69c01feffffff02567a4e3b000000001976a9146b18cb96f32a92fbeefb7cea7eaf0dd2bf95da3c88ac404b4c00000000001976a91430271a250e92135ce0db0783ebb63aaeb58e47f988ac0a00000001000000015ad78be5497476bbf84869d8156761ca850b6e82e48ad1315069a3726516a3d1010000006b483045022100ba5e90204e83c5f961b67c6232c1cc6c360afd36d43fcfae0de7af2e75f4cda7022012fec415a12048dbb70511fda6195b090b56735232281dc1144409833a092edc012102c322382e17c9ed4f47183f219cc5dd7853f939fb8eebae3c943622e0abf8d5e5feffffff0280969800000000001976a91430271a250e92135ce0db0783ebb63aaeb58e47f988acd694693a000000001976a9145f0d00adba6489150808feb4108d7be582cbb2e188ac0a00000001000000012515b752ec3f52282f5ac5272f8d542eb63187739b1bfe672e3af335dba5cf19000000006b4830450221009e496c27d1ec174666da187815407c5b7b4d71ed8935e427a334df6d5d7c9e2c022007ca48eabad68cdec0a7d3be15d64a950bb3d80ac2b988fcd82394064a0a32a0012102afe67a769ff6a19f6a227b05d7e1a6b0a2e6851481c8c92f232979d33bb2bc0cffffffff01808d5b00000000001976a9146d1c88970e614202031a4f2ba13846f8ce91019e88ac00000000"), SER_NETWORK, PROTOCOL_VERSION); stream >> block; CBloomFilter filter(10, 0.000001, 0, BLOOM_UPDATE_NONE); // Match the first transaction - filter.insert(uint256S("0xbadc26343ec0d00d1106e5715a15aa10d4000c2211dca8cb76db51560302367e")); + filter.insert(uint256S("0x2c713883648f44be99ff858b283517f571aa725a4fc032ca52c952fc68058d6e")); CMerkleBlock merkleBlock(block, filter); BOOST_CHECK(merkleBlock.header.GetHash() == block.GetHash()); @@ -309,7 +304,7 @@ BOOST_AUTO_TEST_CASE(merkle_block_2_with_update_none) BOOST_CHECK(merkleBlock.vMatchedTxn.size() == 1); pair pair = merkleBlock.vMatchedTxn[0]; - BOOST_CHECK(merkleBlock.vMatchedTxn[0].second == uint256S("0xbadc26343ec0d00d1106e5715a15aa10d4000c2211dca8cb76db51560302367e")); + BOOST_CHECK(merkleBlock.vMatchedTxn[0].second == uint256S("0x2c713883648f44be99ff858b283517f571aa725a4fc032ca52c952fc68058d6e")); BOOST_CHECK(merkleBlock.vMatchedTxn[0].first == 0); vector vMatched; @@ -318,28 +313,24 @@ BOOST_AUTO_TEST_CASE(merkle_block_2_with_update_none) for (unsigned int i = 0; i < vMatched.size(); i++) BOOST_CHECK(vMatched[i] == merkleBlock.vMatchedTxn[i].second); - // Match an output from the second transaction (the pubkey for address myXFfxnnizWcNmgeA7iccxZgCcoL2g9RjC) + // Match an output from the second transaction (the pubkey for address mjuZa8Dy12HKyUNjc1whNTxRaGU4gGGLxY) // It will match the third transaction, which has another pay-to-pubkey output to the same address - // It will match the fourth transaction, which has another pay-to-pubkey output to the same address // This should not match the last transaction though it spends the output matched - filter.insert(ParseHex("c580c53320dea648a03a97593d8a1c808da144e6")); + filter.insert(ParseHex("30271a250e92135ce0db0783ebb63aaeb58e47f9")); merkleBlock = CMerkleBlock(block, filter); BOOST_CHECK(merkleBlock.header.GetHash() == block.GetHash()); - BOOST_CHECK(merkleBlock.vMatchedTxn.size() == 4); + BOOST_CHECK(merkleBlock.vMatchedTxn.size() == 3); BOOST_CHECK(pair == merkleBlock.vMatchedTxn[0]); - BOOST_CHECK(merkleBlock.vMatchedTxn[1].second == uint256S("0x9042d2c9222e7b6ee8901950ae2fd4b2be10a9914f282bb6b01c98bc66630dae")); + BOOST_CHECK(merkleBlock.vMatchedTxn[1].second == uint256S("0x77a47fdfefde8c91d0e0b14e61f1fd480913d609b7f655152abe14b40f4ffea9")); BOOST_CHECK(merkleBlock.vMatchedTxn[1].first == 1); - BOOST_CHECK(merkleBlock.vMatchedTxn[2].second == uint256S("0x3a691704797375f98ea0c48ed60b8c4c8e616e4031ca43a2300df105ef47dee3")); + BOOST_CHECK(merkleBlock.vMatchedTxn[2].second == uint256S("0x19cfa5db35f33a2e67fe1b9b738731b62e548d2f27c55a2f28523fec52b71525")); BOOST_CHECK(merkleBlock.vMatchedTxn[2].first == 2); - BOOST_CHECK(merkleBlock.vMatchedTxn[3].second == uint256S("0x78c1a12aa4c64af992ccf5a8d17b94cac97f1e45417c455eee5f489e5d0b0a88")); - BOOST_CHECK(merkleBlock.vMatchedTxn[3].first == 3); - BOOST_CHECK(merkleBlock.txn.ExtractMatches(vMatched) == block.hashMerkleRoot); BOOST_CHECK(vMatched.size() == merkleBlock.vMatchedTxn.size()); for (unsigned int i = 0; i < vMatched.size(); i++) @@ -349,22 +340,22 @@ BOOST_AUTO_TEST_CASE(merkle_block_2_with_update_none) BOOST_AUTO_TEST_CASE(merkle_block_3_and_serialize) { - // Random zcash block (149e54e5b639d1be22337e2176311ef37f487fcfb12036155407aaaa710b8104) + // Regtest zcash block 528d8fc9ff3bb70e84011c1246eafa2977bce1ce0df29bb4b7512154ff8553a9 // With one tx CBlock block; - CDataStream stream(ParseHex("04000000443e8135b55929f59ff07da32013a08cb71e2f33e0538183ac1956c52124183c2a77a9bad5cc4a5ae1866799d1e148bf9196f25abfbf1758fb242f9cfe6a018e0000000000000000000000000000000000000000000000000000000000000000b45a94574b716f200000a78cee268a82089ff84d8769980442c6335768c5177e3d57f19e0527000008fa9220006d111601601cae01f546da01834874003649fa0124abdb00fd3366010101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff050296000101ffffffff02e07072000000000023210304fe1f36dbe31372a1d9b711a9ad8c9713b3b3e66ca9d4815f16d876a243a0f3ac389c1c000000000017a9146708e6670db0b950dac68031025cc5b63213a4918700000000"), SER_NETWORK, PROTOCOL_VERSION); + CDataStream stream(ParseHex("04000000b54044965d52909ff6cfe2b4ce209f2495ec786b075830fc76e1b37f43ecab254dde7891cec6846a10750145c12984a62d2f001e0640cb4b4fac6ceaca1ca0c70000000000000000000000000000000000000000000000000000000000000000fe4c9857ffff7f20030013205b410bb90025f179fdfc1d28fb9902d7d0c11958e349b2911850000020010000000a000000ae000000040100008d00000014010000b5010000d4010000220000003101000050010000c801000053000000d701000026010000ad01000016000000b60000004f000000ac0000004300000045000000c6000000cc0000002c000000d3000000ec000000b9010000ad000000ba000000e0000000d90100000101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff035d0101ffffffff0200ca9a3b0000000023210262e10da104f17773769ad0bfb03bbb98c51e1389e372fcc528bece7ded083955ac80b2e60e0000000017a9146708e6670db0b950dac68031025cc5b63213a4918700000000"), SER_NETWORK, PROTOCOL_VERSION); stream >> block; CBloomFilter filter(10, 0.000001, 0, BLOOM_UPDATE_ALL); // Match the only transaction - filter.insert(uint256S("0x8e016afe9c2f24fb5817bfbf5af29691bf48e1d1996786e15a4accd5baa9772a")); + filter.insert(uint256S("0xc7a01ccaea6cac4f4bcb40061e002f2da68429c1450175106a84c6ce9178de4d")); CMerkleBlock merkleBlock(block, filter); BOOST_CHECK(merkleBlock.header.GetHash() == block.GetHash()); BOOST_CHECK(merkleBlock.vMatchedTxn.size() == 1); - BOOST_CHECK(merkleBlock.vMatchedTxn[0].second == uint256S("0x8e016afe9c2f24fb5817bfbf5af29691bf48e1d1996786e15a4accd5baa9772a")); + BOOST_CHECK(merkleBlock.vMatchedTxn[0].second == uint256S("0xc7a01ccaea6cac4f4bcb40061e002f2da68429c1450175106a84c6ce9178de4d")); BOOST_CHECK(merkleBlock.vMatchedTxn[0].first == 0); vector vMatched; @@ -375,12 +366,13 @@ BOOST_AUTO_TEST_CASE(merkle_block_3_and_serialize) CDataStream merkleStream(SER_NETWORK, PROTOCOL_VERSION); merkleStream << merkleBlock; - vector vch = ParseHex("04000000443e8135b55929f59ff07da32013a08cb71e2f33e0538183ac1956c52124183c2a77a9bad5cc4a5ae1866799d1e148bf9196f25abfbf1758fb242f9cfe6a018e0000000000000000000000000000000000000000000000000000000000000000b45a94574b716f200000a78cee268a82089ff84d8769980442c6335768c5177e3d57f19e0527000008fa9220006d111601601cae01f546da01834874003649fa0124abdb00fd33660101000000012a77a9bad5cc4a5ae1866799d1e148bf9196f25abfbf1758fb242f9cfe6a018e0101"); + vector vch = ParseHex("04000000b54044965d52909ff6cfe2b4ce209f2495ec786b075830fc76e1b37f43ecab254dde7891cec6846a10750145c12984a62d2f001e0640cb4b4fac6ceaca1ca0c70000000000000000000000000000000000000000000000000000000000000000fe4c9857ffff7f20030013205b410bb90025f179fdfc1d28fb9902d7d0c11958e349b2911850000020010000000a000000ae000000040100008d00000014010000b5010000d4010000220000003101000050010000c801000053000000d701000026010000ad01000016000000b60000004f000000ac0000004300000045000000c6000000cc0000002c000000d3000000ec000000b9010000ad000000ba000000e0000000d901000001000000014dde7891cec6846a10750145c12984a62d2f001e0640cb4b4fac6ceaca1ca0c70101"); vector expected(vch.size()); for (unsigned int i = 0; i < vch.size(); i++) expected[i] = (char)vch[i]; + // Uncomment this line to print out the merkleBlock // std::cout << HexStr(merkleStream.begin(), merkleStream.end()) << std::endl; BOOST_CHECK_EQUAL_COLLECTIONS(expected.begin(), expected.end(), merkleStream.begin(), merkleStream.end()); @@ -389,15 +381,15 @@ BOOST_AUTO_TEST_CASE(merkle_block_3_and_serialize) BOOST_AUTO_TEST_CASE(merkle_block_4) { - // Random zcash block (0a18aa311b3c81284754677e66e3a78e5390680e54e4d9c1a716a74bf7bdd850) + // Regtest zcash block 2af9d3f42301c7411b932268e0ca6dfef3864d2164970dd1dbc351a5a994c988 // With 6 txes CBlock block; - CDataStream stream(ParseHex("0400000088804e46ac93ae538cc4977aa65752be37e5af84cffdbab6d329b907622d324afd2edd33b94f6d28167d53a815af40448150897061caa5ebd85074525a9c2c3100000000000000000000000000000000000000000000000000000000000000006b019457ffff7f200000bfc18df0babc36d4e1d6ef8a6e343c15c3bec1b7b936440f839d99d1000008cf940200d0e6730013b2580060577f00f3c74a0041951001e43707015a1f1b010601000000010000000000000000000000000000000000000000000000000000000000000000ffffffff035e0101ffffffff0283c70a0000000000232102ffa90cf88320e4cbaa282506f6b2c1df39b0fabdcd0ceb685979bb6345acfd95ac98ab02000000000017a9146708e6670db0b950dac68031025cc5b63213a49187000000000100000001a2d8e5984af5f902ce8ee42a431f2211cd92e0347eb8304794bb29a95385eeab000000004847304402200b8b7d29ac534c83d57771215b1af572a96b41283ced1a2a8c3b7258a5687c7c02202e989869b11085745e04d5a23bdcca5e02ef6263270f5b8c55e400a10fcc31ed01feffffff02602c0500000000001976a91482d75bc161b2230c6fbbeb586d10c66c3f962fc288ac10270000000000001976a9142b891e223001d0d68bdbcc9d339057aaaa86f92188ac0200000001000000015339144fde1f417adeabc7d3e8fcf01bee9cc5da5fe7a5f80a93fdd1b69393430000000049483045022100cb6d1d202701d5a13a896048731426f7bddc7c03e85009dc6533709bdbf6e339022056fa5c9cfb60cb5c55af6c90583e079049545c7ec082452b69b7df6bdd322e3501feffffff02b0ef0500000000001976a91457db1edd2585f4140bbcd0d9e27821f04fcca4b688ac10270000000000001976a9142b891e223001d0d68bdbcc9d339057aaaa86f92188ac020000000100000001f503717810123e7f40a6ab13c7866102d137fc2b077dfca39ff61f3879e37ceb0000000049483045022100a4063874bb0ae4710c75ab45d437cc30894bfc89c7bb2ad0cc7739785d25879d02204783c8a6b99f50134539697a7ce86ed80a9f2ea2975c5386e66154b2a6c0a55401feffffff0210270000000000001976a9142b891e223001d0d68bdbcc9d339057aaaa86f92188ac10690400000000001976a914e50a70d55a860cb7e73f7584cff7875ed620919a88ac020000000100000001b077d12d457292c4d8b2e0e853eea6eb19eba20984e0cffc8441ba78111f9b89000000004847304402205ef1baaa781496b89d34aaae4c98b7e36f3235fc91e7e94481ce1b401eae758702200ae0b18264154229fc8d0a63df6737f1be63fe8b50401394f03711bf92d5ea3201feffffff0205b30600000000001976a914aa3f898ea469eb2fc2e404ed145dc53cc586ce9e88ac10270000000000001976a9142b891e223001d0d68bdbcc9d339057aaaa86f92188ac02000000010000000399a7a65dcc321f2586b61d091b663cd68042804b583540924591ae20f4f26cd9000000006a47304402202508bd6e4d2e0c93275beffa034b55f0aabde470147606cedb794534eac4a3c80220098a202bd0863ed621abe251f31b26d01cb5c652d7da51c4ed582f5ff13d0458012103fb660ee1d5341e4e908d8d779af7a5afd05906142cd5f84ff30fc34264408b2dfeffffff1122a4ff1174c6d3e022dd56a0940a2a937bd90493a7b4f2711f75c9a6ecdade000000006a473044022002d71379dd96afb965ae88992b5b809c08805a1235e9ce25737131f08b1f81160220316b075e4f137729023e81b54278baa6cfb3c2dd327e8fff763c255787b347a9012102fd61e686c93ef2881c60b9635d53559445de6ef6cb6ba2f91a7ac11ab6eaff87feffffff21d123d2ea376cd4a671678145e34cf1a3322bd569866d59ca0edf425da0d1cc010000006b483045022100ae2709f53a71a7be9acb46bd2571352bfecf33ddbb0796b87c13884038fed5e20220784b8895c3a3c9784a6184a323f6324d6997e9cfae907bcdd3377a73334cb3370121037c0af65516ad1cd82ff72e3582aea350d98844713ed4088cad27c67ed98a73b7feffffff0210270000000000001976a9142b891e223001d0d68bdbcc9d339057aaaa86f92188ace8530f00000000001976a9142306e76c457f7ba143eb0ecc7dbeb2d493f4b5d088ac02000000"), SER_NETWORK, PROTOCOL_VERSION); + CDataStream stream(ParseHex("04000000ceafe737af74e90fd22ba542d7fe3cd149d8724e4820ae94d1478b056d2ada166ecd34e2c9cf6458b6dc1e88d6ebbeb68cf61976398d2e25e7af12bdfb9e80b30000000000000000000000000000000000000000000000000000000000000000fa589857feff7f200100766220c3fb1793605fcfa671397bed77091d27090840c09c6c90cddb000020250000003c0100005f0100009a01000048000000e60100006b010000bc010000470000003b0100008300000001010000c800000020010000d1000000b601000034000000080100003d0000004b0000003a000000a900000094000000da010000530000008000000096000000a4010000b700000002010000c1000000d70000000601000000010000000000000000000000000000000000000000000000000000000000000000ffffffff0401170101ffffffff024ce29a3b000000002321021046035a4c9cf071676bbb2cafdccf8cdc7b67af239132992273ad53b3c23488ac80b2e60e0000000017a9146708e6670db0b950dac68031025cc5b63213a491870000000001000000012bef176bd090bad3344e609e17b1e7b3be71b5e45a4809c917f94a61c8e992060000000049483045022100d2a72fa35d3e8737879d6dd964e5e5704b146871d946d46098edd59ab3415ed00220568bb41fb34f17db1fa609257b4fd04ffb0e35b41d43d288e5576e774f63bfda01feffffff0200848b3b000000001976a914baa161d9bd51f624ff4db28e3f00179c572e18cf88ac40420f00000000001976a91430271a250e92135ce0db0783ebb63aaeb58e47f988ac0c0000000100000001a9fe4f0fb414be2a1555f6b709d6130948fdf1614eb1e0d0918cdeefdf7fa477000000006a47304402201316590dc69641d6c2c31c89b4434c214be5ffa58f8c7488123edb084aa7e72b02205eb24de0dd8dbe872d1221c4aad477f63988d5497b19ec5950ea1285cf3fb915012103e138ca8f557bbfa4260a15d79b849f92430f507c6631703a9c5e35822e9d952ffeffffff026cf12f3b000000001976a91409c106c79fa392733402b3f37c7fa4523158fbdf88ac80841e00000000001976a91430271a250e92135ce0db0783ebb63aaeb58e47f988ac0c00000001000000012515b752ec3f52282f5ac5272f8d542eb63187739b1bfe672e3af335dba5cf19010000006a473044022075f197b8d4df09e85b97b3aaeaaf0584ebdfc6b3bdc2743abfe4e573f68dea8002201850c7b96ec1593091d95377e8d7acc005032dce356325547bfb66bcca95d137012103ef486cc2238f19830e7761f015fbfd7df29699c13759abdaa883d78091c8b46dfeffffff02acc93b3a000000001976a914ec7dc17fd971f1d3341a064cf9f40c120075ebe488acc0c62d00000000001976a91430271a250e92135ce0db0783ebb63aaeb58e47f988ac000000000100000002a9fe4f0fb414be2a1555f6b709d6130948fdf1614eb1e0d0918cdeefdf7fa477010000006b483045022100e43bdeeb6c46a6f6cfc04f4c7365c899d73bab617da50be62ddeaaf8773ee6b4022040d292378e87892711e866fde87fcb9781caede32081e0d8d2ad88c4bf8787ed012102afe67a769ff6a19f6a227b05d7e1a6b0a2e6851481c8c92f232979d33bb2bc0cfeffffffe632f5a707eed8686d0060c36999261ae37a28158d2feea9bee838f61b627910000000006a4730440220179282f7f2298b1cdf369f5e36fd0380fdbc47e9b6c5b335d45d4734dc463448022030ec39229fc0daaf52ac6d96cfb739b6a59c880a811a933cb8994e5f5b08a4c80121038b35ef477570faed211a1f119441864d41b014a8a6475aad660c2961f8eb03a7feffffff02404b4c00000000001976a91430271a250e92135ce0db0783ebb63aaeb58e47f988ac32865b00000000001976a914f5ca46c06a8ee7653ba4c16c392db42d1e2ed3c388ac0c0000000100000001d4766c87e4f552823eea2d7ab989660605e62eb05a6d2b5ad43b36ae4f557c15000000006b4830450221009b226907cab7113b909b020049110c54c295bd693c0650fe6ed75acbc8dc276f02204981fab2548805f1922c1e2929aa2d1072a21cd15f6d2823897cbc5a0986f517012103716c8473f87f1212caf9aa5150cbc16b5059c9a416cd4606149693d3bd477442feffffff0200093d00000000001976a91430271a250e92135ce0db0783ebb63aaeb58e47f988ac16801e00000000001976a9149ded6f93a3a2b4f67a30ff30f10f5449ce63713488ac0c000000"), SER_NETWORK, PROTOCOL_VERSION); stream >> block; CBloomFilter filter(10, 0.000001, 0, BLOOM_UPDATE_ALL); // Match the last transaction - filter.insert(uint256S("0xa562d78f7a20d11e43fe5eabbcf90a25b60f28cd59363c4250ad3a9024057c9e")); + filter.insert(uint256S("0xc10fa281cd5d2261a66875ee397b968881e3046e81b7792bcd2c2f9036a3dffa")); CMerkleBlock merkleBlock(block, filter); BOOST_CHECK(merkleBlock.header.GetHash() == block.GetHash()); @@ -405,7 +397,7 @@ BOOST_AUTO_TEST_CASE(merkle_block_4) BOOST_CHECK(merkleBlock.vMatchedTxn.size() == 1); pair pair = merkleBlock.vMatchedTxn[0]; - BOOST_CHECK(merkleBlock.vMatchedTxn[0].second == uint256S("0xa562d78f7a20d11e43fe5eabbcf90a25b60f28cd59363c4250ad3a9024057c9e")); + BOOST_CHECK(merkleBlock.vMatchedTxn[0].second == uint256S("0xc10fa281cd5d2261a66875ee397b968881e3046e81b7792bcd2c2f9036a3dffa")); BOOST_CHECK(merkleBlock.vMatchedTxn[0].first == 5); vector vMatched; @@ -415,13 +407,13 @@ BOOST_AUTO_TEST_CASE(merkle_block_4) BOOST_CHECK(vMatched[i] == merkleBlock.vMatchedTxn[i].second); // Also match the 4th transaction - filter.insert(uint256S("0xccd1a05d42df0eca596d8669d52b32a3f14ce345816771a6d46c37ead223d121")); + filter.insert(uint256S("0xd2f48bd2d3ec3679f2af0c79e2ad292fb84987f521704ef10bb9de8e1c50e687")); merkleBlock = CMerkleBlock(block, filter); BOOST_CHECK(merkleBlock.header.GetHash() == block.GetHash()); BOOST_CHECK(merkleBlock.vMatchedTxn.size() == 2); - BOOST_CHECK(merkleBlock.vMatchedTxn[0].second == uint256S("0xccd1a05d42df0eca596d8669d52b32a3f14ce345816771a6d46c37ead223d121")); + BOOST_CHECK(merkleBlock.vMatchedTxn[0].second == uint256S("0xd2f48bd2d3ec3679f2af0c79e2ad292fb84987f521704ef10bb9de8e1c50e687")); BOOST_CHECK(merkleBlock.vMatchedTxn[0].first == 3); BOOST_CHECK(merkleBlock.vMatchedTxn[1] == pair); @@ -434,47 +426,47 @@ BOOST_AUTO_TEST_CASE(merkle_block_4) BOOST_AUTO_TEST_CASE(merkle_block_4_test_p2pubkey_only) { - // Random zcash block (3c182421c55619ac838153e0332f1eb78ca01320a37df09ff52959b535813e44) + // Regtest zcash block 2af9d3f42301c7411b932268e0ca6dfef3864d2164970dd1dbc351a5a994c988 // With 6 txes CBlock block; - CDataStream stream(ParseHex("04000000b976a3322ee5e9d242dc0b465f5c27fdcf5e292789694ed46531e41e509257059dcff7d722ef68818ac8238e312071dfcc7dc004bcb808f1196c9ba9e32fed450000000000000000000000000000000000000000000000000000000000000000675a94575b297620010080cd55554a4c899735a7d13984e7b20959398ffc253a3e540d2c0645000008d69f170034ebec002551500179097601c8363900b62f4d00f976870072b012010601000000010000000000000000000000000000000000000000000000000000000000000000ffffffff050295000101ffffffff0280cc710000000000232103c5da583f3ee0da22004d314b45e6be77cace71778644260032e11bf981db2d42ac646b1c000000000017a9146708e6670db0b950dac68031025cc5b63213a491870000000001000000024ffa69c67da828de6f0607d33cfbf851c1c75b759d11a791bd7b3ed37cb78a02000000006a47304402204a1a53914484608f77a6b2a8263321df466585cc7b7fe83efb020a756e3de67402200c3f8f4067b7a7e4bd69e3e470c863c1cccde825dc95f065bc64fd4f0fd57770012102e1234490210e241ff92318a602b03c9f96e61e48cefc308d09ce8e4d89aa826efeffffff6b2b1e73383909bb5166fd7480c6e320510a81d7314edb72cbc5c548fb35439e000000004847304402200324ce69f57ad21500c4e63ddb51e2bcbf8bb16c5dbf935292c52f19d72f8fcb02207542fd826f72803cf37fe7cbf3559bbc26291754141983ca3d8d47e31f8e4a3e01feffffff02e0930400000000001976a914b444970f859e4deba8942c7fc3fea7126b10497888ac76971000000000001976a914c471e3193347fa63e6e6654097aa16b341d76bca88ac890000000100000001388af1a41c9c99286e272124e32fbc5c1f4af7f55b9a9198dffb6dace9ec33ab00000000494830450221008d6e09b6edf96bbbe53a29527db12eede18f50edb5b7b561c9ab5d48ece3d22a02202c94705e6eeb22b2721ca6ed5876b49f01cd9be461805211d6421ee78f3a0d4b01feffffff02dd4a0f00000000001976a914f35f951a3bc9abb208046df56f34dfe08e23a0fa88ac801a0600000000001976a91472dd7e185c3f069223560a1df310c81d4d12804c88ac890000000100000002032108d0cabea40dccb01020f6e28b747ce9e02312301de9633b58deb022e039000000004847304402200cb4558d6ca6fae452e2972b464944f4c5c0db190e7c4e89c504b52fcbc3d83602203bb3a0e861dae27dbec077fe58aa25272303bb1df4f542b8dda3522bc6d763d901feffffff1edf71037dbc7f30406afe7a0bc1577dd4e9bf460c4c7bddf48ab1e6e855b08f010000006b483045022100af83a715b4a1d2a1d72736e4705b1bc2b3270fd77451db27478f851031416f6b02201dd22bde30b1ba3e7e31044a53ddcd8ed5d82f552dc547a3cc099debaae05bb4012102319fecfd88d7872bd1298222a0b45567da9ff3af29cf890ee60b2b10192bfaf5feffffff02a0860100000000001976a91472dd7e185c3f069223560a1df310c81d4d12804c88acac620f00000000001976a914c3da60b701d2e0b4d31566301c9c9f5071f01bc188ac89000000010000000125c2dae4318d08dd07a3cd3bed9c7de519e0eee0f210f630c2753208f234f51b0000000049483045022100e410502257a92db55a6bfbb7833aef74e9e48c1a4b02037ab837305c4476599b02207b0c33e54a717105a6e80003276a7f63dea9b7db2cef2578cb6b986d8e4d838401feffffff0270881100000000001976a91412517b5217b2c1700d92f9b8aad67453e24e3c5888aca0860100000000001976a914b444970f859e4deba8942c7fc3fea7126b10497888ac890000000100000002aa0a10864e11d225322564862705caf4cb6c30c928793278483a4f5f638779d0000000006b4830450221009530514326b8de4ba1aebd06b5f74903fb3550d846047677b3e882bc379cfa7602203b57f2bd869e7e1d7217b2139ffa8a491ed3c07d01c832389ce01ec99dbccf10012102ce64b6712044dae5a45b4167a28a746ba2053b300ad1eae2f873a7b93ba4417efeffffffc88a41b10c0e433a90d99b4435b8281deb830a6a25eb8dff8194e48910a39bf0010000006b483045022100d0de362b1b8d4e3d7005bd13f870d7cd5872a39bb2371c2f3b60df893147b827022030999f2355ce3f5da6be0dd2bb74b7521271e76e4182b91934a4b25ed6d03ac1012103e0a3402c211ee59bd3a3f5213db04ccda564276b607271e87f6dd58f697b65a7feffffff027f580f00000000001976a9145733181088dfc1f3ca8a77126a3beb06fc72dd5888ace0930400000000001976a91472dd7e185c3f069223560a1df310c81d4d12804c88ac89000000"), SER_NETWORK, PROTOCOL_VERSION); + CDataStream stream(ParseHex("04000000ceafe737af74e90fd22ba542d7fe3cd149d8724e4820ae94d1478b056d2ada166ecd34e2c9cf6458b6dc1e88d6ebbeb68cf61976398d2e25e7af12bdfb9e80b30000000000000000000000000000000000000000000000000000000000000000fa589857feff7f200100766220c3fb1793605fcfa671397bed77091d27090840c09c6c90cddb000020250000003c0100005f0100009a01000048000000e60100006b010000bc010000470000003b0100008300000001010000c800000020010000d1000000b601000034000000080100003d0000004b0000003a000000a900000094000000da010000530000008000000096000000a4010000b700000002010000c1000000d70000000601000000010000000000000000000000000000000000000000000000000000000000000000ffffffff0401170101ffffffff024ce29a3b000000002321021046035a4c9cf071676bbb2cafdccf8cdc7b67af239132992273ad53b3c23488ac80b2e60e0000000017a9146708e6670db0b950dac68031025cc5b63213a491870000000001000000012bef176bd090bad3344e609e17b1e7b3be71b5e45a4809c917f94a61c8e992060000000049483045022100d2a72fa35d3e8737879d6dd964e5e5704b146871d946d46098edd59ab3415ed00220568bb41fb34f17db1fa609257b4fd04ffb0e35b41d43d288e5576e774f63bfda01feffffff0200848b3b000000001976a914baa161d9bd51f624ff4db28e3f00179c572e18cf88ac40420f00000000001976a91430271a250e92135ce0db0783ebb63aaeb58e47f988ac0c0000000100000001a9fe4f0fb414be2a1555f6b709d6130948fdf1614eb1e0d0918cdeefdf7fa477000000006a47304402201316590dc69641d6c2c31c89b4434c214be5ffa58f8c7488123edb084aa7e72b02205eb24de0dd8dbe872d1221c4aad477f63988d5497b19ec5950ea1285cf3fb915012103e138ca8f557bbfa4260a15d79b849f92430f507c6631703a9c5e35822e9d952ffeffffff026cf12f3b000000001976a91409c106c79fa392733402b3f37c7fa4523158fbdf88ac80841e00000000001976a91430271a250e92135ce0db0783ebb63aaeb58e47f988ac0c00000001000000012515b752ec3f52282f5ac5272f8d542eb63187739b1bfe672e3af335dba5cf19010000006a473044022075f197b8d4df09e85b97b3aaeaaf0584ebdfc6b3bdc2743abfe4e573f68dea8002201850c7b96ec1593091d95377e8d7acc005032dce356325547bfb66bcca95d137012103ef486cc2238f19830e7761f015fbfd7df29699c13759abdaa883d78091c8b46dfeffffff02acc93b3a000000001976a914ec7dc17fd971f1d3341a064cf9f40c120075ebe488acc0c62d00000000001976a91430271a250e92135ce0db0783ebb63aaeb58e47f988ac000000000100000002a9fe4f0fb414be2a1555f6b709d6130948fdf1614eb1e0d0918cdeefdf7fa477010000006b483045022100e43bdeeb6c46a6f6cfc04f4c7365c899d73bab617da50be62ddeaaf8773ee6b4022040d292378e87892711e866fde87fcb9781caede32081e0d8d2ad88c4bf8787ed012102afe67a769ff6a19f6a227b05d7e1a6b0a2e6851481c8c92f232979d33bb2bc0cfeffffffe632f5a707eed8686d0060c36999261ae37a28158d2feea9bee838f61b627910000000006a4730440220179282f7f2298b1cdf369f5e36fd0380fdbc47e9b6c5b335d45d4734dc463448022030ec39229fc0daaf52ac6d96cfb739b6a59c880a811a933cb8994e5f5b08a4c80121038b35ef477570faed211a1f119441864d41b014a8a6475aad660c2961f8eb03a7feffffff02404b4c00000000001976a91430271a250e92135ce0db0783ebb63aaeb58e47f988ac32865b00000000001976a914f5ca46c06a8ee7653ba4c16c392db42d1e2ed3c388ac0c0000000100000001d4766c87e4f552823eea2d7ab989660605e62eb05a6d2b5ad43b36ae4f557c15000000006b4830450221009b226907cab7113b909b020049110c54c295bd693c0650fe6ed75acbc8dc276f02204981fab2548805f1922c1e2929aa2d1072a21cd15f6d2823897cbc5a0986f517012103716c8473f87f1212caf9aa5150cbc16b5059c9a416cd4606149693d3bd477442feffffff0200093d00000000001976a91430271a250e92135ce0db0783ebb63aaeb58e47f988ac16801e00000000001976a9149ded6f93a3a2b4f67a30ff30f10f5449ce63713488ac0c000000"), SER_NETWORK, PROTOCOL_VERSION); stream >> block; CBloomFilter filter(10, 0.000001, 0, BLOOM_UPDATE_P2PUBKEY_ONLY); - // Match the generation pubkey - filter.insert(ParseHex("03c5da583f3ee0da22004d314b45e6be77cace71778644260032e11bf981db2d42")); + // Match the generation pubkey (coinbase tx output scriptpubkey) + filter.insert(ParseHex("021046035a4c9cf071676bbb2cafdccf8cdc7b67af239132992273ad53b3c23488")); // ...and the output address of the 4th transaction - filter.insert(ParseHex("72dd7e185c3f069223560a1df310c81d4d12804c")); + filter.insert(ParseHex("30271a250e92135ce0db0783ebb63aaeb58e47f9")); CMerkleBlock merkleBlock(block, filter); BOOST_CHECK(merkleBlock.header.GetHash() == block.GetHash()); - // We should match the generation outpoint - BOOST_CHECK(filter.contains(COutPoint(uint256S("0xdebdc61ca196e4a84bb5eedf07600af651d8bf351b04b592243319286f064f80"), 0))); - // ... but not the 4th transaction's output (its not pay-2-pubkey) - BOOST_CHECK(!filter.contains(COutPoint(uint256S("0x8920162c922789d3e44a2c4a9321f1e1c7fd31c665083bf2728b60ea6925140c"), 0))); + // We should match the generation outpoint (coinbase tx txid) + BOOST_CHECK(filter.contains(COutPoint(uint256S("0x760d72ad023855ab213b2be97844b8e56be314510f619a7d647a6ec541f724c3"), 0))); + // ... but not the 4th transaction's output (its not pay-2-pubkey) (the 4th tx's txid) + BOOST_CHECK(!filter.contains(COutPoint(uint256S("d2f48bd2d3ec3679f2af0c79e2ad292fb84987f521704ef10bb9de8e1c50e687"), 0))); } BOOST_AUTO_TEST_CASE(merkle_block_4_test_update_none) { - // Random real block (000000000000b731f2eef9e8c63173adfb07e41bd53eb0ef0a6b720d6cb6dea4) + // Regtest zcash block 0c54eb9bf064c28342e030e940364b1379b0a63a81434d0bbc0246f8ebc1112d // With 7 txes CBlock block; - CDataStream stream(ParseHex("0100000082bb869cf3a793432a66e826e05a6fc37469f8efb7421dc880670100000000007f16c5962e8bd963659c793ce370d95f093bc7e367117b3c30c1f8fdd0d9728776381b4d4c86041b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000554b8529000701000000010000000000000000000000000000000000000000000000000000000000000000ffffffff07044c86041b0136ffffffff0100f2052a01000000434104eaafc2314def4ca98ac970241bcab022b9c1e1f4ea423a20f134c876f2c01ec0f0dd5b2e86e7168cefe0d81113c3807420ce13ad1357231a2252247d97a46a91ac000000000100000001bcad20a6a29827d1424f08989255120bf7f3e9e3cdaaa6bb31b0737fe048724300000000494830450220356e834b046cadc0f8ebb5a8a017b02de59c86305403dad52cd77b55af062ea10221009253cd6c119d4729b77c978e1e2aa19f5ea6e0e52b3f16e32fa608cd5bab753901ffffffff02008d380c010000001976a9142b4b8072ecbba129b6453c63e129e643207249ca88ac0065cd1d000000001976a9141b8dd13b994bcfc787b32aeadf58ccb3615cbd5488ac000000000100000003fdacf9b3eb077412e7a968d2e4f11b9a9dee312d666187ed77ee7d26af16cb0b000000008c493046022100ea1608e70911ca0de5af51ba57ad23b9a51db8d28f82c53563c56a05c20f5a87022100a8bdc8b4a8acc8634c6b420410150775eb7f2474f5615f7fccd65af30f310fbf01410465fdf49e29b06b9a1582287b6279014f834edc317695d125ef623c1cc3aaece245bd69fcad7508666e9c74a49dc9056d5fc14338ef38118dc4afae5fe2c585caffffffff309e1913634ecb50f3c4f83e96e70b2df071b497b8973a3e75429df397b5af83000000004948304502202bdb79c596a9ffc24e96f4386199aba386e9bc7b6071516e2b51dda942b3a1ed022100c53a857e76b724fc14d45311eac5019650d415c3abb5428f3aae16d8e69bec2301ffffffff2089e33491695080c9edc18a428f7d834db5b6d372df13ce2b1b0e0cbcb1e6c10000000049483045022100d4ce67c5896ee251c810ac1ff9ceccd328b497c8f553ab6e08431e7d40bad6b5022033119c0c2b7d792d31f1187779c7bd95aefd93d90a715586d73801d9b47471c601ffffffff0100714460030000001976a914c7b55141d097ea5df7a0ed330cf794376e53ec8d88ac0000000001000000045bf0e214aa4069a3e792ecee1e1bf0c1d397cde8dd08138f4b72a00681743447000000008b48304502200c45de8c4f3e2c1821f2fc878cba97b1e6f8807d94930713aa1c86a67b9bf1e40221008581abfef2e30f957815fc89978423746b2086375ca8ecf359c85c2a5b7c88ad01410462bb73f76ca0994fcb8b4271e6fb7561f5c0f9ca0cf6485261c4a0dc894f4ab844c6cdfb97cd0b60ffb5018ffd6238f4d87270efb1d3ae37079b794a92d7ec95ffffffffd669f7d7958d40fc59d2253d88e0f248e29b599c80bbcec344a83dda5f9aa72c000000008a473044022078124c8beeaa825f9e0b30bff96e564dd859432f2d0cb3b72d3d5d93d38d7e930220691d233b6c0f995be5acb03d70a7f7a65b6bc9bdd426260f38a1346669507a3601410462bb73f76ca0994fcb8b4271e6fb7561f5c0f9ca0cf6485261c4a0dc894f4ab844c6cdfb97cd0b60ffb5018ffd6238f4d87270efb1d3ae37079b794a92d7ec95fffffffff878af0d93f5229a68166cf051fd372bb7a537232946e0a46f53636b4dafdaa4000000008c493046022100c717d1714551663f69c3c5759bdbb3a0fcd3fab023abc0e522fe6440de35d8290221008d9cbe25bffc44af2b18e81c58eb37293fd7fe1c2e7b46fc37ee8c96c50ab1e201410462bb73f76ca0994fcb8b4271e6fb7561f5c0f9ca0cf6485261c4a0dc894f4ab844c6cdfb97cd0b60ffb5018ffd6238f4d87270efb1d3ae37079b794a92d7ec95ffffffff27f2b668859cd7f2f894aa0fd2d9e60963bcd07c88973f425f999b8cbfd7a1e2000000008c493046022100e00847147cbf517bcc2f502f3ddc6d284358d102ed20d47a8aa788a62f0db780022100d17b2d6fa84dcaf1c95d88d7e7c30385aecf415588d749afd3ec81f6022cecd701410462bb73f76ca0994fcb8b4271e6fb7561f5c0f9ca0cf6485261c4a0dc894f4ab844c6cdfb97cd0b60ffb5018ffd6238f4d87270efb1d3ae37079b794a92d7ec95ffffffff0100c817a8040000001976a914b6efd80d99179f4f4ff6f4dd0a007d018c385d2188ac000000000100000001834537b2f1ce8ef9373a258e10545ce5a50b758df616cd4356e0032554ebd3c4000000008b483045022100e68f422dd7c34fdce11eeb4509ddae38201773dd62f284e8aa9d96f85099d0b002202243bd399ff96b649a0fad05fa759d6a882f0af8c90cf7632c2840c29070aec20141045e58067e815c2f464c6a2a15f987758374203895710c2d452442e28496ff38ba8f5fd901dc20e29e88477167fe4fc299bf818fd0d9e1632d467b2a3d9503b1aaffffffff0280d7e636030000001976a914f34c3e10eb387efe872acb614c89e78bfca7815d88ac404b4c00000000001976a914a84e272933aaf87e1715d7786c51dfaeb5b65a6f88ac00000000010000000143ac81c8e6f6ef307dfe17f3d906d999e23e0189fda838c5510d850927e03ae7000000008c4930460221009c87c344760a64cb8ae6685a3eec2c1ac1bed5b88c87de51acd0e124f266c16602210082d07c037359c3a257b5c63ebd90f5a5edf97b2ac1c434b08ca998839f346dd40141040ba7e521fa7946d12edbb1d1e95a15c34bd4398195e86433c92b431cd315f455fe30032ede69cad9d1e1ed6c3c4ec0dbfced53438c625462afb792dcb098544bffffffff0240420f00000000001976a9144676d1b820d63ec272f1900d59d43bc6463d96f888ac40420f00000000001976a914648d04341d00d7968b3405c034adc38d4d8fb9bd88ac00000000010000000248cc917501ea5c55f4a8d2009c0567c40cfe037c2e71af017d0a452ff705e3f1000000008b483045022100bf5fdc86dc5f08a5d5c8e43a8c9d5b1ed8c65562e280007b52b133021acd9acc02205e325d613e555f772802bf413d36ba807892ed1a690a77811d3033b3de226e0a01410429fa713b124484cb2bd7b5557b2c0b9df7b2b1fee61825eadc5ae6c37a9920d38bfccdc7dc3cb0c47d7b173dbc9db8d37db0a33ae487982c59c6f8606e9d1791ffffffff41ed70551dd7e841883ab8f0b16bf04176b7d1480e4f0af9f3d4c3595768d068000000008b4830450221008513ad65187b903aed1102d1d0c47688127658c51106753fed0151ce9c16b80902201432b9ebcb87bd04ceb2de66035fbbaf4bf8b00d1cfe41f1a1f7338f9ad79d210141049d4cf80125bf50be1709f718c07ad15d0fc612b7da1f5570dddc35f2a352f0f27c978b06820edca9ef982c35fda2d255afba340068c5035552368bc7200c1488ffffffff0100093d00000000001976a9148edb68822f1ad580b043c7b3df2e400f8699eb4888ac00000000"), SER_NETWORK, PROTOCOL_VERSION); + CDataStream stream(ParseHex("04000000e1bf965fddae55b8e781877a939425f839e788959f9fbc72b81aef757848d1558f8f11f4bedfde1217f4b6f96fc9a91d0331386d0e01ea98eeccf03f9a6b35d50000000000000000000000000000000000000000000000000000000000000000005d9857feff7f200100e93d380bd116212dfc1d41e78e4df3d32d275d00d4f79808bbb884d30000201b00000051010000c1000000a1010000650000007a01000099000000b101000056000000700100008d0000007e01000076000000f70100009b010000fe010000260000000a0100008b000000430100002900000093010000a5000000d20000002a000000970000005e0000004601000080000000010100008c000000e70000000701000000010000000000000000000000000000000000000000000000000000000000000000ffffffff04011a0101ffffffff0283f19a3b00000000232102ce609e4c9c1ce8c86b5732cc71879d93d57bdcd78082cffb77bfa5c24c10dc50ac80b2e60e0000000017a9146708e6670db0b950dac68031025cc5b63213a49187000000000100000001c23c131d2130af5157aac9b378b5a2af8e02d6e9be91f2b3cb770731a62e698f000000004847304402204a0b8d78f2ab6b2c91e7e532c2344b064c13e3c198bb8c9e2613f796d028cb8b022040b8ad89ac9e7fa7b803dfe361f8af3681e89246f5f97aa6f5b49555d1f5ab7801feffffff02403f0738000000001976a91447568c26a8bdfa77a9253ed2036724f0b2c1fe5f88ac00879303000000001976a914640bac400ad1fecc1391b6f1536924a28e61907d88ac0f0000000100000001824d5f206ecb4d82fe4e7a3a10fe0b4186b0111298529d6d705a9bf56441a66d00000000494830450221009e1b7e896bdea8592040a9b2d40060b5c7440ff8adbe6fe2ce4a9ef003771058022013ef290a725f44147fb01c083ba7b7997f4c2675bdeccc107784cfc86b0f800b01feffffff0280969800000000001976a914640bac400ad1fecc1391b6f1536924a28e61907d88acc02f023b000000001976a914a6e9f40a37e4f1bc0f196cc8b8ee387e936e934488ac0f00000001000000017453c9e5a088cb04e40ef59abd459156da3288998b82589ee888c556f74573a4000000006a473044022036be899b55d10fbef581a392a813c9ea25fdbfa577d1e8d8b50c91a39b3d2d050220208f3356f8c599e62486fa67f300629aabba8a9c57a1feb63cfcf8d0197c97620121033506b92281f803dcfab4aedad1cbc4d0617499c55bda8a8704eb1add18e89235feffffff0296252939000000001976a914abc8feb974411a2307badee01e384641d49c186488ac005a6202000000001976a914640bac400ad1fecc1391b6f1536924a28e61907d88ac0f0000000100000006ef2f1a8d0ab669daa867c61aaa5446587c685a0a29933a29e3f68947ac9c31ff000000006a473044022069b9dc8e8321b51701f0e4ad74715e9a1928e7b4925d66eb060bcf7674092d1a0220417a26ed0e01c2167cbabfc5dec1a50099d77c666ae04cb3ccd493355830f802012102afe67a769ff6a19f6a227b05d7e1a6b0a2e6851481c8c92f232979d33bb2bc0cfeffffffef2f1a8d0ab669daa867c61aaa5446587c685a0a29933a29e3f68947ac9c31ff010000006a473044022078ba511e4c3bd22c66104d4380f553af4a318438da50340fa85e1bb7781a98d3022076022f343a883617be8b84c51127d081d9f533381108343abcc71546b9f05579012102498e387bed66f7ccd4a039208a46ea3e04680501b7a9c574df38bb2f172cbe0ffeffffff22e2702586c53ab876e350837d537cfbe2eda625e90c56bc6ac402e1ba2638cc010000006b483045022100e7e385d8cc3abd1f4d9d2bb2ee53ec75f1cc3aefdaae2e8fb2260d64b52ef2700220155ee4eb5352df0ecf6477ec39588da85983d17b07f8687878727acea9137617012102afe67a769ff6a19f6a227b05d7e1a6b0a2e6851481c8c92f232979d33bb2bc0cfefffffffadfa336902f2ccd2b79b7816e04e38188967b39ee7568a661225dcd81a20fc1000000006a4730440220166afc981f529ec240a9c76fd1a13f5266b49462c0d3b28370aa81f34f9de3d90220062b0579b6bae54b03e2606e3fc2c493a6b827884fe6b609e7871ee808675ca8012102afe67a769ff6a19f6a227b05d7e1a6b0a2e6851481c8c92f232979d33bb2bc0cfefffffffadfa336902f2ccd2b79b7816e04e38188967b39ee7568a661225dcd81a20fc1010000006a4730440220619df55063805d43bc046f710db900fbfe28ac5194aa3ad377a88765e119460a02205407f3f8272469fad59b0ab2b00c5c373aa35ccf0411040d977b58db9f39fea6012103322175384bd15072c75bc7c1bc0fa5e5595895cb3b8fd179b2b24746b673f5f6feffffff87e6501c8edeb90bf14e7021f58749b82f29ade2790caff27936ecd3d28bf4d2010000006a47304402204b84bf98244adb41dd739285513bcf50007875021257a821f9ae57991eb12cd102203fde9f5076f8dbf65ada8fc1e5ab46df3dba8d7621664cea3b84688a3a4b85d2012102afe67a769ff6a19f6a227b05d7e1a6b0a2e6851481c8c92f232979d33bb2bc0cfeffffff02fe651e00000000001976a91441ec7511554c71640aea061e628067f3db3aafd088ac002d3101000000001976a914640bac400ad1fecc1391b6f1536924a28e61907d88ac0f000000010000000122e2702586c53ab876e350837d537cfbe2eda625e90c56bc6ac402e1ba2638cc000000006a4730440220054c70db6a2433e3d94a43f5f198a05eca9b44b4f0763ae78b5bc70b08d52eb10220103062e40bfbd270117b5cca182098d143fedb44b572df912fe04798afba409e012102343107eef41bde463901d99c3011c9be972c9077a0c4c5897bb63eda936f8c74feffffff0287296639000000001976a914fe850141a91ae3eb661d8f425284ba2e3a03af2188ac80c3c901000000001976a914640bac400ad1fecc1391b6f1536924a28e61907d88ac0f000000010000000187e6501c8edeb90bf14e7021f58749b82f29ade2790caff27936ecd3d28bf4d2000000006b48304502210081c47f61994bc0999a2bbaefb7ebf625421793025e981564cf50dfa517791960022037d28ed35e2764ab8a5f579c5cfc7eb66dc246aebcb312f683baa82f49f6e492012102fe844d4520021d8f54985995fd57565139ee832b47dcec52106dbcdd928acf6efeffffff02c2d44037000000001976a914236bffa399b69dadbbbe662b59f3ca16327d68b288ac80f0fa02000000001976a914640bac400ad1fecc1391b6f1536924a28e61907d88ac0f000000"), SER_NETWORK, PROTOCOL_VERSION); stream >> block; CBloomFilter filter(10, 0.000001, 0, BLOOM_UPDATE_NONE); - // Match the generation pubkey - filter.insert(ParseHex("04eaafc2314def4ca98ac970241bcab022b9c1e1f4ea423a20f134c876f2c01ec0f0dd5b2e86e7168cefe0d81113c3807420ce13ad1357231a2252247d97a46a91")); + // Match the generation pubkey (coinbase tx output script) + filter.insert(ParseHex("02ce609e4c9c1ce8c86b5732cc71879d93d57bdcd78082cffb77bfa5c24c10dc50")); // ...and the output address of the 4th transaction - filter.insert(ParseHex("b6efd80d99179f4f4ff6f4dd0a007d018c385d21")); + filter.insert(ParseHex("640bac400ad1fecc1391b6f1536924a28e61907d")); CMerkleBlock merkleBlock(block, filter); BOOST_CHECK(merkleBlock.header.GetHash() == block.GetHash()); // We shouldn't match any outpoints (UPDATE_NONE) - BOOST_CHECK(!filter.contains(COutPoint(uint256S("0x147caa76786596590baa4e98f5d9f48b86c7765e489f7a6ff3360fe5c674360b"), 0))); - BOOST_CHECK(!filter.contains(COutPoint(uint256S("0x02981fa052f0481dbc5868f4fc2166035a10f27a03cfd2de67326471df5bc041"), 0))); + BOOST_CHECK(!filter.contains(COutPoint(uint256S("0xc234ca41d97fc9da0312899aedff68d71d02dfb0533af97992868772030f028f"), 0))); + BOOST_CHECK(!filter.contains(COutPoint(uint256S("0x2551b7b6108a633db54c3df7aff09295561fcc2b5b0438b602e5c17deb1d128e"), 0))); } static std::vector RandomData() diff --git a/src/test/data/script_invalid.json b/src/test/data/script_invalid.json index eb3fb4a1c..965be7251 100644 --- a/src/test/data/script_invalid.json +++ b/src/test/data/script_invalid.json @@ -534,97 +534,97 @@ ["Automatically generated test cases"], [ - "0x47 0x3044022028704302bdbc0851b707a947fc76b0bc833fe73d105f6b65917993b6ba739052022056e4d465960125cd226963137b93c31e5831af98f3250bacae1245fa882f837801", + "0x47 0x304402200a5c6163f07b8c3b013c4d1d6dba25e780b39658d79ba37af7057a3b7f15ffa102201fd9b4eaa9943f734928b99a83592c2e7bf342ea2680f6a2bb705167966b742001", "0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG", "", "P2PK, bad sig" ], [ - "0x47 0x304402202a5d85a6578cd4fb1d64679f789407858031de1ae379d5c7f585e4d24cd8aaea02204f42378166158cf4b7c55f32b414e66ea393e00ac8bf08bf419bfa3d4b3bfa8c01 0x21 0x03363d90d446b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640", + "0x47 0x3044022034bb0494b50b8ef130e2185bb220265b9284ef5b4b8a8da4d8415df489c83b5102206259a26d9cc0a125ac26af6153b17c02956855ebe1467412f066e402f5f05d1201 0x21 0x03363d90d446b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640", "DUP HASH160 0x14 0xc0834c0c158f53be706d234c38fd52de7eece656 EQUALVERIFY CHECKSIG", "", "P2PKH, bad pubkey" ], [ - "0x47 0x304402200e963b830cc61b8e80915c2c72dad1358807d33554daf114fa5859f2a741c006022000a81f1c8e223c5a459ff99addf9e04ae5492181ec8e947fc6f49c315e49570e01", + "0x47 0x304402204710a85181663b32d25c70ec2bbd14adff5ddfff6cb50d09e155ef5f541fc86c0220056b0cc949be9386ecc5f6c2ac0493269031dbb185781db90171b54ac127790201", "0x41 0x048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf CHECKSIG", "", "P2PK anyonecanpay marked with normal hashtype" ], [ - "0x47 0x3044022039e3b7051329e12e23ec00f9ae70c1e317beb718da52e7988776d44b4911173702200fb94de60deb6d6a440fc119f00127e731cdbe5760aa7fffdbf5f3da2d07569801 0x23 0x210279be667ef9dcbbac54a06295ce870b07029bfcdb2dce28d959f2815b16f81798ac", + "0x47 0x3044022003fef42ed6c7be8917441218f525a60e2431be978e28b7aca4d7a532cc413ae8022067a1f82c74e8d69291b90d148778405c6257bbcfc2353cc38a3e1f22bf44254601 0x23 0x210279be667ef9dcbbac54a06295ce870b07029bfcdb2dce28d959f2815b16f81798ac", "HASH160 0x14 0x23b0ad3477f2178bc0b3eed26e4e6316f4e83aa1 EQUAL", "P2SH", "P2SH(P2PK), bad redeemscript" ], [ - "0x47 0x30440220555e138776dbd4d7592df35989d8265858b0137b54118d700edb9cf83d42ec660220224f766b9956b380ea8f853a6832bf14bcd42514159080dd90f21d27cbe61d1201 0x19 0x76a9147cf9c846cd4882efec4bf07e44ebdad495c94f4b88ac", + "0x47 0x304402204e2eb034be7b089534ac9e798cf6a2c79f38bcb34d1b179efd6f2de0841735db022071461beb056b5a7be1819da6a3e3ce3662831ecc298419ca101eb6887b5dd6a401 0x19 0x76a9147cf9c846cd4882efec4bf07e44ebdad495c94f4b88ac", "HASH160 0x14 0x2df519943d5acc0ef5222091f9dfe3543f489a82 EQUAL", "P2SH", "P2SH(P2PKH), bad sig" ], [ - "0 0x47 0x3044022019fa79ee8642d75cc7f89ee4c05610308363c25d459be356d333f5dd276548780220192af34c8fcd2d116c1a3cac43bebc9439de0e3435c3b5c946b7b0c6098a9ab701 0x47 0x304402203f967505faa2f69e3482e63d0c59f6e4b06599f59e7df9558bbb5f976cc190250220572c2a827b6a2ace87475acdc00bfbc4442ecaf6b4f54c489b0a5bd0ffc36d1d01 0", + "0 0x47 0x3044022051254b9fb476a52d85530792b578f86fea70ec1ffb4393e661bcccb23d8d63d3022076505f94a403c86097841944e044c70c2045ce90e36de51f7e9d3828db98a07501 0x47 0x304402200a358f750934b3feb822f1966bfcd8bbec9eeaa3a8ca941e11ee5960e181fa01022050bf6b5a8e7750f70354ae041cb68a7bade67ec6c3ab19eb359638974410626e01 0", "3 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 3 CHECKMULTISIG", "", "3-of-3, 2 sigs" ], [ - "0 0x47 0x304402201c9f6e207f988e12d688c215fa2f754436cf85a097257cbbb2b5c8ac5e770b2d0220665f8265a950d896cc613194970c89a49c94d1aa8e736ff8dacbe0af8f33a53401 0 0x4c69 0x52210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f8179821038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f515082103363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff464053ae", + "0 0x47 0x304402205b7d2c2f177ae76cfbbf14d589c113b0b35db753d305d5562dd0b61cbf366cfb02202e56f93c4f08a27f986cd424ffc48a462c3202c4902104d4d0ff98ed28f4bf8001 0 0x4c69 0x52210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f8179821038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f515082103363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff464053ae", "HASH160 0x14 0xc9e4a896d149702d0d1695434feddd52e24ad78d EQUAL", "P2SH", "P2SH(2-of-3), 1 sig" ], [ - "0x47 0x30440220000a55d0ce61b3e392a2f6d7331021b26472489174bb8c2ad8cb6725d3bfeda2022060087e93b5083d99b6a11584d71357e19e251f689715226b2e154817259dde1b01", + "0x47 0x304402200060558477337b9022e70534f1fea71a318caf836812465a2509931c5e7c4987022078ec32bd50ac9e03a349ba953dfd9fe1c8d2dd8bdb1d38ddca844d3d5c78c11801", "0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG", "DERSIG", "P2PK with too much R padding" ], [ - "0x48 0x3045022030e7ea75f00a73608db820ba645a066e3fccf09dbb315a0a1d7e8773afcb9ab7022100505fea7b5dc292a43e8d1e6468bdd6c3269012cd05106be015ea14ca7cb4bba401", + "0x48 0x304502202de8c03fc525285c9c535631019a5f2af7c6454fa9eb392a3756a4917c420edd02210046130bf2baf7cfc065067c8b9e33a066d9c15edcea9feb0ca2d233e3597925b401", "0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG", "DERSIG", "P2PK with too much S padding" ], [ - "0x47 0x30440220f392c3fc0b257a8d6ad64a070c40ddd11a0f8f4ecc8e05f6719a2934900e71df0220139e1bf8052713895cda2f843dde585abc05a7f07d4931dd5c1dbb8c7d94909101", + "0x47 0x30440220d7a0417c3f6d1a15094d1cf2a3378ca0503eb8a57630953a9e2987e21ddd0a6502207a6266d686c99090920249991d3d42065b6d43eb70187b219c0db82e4f94d1a201", "0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG", "DERSIG", "P2PK with too little R padding" ], [ - "0x47 0x304402200052768d9f59125f9006926e19f464692107c21b3e6d4d020ddf957b4f115f770220629111f4f57822dc77d355586921daf39020353752dbd4b4d0ed161964b1255401", + "0x47 0x30440220005ece1335e7f757a1a1f476a7fb5bd90964e8a022489f890614a04acfb734c002206c12b8294a6513c7710e8c82d3c23d75cdbfe83200eb7efb495701958501a5d601", "0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 CHECKSIG NOT", "DERSIG", "P2PK NOT with bad sig with too much R padding" ], [ - "0x47 0x304402200052768d9f59135f9006926e19f464692107c21b3e6d4d020ddf957b4f115f770220629111f4f57822dc77d355586921daf39020353752dbd4b4d0ed161964b1255401", + "0x47 0x30440220005ece1335e7f657a1a1f476a7fb5bd90964e8a022489f890614a04acfb734c002206c12b8294a6513c7710e8c82d3c23d75cdbfe83200eb7efb495701958501a5d601", "0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 CHECKSIG NOT", "", "P2PK NOT with too much R padding but no DERSIG" ], [ - "0x47 0x304402200052768d9f59135f9006926e19f464692107c21b3e6d4d020ddf957b4f115f770220629111f4f57822dc77d355586921daf39020353752dbd4b4d0ed161964b1255401", + "0x47 0x30440220005ece1335e7f657a1a1f476a7fb5bd90964e8a022489f890614a04acfb734c002206c12b8294a6513c7710e8c82d3c23d75cdbfe83200eb7efb495701958501a5d601", "0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 CHECKSIG NOT", "DERSIG", "P2PK NOT with too much R padding" ], [ - "0x47 0x30440220f392c3fc0b257a8d6ad64a070c40ddd11a0f8f4ecc8e05f6719a2934900e71df0220139e1bf8052713895cda2f843dde585abc05a7f07d4931dd5c1dbb8c7d94909101", + "0x47 0x30440220d7a0417c3f6d1a15094d1cf2a3378ca0503eb8a57630953a9e2987e21ddd0a6502207a6266d686c99090920249991d3d42065b6d43eb70187b219c0db82e4f94d1a201", "0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG", "DERSIG", "BIP66 example 1, with DERSIG" ], [ - "0x47 0x30440220cbeef9619105f2f7b4915edc6be74b21581c580358c8db05af4eb55c999c0aa1022047a1c5a5fa8dcb18da7535aa37c75671847042449fb708e3fd2c85a7a874c07401", + "0x47 0x304402208e43c0b91f7c1e5bc58e41c8185f8a6086e111b0090187968a86f2822462d3c902200a58f4076b1133b18ff1dc83ee51676e44c60cc608d9534e0df5ace0424fc0be01", "0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG NOT", "", "BIP66 example 2, without DERSIG" ], [ - "0x47 0x30440220cbeef9619105f2f7b4915edc6be74b21581c580358c8db05af4eb55c999c0aa1022047a1c5a5fa8dcb18da7535aa37c75671847042449fb708e3fd2c85a7a874c07401", + "0x47 0x304402208e43c0b91f7c1e5bc58e41c8185f8a6086e111b0090187968a86f2822462d3c902200a58f4076b1133b18ff1dc83ee51676e44c60cc608d9534e0df5ace0424fc0be01", "0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG NOT", "DERSIG", "BIP66 example 2, with DERSIG" @@ -660,145 +660,145 @@ "BIP66 example 6, with DERSIG" ], [ - "0 0x47 0x30440220959b3fa55bcbc510291af8f090ba5a17ee308f733f471bb382b8a23988a7d0500220770e10f776857775a4cc544718e1f3ce50521cfcafebf8936ffacb7b6284629e01 0x47 0x304402206ef1151dc2c72e3f57dc9185d5755808367fb57c2c65c8df55d82e6d8e89b6f8022050dff5f4a6055b9b26640f9fcdb05290d7d82008ab934b126cae78abdc2f2a2001", + "0 0x47 0x30440220cae00b1444babfbf6071b0ba8707f6bd373da3df494d6e74119b0430c5db810502205d5231b8c5939c8ff0c82242656d6e06edb073d42af336c99fe8837c36ea39d501 0x47 0x3044022027c2714269ca5aeecc4d70edc88ba5ee0e3da4986e9216028f489ab4f1b8efce022022bd545b4951215267e4c5ceabd4c5350331b2e4a0b6494c56f361fa5a57a1a201", "2 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 2 CHECKMULTISIG", "DERSIG", "BIP66 example 7, with DERSIG" ], [ - "0 0x47 0x30440220ef225ea223236e01fd726d26d69fcb40b39df836cde25881e11848b80714d6c002205d7d8e091fc16a0d5e8b4785312466c5e8080b862534f94a9c70f24ac0ff496c01 0x47 0x304402206dbb0c04f6c25a99926ee88d7efa8090b5214291d08e3c04fabf631df2d4f191022023e7a95e76fd196bbf36407222995976f0c3fcb2c15f44b4e141f3289d54991d01", + "0 0x47 0x30440220b119d67d389315308d1745f734a51ff3ec72e06081e84e236fdf9dc2f5d2a64802204b04e3bc38674c4422ea317231d642b56dc09d214a1ecbbf16ecca01ed996e2201 0x47 0x3044022079ea80afd538d9ada421b5101febeb6bc874e01dde5bca108c1d0479aec339a4022004576db8f66130d1df686ccf00935703689d69cf539438da1edab208b0d63c4801", "2 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 2 CHECKMULTISIG NOT", "", "BIP66 example 8, without DERSIG" ], [ - "0 0x47 0x30440220ef225ea223236e01fd726d26d69fcb40b39df836cde25881e11848b80714d6c002205d7d8e091fc16a0d5e8b4785312466c5e8080b862534f94a9c70f24ac0ff496c01 0x47 0x304402206dbb0c04f6c25a99926ee88d7efa8090b5214291d08e3c04fabf631df2d4f191022023e7a95e76fd196bbf36407222995976f0c3fcb2c15f44b4e141f3289d54991d01", + "0 0x47 0x30440220b119d67d389315308d1745f734a51ff3ec72e06081e84e236fdf9dc2f5d2a64802204b04e3bc38674c4422ea317231d642b56dc09d214a1ecbbf16ecca01ed996e2201 0x47 0x3044022079ea80afd538d9ada421b5101febeb6bc874e01dde5bca108c1d0479aec339a4022004576db8f66130d1df686ccf00935703689d69cf539438da1edab208b0d63c4801", "2 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 2 CHECKMULTISIG NOT", "DERSIG", "BIP66 example 8, with DERSIG" ], [ - "0 0 0x47 0x304402208bbf6eaf54a87a4445ca13d4448ad418295cf287ba600acfd296298da1993d740220090882b857284d80ab6707b455a3296552535df8e35d10c0a3914b50a078775501", + "0 0 0x47 0x3044022081aa9d436f2154e8b6d600516db03d78de71df685b585a9807ead4210bd883490220534bb6bdf318a419ac0749660b60e78d17d515558ef369bf872eff405b676b2e01", "2 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 2 CHECKMULTISIG", "", "BIP66 example 9, without DERSIG" ], [ - "0 0 0x47 0x304402208bbf6eaf54a87a4445ca13d4448ad418295cf287ba600acfd296298da1993d740220090882b857284d80ab6707b455a3296552535df8e35d10c0a3914b50a078775501", + "0 0 0x47 0x3044022081aa9d436f2154e8b6d600516db03d78de71df685b585a9807ead4210bd883490220534bb6bdf318a419ac0749660b60e78d17d515558ef369bf872eff405b676b2e01", "2 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 2 CHECKMULTISIG", "DERSIG", "BIP66 example 9, with DERSIG" ], [ - "0 0 0x47 0x30440220baaa8a49e8a96778a462eb8f2eae31ccb544e432b34662a5602ece12f20bf64f022007019c21e05b796e87b4b56e82903aae79e8efec190d4d834a551a406118b64601", + "0 0 0x47 0x30440220da6f441dc3b4b2c84cfa8db0cd5b34ed92c9e01686de5a800d40498b70c0dcac02207c2cf91b0c32b860c4cd4994be36cfb84caf8bb7c3a8e4d96a31b2022c5299c501", "2 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 2 CHECKMULTISIG NOT", "DERSIG", "BIP66 example 10, with DERSIG" ], [ - "0 0x47 0x30440220959b3fa55bcbc510291af8f090ba5a17ee308f733f471bb382b8a23988a7d0500220770e10f776857775a4cc544718e1f3ce50521cfcafebf8936ffacb7b6284629e01 0", + "0 0x47 0x30440220cae00b1444babfbf6071b0ba8707f6bd373da3df494d6e74119b0430c5db810502205d5231b8c5939c8ff0c82242656d6e06edb073d42af336c99fe8837c36ea39d501 0", "2 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 2 CHECKMULTISIG", "", "BIP66 example 11, without DERSIG" ], [ - "0 0x47 0x30440220959b3fa55bcbc510291af8f090ba5a17ee308f733f471bb382b8a23988a7d0500220770e10f776857775a4cc544718e1f3ce50521cfcafebf8936ffacb7b6284629e01 0", + "0 0x47 0x30440220cae00b1444babfbf6071b0ba8707f6bd373da3df494d6e74119b0430c5db810502205d5231b8c5939c8ff0c82242656d6e06edb073d42af336c99fe8837c36ea39d501 0", "2 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 2 CHECKMULTISIG", "DERSIG", "BIP66 example 11, with DERSIG" ], [ - "0x48 0x3044022012918460459bc14fc7bd7d5050455b7d71444f48c5890381123fc46ddaf83d3a02202f83c59b73dedc29510acb4f7cce6de9c664e6e606d9a821a422e3e058ec95e80101", + "0x48 0x304402203e4516da7253cf068effec6b95c41221c0cf3a8e6ccb8cbf1725b562e9afde2c022054e1c258c2981cdfba5df1f46661fb6541c44f77ca0092f3600331abfffb12510101", "0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 CHECKSIG", "DERSIG", "P2PK with multi-byte hashtype, with DERSIG" ], [ - "0x48 0x3045022012918460459bc14fc7bd7d5050455b7d71444f48c5890381123fc46ddaf83d3a022100d07c3a648c2123d6aef534b083319214f449f600a86ef81a1baf7aac7749ab5901", + "0x48 0x304502203e4516da7253cf068effec6b95c41221c0cf3a8e6ccb8cbf1725b562e9afde2c022100ab1e3da73d67e32045a20e0b999e049978ea8d6ee5480d485fcf2ce0d03b2ef001", "0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 CHECKSIG", "LOW_S", "P2PK with high S" ], [ - "0x47 0x3044022028ad19793d4abe04bc99c64523dcd06cb7fb6b9a8eb9b692489f02ba2ca51b4a02201ce5c56dcde293e8e3c011521e3f82ac27fdb5862df09077d002be95ea84841f01", + "0x47 0x3044022057292e2d4dfe775becdd0a9e6547997c728cdf35390f6a017da56d654d374e4902206b643be2fc53763b4e284845bfea2c597d2dc7759941dce937636c9d341b71ed01", "0x41 0x0679be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG", "STRICTENC", "P2PK with hybrid pubkey" ], [ - "0x47 0x304402207a7c44917eff93b8597bf3e5c7abaa01bba9183d926455b394d87a4897d1dac00220339e270e534ecaabbd3e49e59393e7c00b6b8558c29aa6f14aa6c6277c5e244d01", + "0x47 0x30440220035d554e3153c14950c9993f41c496607a8e24093db0595be7bf875cf64fcf1f02204731c8c4e5daf15e706cec19cdd8f2c5b1d05490e11dab8465ed426569b6e92101", "0x41 0x0679be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG NOT", "", "P2PK NOT with hybrid pubkey but no STRICTENC" ], [ - "0x47 0x304402207a7c44917eff93b8597bf3e5c7abaa01bba9183d926455b394d87a4897d1dac00220339e270e534ecaabbd3e49e59393e7c00b6b8558c29aa6f14aa6c6277c5e244d01", + "0x47 0x30440220035d554e3153c14950c9993f41c496607a8e24093db0595be7bf875cf64fcf1f02204731c8c4e5daf15e706cec19cdd8f2c5b1d05490e11dab8465ed426569b6e92101", "0x41 0x0679be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG NOT", "STRICTENC", "P2PK NOT with hybrid pubkey" ], [ - "0x47 0x304402207a7c44917eff92b8597bf3e5c7abaa01bba9183d926455b394d87a4897d1dac00220339e270e534ecaabbd3e49e59393e7c00b6b8558c29aa6f14aa6c6277c5e244d01", + "0x47 0x30440220035d554e3153c04950c9993f41c496607a8e24093db0595be7bf875cf64fcf1f02204731c8c4e5daf15e706cec19cdd8f2c5b1d05490e11dab8465ed426569b6e92101", "0x41 0x0679be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG NOT", "STRICTENC", "P2PK NOT with invalid hybrid pubkey" ], [ - "0 0x47 0x304402201a117a26d2d47ad6d83be979810f76751485b05a881afb6a15318a1a020fd09502205d00caa1987524882193e44a0eda65bf2ef7aff482527f248a9a3919d030335601", + "0 0x47 0x3044022079c7824d6c868e0e1a273484e28c2654a27d043c8a27f49f52cb72efed0759090220452bbbf7089574fa082095a4fc1b3a16bafcf97a3a34d745fafc922cce66b27201", "1 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x41 0x0679be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 2 CHECKMULTISIG", "STRICTENC", "1-of-2 with the first 1 hybrid pubkey" ], [ - "0x47 0x30440220220c3ad143cafae0c3c5403270b0c392f5eeb869701130c6a9790f7f1ce8261d02201cbe777ad4e7998b4f78363497eaf8dd4166901daaeb9737ff2b1326b0451a5c05", + "0x47 0x304402206177d513ec2cda444c021a1f4f656fc4c72ba108ae063e157eb86dc3575784940220666fc66702815d0e5413bb9b1df22aed44f5f1efb8b99d41dd5dc9a5be6d205205", "0x41 0x048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf CHECKSIG", "STRICTENC", "P2PK with undefined hashtype" ], [ - "0x47 0x304402200213672d90b1b99738e6c98f4a0798235b9f726ce1d674d8163fe5dac51b099802203a43ecb279d89dece434dc8d2bbf2347ee4b66147540a2e545c57135fa8d525105", + "0x47 0x304402207409b5b320296e5e2136a7b281a7f803028ca4ca44e2b83eebd46932677725de02202d4eea1c8d3c98e6f42614f54764e6e5e6542e213eb4d079737e9a8b6e9812ec05", "0x41 0x048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf CHECKSIG NOT", "STRICTENC", "P2PK NOT with invalid sig and undefined hashtype" ], [ - "1 0x47 0x3044022019fa79ee8642d75cc7f89ee4c05610308363c25d459be356d333f5dd276548780220192af34c8fcd2d116c1a3cac43bebc9439de0e3435c3b5c946b7b0c6098a9ab701 0x47 0x304402203f967505faa2f69e3482e63d0c59f6e4b06599f59e7df9558bbb5f976cc190250220572c2a827b6a2ace87475acdc00bfbc4442ecaf6b4f54c489b0a5bd0ffc36d1d01 0x47 0x304402200400c0da6ef02d88af4d9ccdc97e5db3cd0e0f148024805089920c89742637af022040400714f61c99394f68422288b36399fa274561d9e6ca4d0f539cc680360f5d01", + "1 0x47 0x3044022051254b9fb476a52d85530792b578f86fea70ec1ffb4393e661bcccb23d8d63d3022076505f94a403c86097841944e044c70c2045ce90e36de51f7e9d3828db98a07501 0x47 0x304402200a358f750934b3feb822f1966bfcd8bbec9eeaa3a8ca941e11ee5960e181fa01022050bf6b5a8e7750f70354ae041cb68a7bade67ec6c3ab19eb359638974410626e01 0x47 0x304402200955d031fff71d8653221e85e36c3c85533d2312fc3045314b19650b7ae2f81002202a6bb8505e36201909d0921f01abff390ae6b7ff97bbf959f98aedeb0a56730901", "3 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 3 CHECKMULTISIG", "NULLDUMMY", "3-of-3 with nonzero dummy" ], [ - "1 0x47 0x304402205ed72cf70a97fbb41a7a75710a843e15f8646993d95209fabdca3a5da51e714102204354e061ba74c65761a2543e4943ecde19e26f84d8ea169f910c7d83cc79d10b01 0x47 0x3044022027a6e542a9b5cc18c81638e836c16da213f959a368cdec1de0a945df59ce84950220349a2e3f4f7eef8b64dc134168ae67ef4e42bb5151ab0e13656249c77278733c01 0x47 0x304402202b747c3dfc7bc63e9e22e40a721fe05cc6356f737c92a427ac77fbde950aa35e02207625f28d3cb4186c5a9d665b0040b8bc59ab2a451b46cb8aa9e8e4c4cadefa3001", + "1 0x47 0x304402201bb2edab700a5d020236df174fefed78087697143731f659bea59642c759c16d022061f42cdbae5bcd3e8790f20bf76687443436e94a634321c16a72aa54cbc7c2ea01 0x47 0x304402204bb4a64f2a6e5c7fb2f07fef85ee56fde5e6da234c6a984262307a20e99842d702206f8303aaba5e625d223897e2ffd3f88ef1bcffef55f38dc3768e5f2e94c923f901 0x47 0x3044022040c2809b71fffb155ec8b82fe7a27f666bd97f941207be4e14ade85a1249dd4d02204d56c85ec525dd18e29a0533d5ddf61b6b1bb32980c2f63edf951aebf7a27bfe01", "3 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 3 CHECKMULTISIG NOT", "NULLDUMMY", "3-of-3 NOT with invalid sig with nonzero dummy" ], [ - "0 0x47 0x3044022069335c200a859303ff1ab36c82aea0c0f71f8a841a5db2cd3b443d8ca98c395c02206afafd2571c690511ba64c26e7bb7ebef39967770f27fec0900e212f3992f1f201 DUP", + "0 0x47 0x304402200abeb4bd07f84222f474aed558cfbdfc0b4e96cde3c2935ba7098b1ff0bd74c302204a04c1ca67b2a20abee210cf9a21023edccbbf8024b988812634233115c6b73901 DUP", "2 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 2 CHECKMULTISIG", "SIGPUSHONLY", "2-of-2 with two identical keys and sigs pushed using OP_DUP" ], [ - "0x47 0x3044022012918460459bc14fc7bd7d5050455b7d71444f48c5890381123fc46ddaf83d3a02202f83c59b73dedc29510acb4f7cce6de9c664e6e606d9a821a422e3e058ec95e801 0x23 0x2103363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640ac", + "0x47 0x304402203e4516da7253cf068effec6b95c41221c0cf3a8e6ccb8cbf1725b562e9afde2c022054e1c258c2981cdfba5df1f46661fb6541c44f77ca0092f3600331abfffb125101 0x23 0x2103363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640ac", "0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 CHECKSIG", "", "P2SH(P2PK) with non-push scriptSig but no SIGPUSHONLY" ], [ - "0x47 0x3044022012918460459bc14fc7bd7d5050455b7d71444f48c5890381123fc46ddaf83d3a02202f83c59b73dedc29510acb4f7cce6de9c664e6e606d9a821a422e3e058ec95e801 0x23 0x2103363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640ac", + "0x47 0x304402203e4516da7253cf068effec6b95c41221c0cf3a8e6ccb8cbf1725b562e9afde2c022054e1c258c2981cdfba5df1f46661fb6541c44f77ca0092f3600331abfffb125101 0x23 0x2103363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640ac", "0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 CHECKSIG", "SIGPUSHONLY", "P2SH(P2PK) with non-push scriptSig" ], [ - "11 0x47 0x3044022028704302bdbc0951b707a947fc76b0bc833fe73d105f6b65917993b6ba739052022056e4d465960125cd226963137b93c31e5831af98f3250bacae1245fa882f837801", + "11 0x47 0x304402200a5c6163f07b8d3b013c4d1d6dba25e780b39658d79ba37af7057a3b7f15ffa102201fd9b4eaa9943f734928b99a83592c2e7bf342ea2680f6a2bb705167966b742001", "0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG", "CLEANSTACK,P2SH", "P2PK with unnecessary input" ], [ - "11 0x47 0x30440220785cd94c2ff5079a1423af355053c56c6a252f6806e3a6539f168709fbee533202203ba85578f85448a9ee4eb4c38e26b76367d992002eece1018273f043639ce06a01 0x43 0x410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8ac", + "11 0x47 0x304402202f7505132be14872581f35d74b759212d9da40482653f1ffa3116c3294a4a51702206adbf347a2240ca41c66522b1a22a41693610b76a8e7770645dc721d1635854f01 0x43 0x410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8ac", "HASH160 0x14 0x31edc23bdafda4639e669f89ad6b2318dd79d032 EQUAL", "CLEANSTACK,P2SH", "P2SH with unnecessary input" @@ -806,3 +806,4 @@ ["The End"] ] + diff --git a/src/test/data/script_valid.json b/src/test/data/script_valid.json index 6f3d4143e..0dd0b4cbe 100644 --- a/src/test/data/script_valid.json +++ b/src/test/data/script_valid.json @@ -703,73 +703,73 @@ ["Automatically generated test cases"], [ - "0x47 0x3044022028704302bdbc0951b707a947fc76b0bc833fe73d105f6b65917993b6ba739052022056e4d465960125cd226963137b93c31e5831af98f3250bacae1245fa882f837801", + "0x47 0x304402200a5c6163f07b8d3b013c4d1d6dba25e780b39658d79ba37af7057a3b7f15ffa102201fd9b4eaa9943f734928b99a83592c2e7bf342ea2680f6a2bb705167966b742001", "0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG", "", "P2PK" ], [ - "0x47 0x304402207ac319831b4c09cb1e7c122be879aa50cdb026d325334ef0e0d6d8d367a95892022066a2da5719283fb94370e97829afb8578aeb76adb32cd67776a435e8bcbdc5cf01 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508", + "0x47 0x304402206e05a6fe23c59196ffe176c9ddc31e73a9885638f9d1328d47c0c703863b8876022076feb53811aa5b04e0e79f938eb19906cc5e67548bc555a8e8b8b0fc603d840c01 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508", "DUP HASH160 0x14 0x1018853670f9f3b0582c5b9ee8ce93764ac32b93 EQUALVERIFY CHECKSIG", "", "P2PKH" ], [ - "0x47 0x304402200e963b830cc61b8e80915c2c72dad1358807d33554daf114fa5859f2a741c006022000a81f1c8e223c5a459ff99addf9e04ae5492181ec8e947fc6f49c315e49570e81", + "0x47 0x304402204710a85181663b32d25c70ec2bbd14adff5ddfff6cb50d09e155ef5f541fc86c0220056b0cc949be9386ecc5f6c2ac0493269031dbb185781db90171b54ac127790281", "0x41 0x048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf CHECKSIG", "", "P2PK anyonecanpay" ], [ - "0x47 0x3044022039e3b7051329e12e23ec00f9ae70c1e317beb718da52e7988776d44b4911173702200fb94de60deb6d6a440fc119f00127e731cdbe5760aa7fffdbf5f3da2d07569801 0x23 0x210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798ac", + "0x47 0x3044022003fef42ed6c7be8917441218f525a60e2431be978e28b7aca4d7a532cc413ae8022067a1f82c74e8d69291b90d148778405c6257bbcfc2353cc38a3e1f22bf44254601 0x23 0x210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798ac", "HASH160 0x14 0x23b0ad3477f2178bc0b3eed26e4e6316f4e83aa1 EQUAL", "P2SH", "P2SH(P2PK)" ], [ - "0x47 0x30440220555e138776dbd4d7592df35989d8265858b0137b54118d700edb9cf83d42ec660220224f766b9956b380ea8f853a6832bf14bcd42514159080dd90f21d27cbe61d1201 0x19 0x76a9147cf9c846cd4882efec4bf07e44ebdad495c94f4b88ac", + "0x47 0x304402204e2eb034be7b089534ac9e798cf6a2c79f38bcb34d1b179efd6f2de0841735db022071461beb056b5a7be1819da6a3e3ce3662831ecc298419ca101eb6887b5dd6a401 0x19 0x76a9147cf9c846cd4882efec4bf07e44ebdad495c94f4b88ac", "HASH160 0x14 0x2df519943d5acc0ef5222091f9dfe3543f489a82 EQUAL", "", "P2SH(P2PKH), bad sig but no VERIFY_P2SH" ], [ - "0 0x47 0x3044022019fa79ee8642d75cc7f89ee4c05610308363c25d459be356d333f5dd276548780220192af34c8fcd2d116c1a3cac43bebc9439de0e3435c3b5c946b7b0c6098a9ab701 0x47 0x304402203f967505faa2f69e3482e63d0c59f6e4b06599f59e7df9558bbb5f976cc190250220572c2a827b6a2ace87475acdc00bfbc4442ecaf6b4f54c489b0a5bd0ffc36d1d01 0x47 0x304402200400c0da6ef02d88af4d9ccdc97e5db3cd0e0f148024805089920c89742637af022040400714f61c99394f68422288b36399fa274561d9e6ca4d0f539cc680360f5d01", + "0 0x47 0x3044022051254b9fb476a52d85530792b578f86fea70ec1ffb4393e661bcccb23d8d63d3022076505f94a403c86097841944e044c70c2045ce90e36de51f7e9d3828db98a07501 0x47 0x304402200a358f750934b3feb822f1966bfcd8bbec9eeaa3a8ca941e11ee5960e181fa01022050bf6b5a8e7750f70354ae041cb68a7bade67ec6c3ab19eb359638974410626e01 0x47 0x304402200955d031fff71d8653221e85e36c3c85533d2312fc3045314b19650b7ae2f81002202a6bb8505e36201909d0921f01abff390ae6b7ff97bbf959f98aedeb0a56730901", "3 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 3 CHECKMULTISIG", "", "3-of-3" ], [ - "0 0x47 0x304402201c9f6e207f988e12d688c215fa2f754436cf85a097257cbbb2b5c8ac5e770b2d0220665f8265a950d896cc613194970c89a49c94d1aa8e736ff8dacbe0af8f33a53401 0x47 0x30440220635cafa87f41567435d0528559a3d4ff89d707f592bf6c54083777a584e3ba900220746fa1c7a1f0e441b629095e16fcf71111825a9d3d14d7068c3d82a491115ac701 0x4c69 0x52210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f8179821038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f515082103363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff464053ae", + "0 0x47 0x304402205b7d2c2f177ae76cfbbf14d589c113b0b35db753d305d5562dd0b61cbf366cfb02202e56f93c4f08a27f986cd424ffc48a462c3202c4902104d4d0ff98ed28f4bf8001 0x47 0x30440220563e5b3b1fc11662a84bc5ea2a32cc3819703254060ba30d639a1aaf2d5068ad0220601c1f47ddc76d93284dd9ed68f7c9974c4a0ea7cbe8a247d6bc3878567a5fca01 0x4c69 0x52210279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f8179821038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f515082103363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff464053ae", "HASH160 0x14 0xc9e4a896d149702d0d1695434feddd52e24ad78d EQUAL", "P2SH", "P2SH(2-of-3)" ], [ - "0x47 0x30440220000a55d0ce61b3e392a2f6d7331021b26472489174bb8c2ad8cb6725d3bfeda2022060087e93b5083d99b6a11584d71357e19e251f689715226b2e154817259dde1b01", + "0x47 0x304402200060558477337b9022e70534f1fea71a318caf836812465a2509931c5e7c4987022078ec32bd50ac9e03a349ba953dfd9fe1c8d2dd8bdb1d38ddca844d3d5c78c11801", "0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG", "", "P2PK with too much R padding but no DERSIG" ], [ - "0x48 0x3045022030e7ea75f00a73608db820ba645a066e3fccf09dbb315a0a1d7e8773afcb9ab7022100505fea7b5dc292a43e8d1e6468bdd6c3269012cd05106be015ea14ca7cb4bba401", + "0x48 0x304502202de8c03fc525285c9c535631019a5f2af7c6454fa9eb392a3756a4917c420edd02210046130bf2baf7cfc065067c8b9e33a066d9c15edcea9feb0ca2d233e3597925b401", "0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG", "", "P2PK with too much S padding but no DERSIG" ], [ - "0x47 0x30440220f392c3fc0b257a8d6ad64a070c40ddd11a0f8f4ecc8e05f6719a2934900e71df0220139e1bf8052713895cda2f843dde585abc05a7f07d4931dd5c1dbb8c7d94909101", + "0x47 0x30440220d7a0417c3f6d1a15094d1cf2a3378ca0503eb8a57630953a9e2987e21ddd0a6502207a6266d686c99090920249991d3d42065b6d43eb70187b219c0db82e4f94d1a201", "0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG", "", "P2PK with too little R padding but no DERSIG" ], [ - "0x47 0x304402200052768d9f59125f9006926e19f464692107c21b3e6d4d020ddf957b4f115f770220629111f4f57822dc77d355586921daf39020353752dbd4b4d0ed161964b1255401", + "0x47 0x30440220005ece1335e7f757a1a1f476a7fb5bd90964e8a022489f890614a04acfb734c002206c12b8294a6513c7710e8c82d3c23d75cdbfe83200eb7efb495701958501a5d601", "0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 CHECKSIG NOT", "", "P2PK NOT with bad sig with too much R padding but no DERSIG" ], [ - "0x47 0x30440220f392c3fc0b257a8d6ad64a070c40ddd11a0f8f4ecc8e05f6719a2934900e71df0220139e1bf8052713895cda2f843dde585abc05a7f07d4931dd5c1dbb8c7d94909101", + "0x47 0x30440220d7a0417c3f6d1a15094d1cf2a3378ca0503eb8a57630953a9e2987e21ddd0a6502207a6266d686c99090920249991d3d42065b6d43eb70187b219c0db82e4f94d1a201", "0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 CHECKSIG", "", "BIP66 example 1, without DERSIG" @@ -793,115 +793,115 @@ "BIP66 example 6, without DERSIG" ], [ - "0 0x47 0x30440220959b3fa55bcbc510291af8f090ba5a17ee308f733f471bb382b8a23988a7d0500220770e10f776857775a4cc544718e1f3ce50521cfcafebf8936ffacb7b6284629e01 0x47 0x304402206ef1151dc2c72e3f57dc9185d5755808367fb57c2c65c8df55d82e6d8e89b6f8022050dff5f4a6055b9b26640f9fcdb05290d7d82008ab934b126cae78abdc2f2a2001", + "0 0x47 0x30440220cae00b1444babfbf6071b0ba8707f6bd373da3df494d6e74119b0430c5db810502205d5231b8c5939c8ff0c82242656d6e06edb073d42af336c99fe8837c36ea39d501 0x47 0x3044022027c2714269ca5aeecc4d70edc88ba5ee0e3da4986e9216028f489ab4f1b8efce022022bd545b4951215267e4c5ceabd4c5350331b2e4a0b6494c56f361fa5a57a1a201", "2 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 2 CHECKMULTISIG", "", "BIP66 example 7, without DERSIG" ], [ - "0 0 0x47 0x30440220baaa8a49e8a96778a462eb8f2eae31ccb544e432b34662a5602ece12f20bf64f022007019c21e05b796e87b4b56e82903aae79e8efec190d4d834a551a406118b64601", + "0 0 0x47 0x30440220da6f441dc3b4b2c84cfa8db0cd5b34ed92c9e01686de5a800d40498b70c0dcac02207c2cf91b0c32b860c4cd4994be36cfb84caf8bb7c3a8e4d96a31b2022c5299c501", "2 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 2 CHECKMULTISIG NOT", "", "BIP66 example 10, without DERSIG" ], [ - "0 0x47 0x30440220ef225ea223236e01fd726d26d69fcb40b39df836cde25881e11848b80714d6c002205d7d8e091fc16a0d5e8b4785312466c5e8080b862534f94a9c70f24ac0ff496c01 0", + "0 0x47 0x30440220b119d67d389315308d1745f734a51ff3ec72e06081e84e236fdf9dc2f5d2a64802204b04e3bc38674c4422ea317231d642b56dc09d214a1ecbbf16ecca01ed996e2201 0", "2 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 2 CHECKMULTISIG NOT", "", "BIP66 example 12, without DERSIG" ], [ - "0 0x47 0x30440220ef225ea223236e01fd726d26d69fcb40b39df836cde25881e11848b80714d6c002205d7d8e091fc16a0d5e8b4785312466c5e8080b862534f94a9c70f24ac0ff496c01 0", + "0 0x47 0x30440220b119d67d389315308d1745f734a51ff3ec72e06081e84e236fdf9dc2f5d2a64802204b04e3bc38674c4422ea317231d642b56dc09d214a1ecbbf16ecca01ed996e2201 0", "2 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 2 CHECKMULTISIG NOT", "DERSIG", "BIP66 example 12, with DERSIG" ], [ - "0x48 0x3044022012918460459bc14fc7bd7d5050455b7d71444f48c5890381123fc46ddaf83d3a02202f83c59b73dedc29510acb4f7cce6de9c664e6e606d9a821a422e3e058ec95e80101", + "0x48 0x304402203e4516da7253cf068effec6b95c41221c0cf3a8e6ccb8cbf1725b562e9afde2c022054e1c258c2981cdfba5df1f46661fb6541c44f77ca0092f3600331abfffb12510101", "0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 CHECKSIG", "", "P2PK with multi-byte hashtype, without DERSIG" ], [ - "0x48 0x3045022012918460459bc14fc7bd7d5050455b7d71444f48c5890381123fc46ddaf83d3a022100d07c3a648c2123d6aef534b083319214f449f600a86ef81a1baf7aac7749ab5901", + "0x48 0x304502203e4516da7253cf068effec6b95c41221c0cf3a8e6ccb8cbf1725b562e9afde2c022100ab1e3da73d67e32045a20e0b999e049978ea8d6ee5480d485fcf2ce0d03b2ef001", "0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 CHECKSIG", "", "P2PK with high S but no LOW_S" ], [ - "0x47 0x3044022028ad19793d4abe04bc99c64523dcd06cb7fb6b9a8eb9b692489f02ba2ca51b4a02201ce5c56dcde293e8e3c011521e3f82ac27fdb5862df09077d002be95ea84841f01", + "0x47 0x3044022057292e2d4dfe775becdd0a9e6547997c728cdf35390f6a017da56d654d374e4902206b643be2fc53763b4e284845bfea2c597d2dc7759941dce937636c9d341b71ed01", "0x41 0x0679be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG", "", "P2PK with hybrid pubkey but no STRICTENC" ], [ - "0x47 0x304402207a7c44917eff92b8597bf3e5c7abaa01bba9183d926455b394d87a4897d1dac00220339e270e534ecaabbd3e49e59393e7c00b6b8558c29aa6f14aa6c6277c5e244d01", + "0x47 0x30440220035d554e3153c04950c9993f41c496607a8e24093db0595be7bf875cf64fcf1f02204731c8c4e5daf15e706cec19cdd8f2c5b1d05490e11dab8465ed426569b6e92101", "0x41 0x0679be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG NOT", "", "P2PK NOT with invalid hybrid pubkey but no STRICTENC" ], [ - "0 0x47 0x304402204846105e84bfc9fca3e64e58a78d3eafdc4da901b52508c57d656171cc3f95d002204155bde10e327190b16573f35d34dcba8fcda77c80fe3ed24da2838f1e09239801", + "0 0x47 0x304402202e79441ad1baf5a07fb86bae3753184f6717d9692680947ea8b6e8b777c69af1022079a262e13d868bb5a0964fefe3ba26942e1b0669af1afb55ef3344bc9d4fc4c401", "1 0x41 0x0679be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 2 CHECKMULTISIG", "", "1-of-2 with the second 1 hybrid pubkey and no STRICTENC" ], [ - "0 0x47 0x304402204846105e84bfc9fca3e64e58a78d3eafdc4da901b52508c57d656171cc3f95d002204155bde10e327190b16573f35d34dcba8fcda77c80fe3ed24da2838f1e09239801", + "0 0x47 0x304402202e79441ad1baf5a07fb86bae3753184f6717d9692680947ea8b6e8b777c69af1022079a262e13d868bb5a0964fefe3ba26942e1b0669af1afb55ef3344bc9d4fc4c401", "1 0x41 0x0679be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 2 CHECKMULTISIG", "STRICTENC", "1-of-2 with the second 1 hybrid pubkey" ], [ - "0x47 0x30440220220c3ad143cafae0c3c5403270b0c392f5eeb869701130c6a9790f7f1ce8261d02201cbe777ad4e7998b4f78363497eaf8dd4166901daaeb9737ff2b1326b0451a5c05", + "0x47 0x304402206177d513ec2cda444c021a1f4f656fc4c72ba108ae063e157eb86dc3575784940220666fc66702815d0e5413bb9b1df22aed44f5f1efb8b99d41dd5dc9a5be6d205205", "0x41 0x048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf CHECKSIG", "", "P2PK with undefined hashtype but no STRICTENC" ], [ - "0x47 0x304402200213672d90b1b99738e6c98f4a0798235b9f726ce1d674d8163fe5dac51b099802203a43ecb279d89dece434dc8d2bbf2347ee4b66147540a2e545c57135fa8d525105", + "0x47 0x304402207409b5b320296e5e2136a7b281a7f803028ca4ca44e2b83eebd46932677725de02202d4eea1c8d3c98e6f42614f54764e6e5e6542e213eb4d079737e9a8b6e9812ec05", "0x41 0x048282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f5150811f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf CHECKSIG NOT", "", "P2PK NOT with invalid sig and undefined hashtype but no STRICTENC" ], [ - "1 0x47 0x3044022019fa79ee8642d75cc7f89ee4c05610308363c25d459be356d333f5dd276548780220192af34c8fcd2d116c1a3cac43bebc9439de0e3435c3b5c946b7b0c6098a9ab701 0x47 0x304402203f967505faa2f69e3482e63d0c59f6e4b06599f59e7df9558bbb5f976cc190250220572c2a827b6a2ace87475acdc00bfbc4442ecaf6b4f54c489b0a5bd0ffc36d1d01 0x47 0x304402200400c0da6ef02d88af4d9ccdc97e5db3cd0e0f148024805089920c89742637af022040400714f61c99394f68422288b36399fa274561d9e6ca4d0f539cc680360f5d01", + "1 0x47 0x3044022051254b9fb476a52d85530792b578f86fea70ec1ffb4393e661bcccb23d8d63d3022076505f94a403c86097841944e044c70c2045ce90e36de51f7e9d3828db98a07501 0x47 0x304402200a358f750934b3feb822f1966bfcd8bbec9eeaa3a8ca941e11ee5960e181fa01022050bf6b5a8e7750f70354ae041cb68a7bade67ec6c3ab19eb359638974410626e01 0x47 0x304402200955d031fff71d8653221e85e36c3c85533d2312fc3045314b19650b7ae2f81002202a6bb8505e36201909d0921f01abff390ae6b7ff97bbf959f98aedeb0a56730901", "3 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 3 CHECKMULTISIG", "", "3-of-3 with nonzero dummy but no NULLDUMMY" ], [ - "1 0x47 0x304402205ed72cf70a97fbb41a7a75710a843e15f8646993d95209fabdca3a5da51e714102204354e061ba74c65761a2543e4943ecde19e26f84d8ea169f910c7d83cc79d10b01 0x47 0x3044022027a6e542a9b5cc18c81638e836c16da213f959a368cdec1de0a945df59ce84950220349a2e3f4f7eef8b64dc134168ae67ef4e42bb5151ab0e13656249c77278733c01 0x47 0x304402202b747c3dfc7bc63e9e22e40a721fe05cc6356f737c92a427ac77fbde950aa35e02207625f28d3cb4186c5a9d665b0040b8bc59ab2a451b46cb8aa9e8e4c4cadefa3001", + "1 0x47 0x304402201bb2edab700a5d020236df174fefed78087697143731f659bea59642c759c16d022061f42cdbae5bcd3e8790f20bf76687443436e94a634321c16a72aa54cbc7c2ea01 0x47 0x304402204bb4a64f2a6e5c7fb2f07fef85ee56fde5e6da234c6a984262307a20e99842d702206f8303aaba5e625d223897e2ffd3f88ef1bcffef55f38dc3768e5f2e94c923f901 0x47 0x3044022040c2809b71fffb155ec8b82fe7a27f666bd97f941207be4e14ade85a1249dd4d02204d56c85ec525dd18e29a0533d5ddf61b6b1bb32980c2f63edf951aebf7a27bfe01", "3 0x21 0x0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x03363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640 3 CHECKMULTISIG NOT", "", "3-of-3 NOT with invalid sig and nonzero dummy but no NULLDUMMY" ], [ - "0 0x47 0x3044022069335c200a859303ff1ab36c82aea0c0f71f8a841a5db2cd3b443d8ca98c395c02206afafd2571c690511ba64c26e7bb7ebef39967770f27fec0900e212f3992f1f201 DUP", + "0 0x47 0x304402200abeb4bd07f84222f474aed558cfbdfc0b4e96cde3c2935ba7098b1ff0bd74c302204a04c1ca67b2a20abee210cf9a21023edccbbf8024b988812634233115c6b73901 DUP", "2 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 2 CHECKMULTISIG", "", "2-of-2 with two identical keys and sigs pushed using OP_DUP but no SIGPUSHONLY" ], [ - "0 0x47 0x3044022069335c200a859303ff1ab36c82aea0c0f71f8a841a5db2cd3b443d8ca98c395c02206afafd2571c690511ba64c26e7bb7ebef39967770f27fec0900e212f3992f1f201 0x47 0x3044022069335c200a859303ff1ab36c82aea0c0f71f8a841a5db2cd3b443d8ca98c395c02206afafd2571c690511ba64c26e7bb7ebef39967770f27fec0900e212f3992f1f201", + "0 0x47 0x304402200abeb4bd07f84222f474aed558cfbdfc0b4e96cde3c2935ba7098b1ff0bd74c302204a04c1ca67b2a20abee210cf9a21023edccbbf8024b988812634233115c6b73901 0x47 0x304402200abeb4bd07f84222f474aed558cfbdfc0b4e96cde3c2935ba7098b1ff0bd74c302204a04c1ca67b2a20abee210cf9a21023edccbbf8024b988812634233115c6b73901", "2 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 0x21 0x038282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508 2 CHECKMULTISIG", "SIGPUSHONLY", "2-of-2 with two identical keys and sigs pushed" ], [ - "11 0x47 0x3044022028704302bdbc0951b707a947fc76b0bc833fe73d105f6b65917993b6ba739052022056e4d465960125cd226963137b93c31e5831af98f3250bacae1245fa882f837801", + "11 0x47 0x304402200a5c6163f07b8d3b013c4d1d6dba25e780b39658d79ba37af7057a3b7f15ffa102201fd9b4eaa9943f734928b99a83592c2e7bf342ea2680f6a2bb705167966b742001", "0x41 0x0479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8 CHECKSIG", "P2SH", "P2PK with unnecessary input but no CLEANSTACK" ], [ - "11 0x47 0x30440220785cd94c2ff5079a1423af355053c56c6a252f6806e3a6539f168709fbee533202203ba85578f85448a9ee4eb4c38e26b76367d992002eece1018273f043639ce06a01 0x43 0x410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8ac", + "11 0x47 0x304402202f7505132be14872581f35d74b759212d9da40482653f1ffa3116c3294a4a51702206adbf347a2240ca41c66522b1a22a41693610b76a8e7770645dc721d1635854f01 0x43 0x410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8ac", "HASH160 0x14 0x31edc23bdafda4639e669f89ad6b2318dd79d032 EQUAL", "P2SH", "P2SH with unnecessary input but no CLEANSTACK" ], [ - "0x47 0x30440220785cd94c2ff5079a1423af355053c56c6a252f6806e3a6539f168709fbee533202203ba85578f85448a9ee4eb4c38e26b76367d992002eece1018273f043639ce06a01 0x43 0x410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8ac", + "0x47 0x304402202f7505132be14872581f35d74b759212d9da40482653f1ffa3116c3294a4a51702206adbf347a2240ca41c66522b1a22a41693610b76a8e7770645dc721d1635854f01 0x43 0x410479be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8ac", "HASH160 0x14 0x31edc23bdafda4639e669f89ad6b2318dd79d032 EQUAL", "CLEANSTACK,P2SH", "P2SH with CLEANSTACK" @@ -909,3 +909,4 @@ ["The End"] ] + diff --git a/src/test/miner_tests.cpp b/src/test/miner_tests.cpp index a6df44652..fc22e94fd 100644 --- a/src/test/miner_tests.cpp +++ b/src/test/miner_tests.cpp @@ -24,116 +24,116 @@ struct { const char *nonce_hex; uint32_t vSolutions[NUM_EQUIHASH_SOLUTIONS]; } blockinfo[] = { - {"0000000000000000000000000000000000000000000000000000000000000000", {1113402,26940724,29426619,29650324,1651155,28182833,2919013,20269474,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {2541603,14114747,21660764,25879244,5433179,8124465,25666254,26548855,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {11929257,25158964,16095230,24841514,12867411,15686246,25441631,29728310,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {5105680,21328455,16152510,29495600,12443572,24958281,15815721,19841625,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {35834,7761680,14791216,18834970,10322825,29492625,10893714,26525542,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {1102283,26829250,13659455,22864463,3780400,22478846,21827356,30064470,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {2037605,12627800,15388193,32785696,20790459,24445774,23758535,27841410,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {3701973,27733118,20055632,32981287,11852035,23473816,12069611,24241138,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {1239069,7235416,16525930,24221834,17217527,18522923,28626536,33160290,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {257184,24892410,5577177,28973426,3838592,21876018,10548097,32849787,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {594750,25868567,15236813,21639078,695051,6577690,7049607,26122407,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {2953230,27002289,15387579,25612682,19679247,22183247,27483477,29772736,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {14264159,31139880,19405862,22349908,20538800,32612497,22946641,29253443,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {43271,13347426,4967623,27686294,2049029,10643471,26256712,27072023,}}, - {"0000000000000000000000000000000000000000000000000000000000000002", {4264458,5957348,10688362,25520226,5289719,25026457,7796449,22800689,}}, - {"0000000000000000000000000000000000000000000000000000000000000002", {826381,32629643,2098678,20063524,2756556,20471197,7523623,30720049,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {4448010,24132030,18245842,18676702,5480533,22770981,6876675,13164821,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {3619321,9958701,24513456,30709357,6570637,29783605,12349463,19460957,}}, - {"0000000000000000000000000000000000000000000000000000000000000003", {3338352,22879126,22388799,28738999,6338378,26770353,11615580,32570967,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {583162,28968143,8506860,10059788,1382777,17695787,7898822,28735790,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {689723,33265955,4951038,26417615,2878474,15296534,17067304,23912090,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {13387048,24067520,19933907,26756676,25442786,31637164,25467610,28623833,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {1082504,8652408,9758889,10565277,2825000,24483755,8669404,26856495,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {832465,1290760,8314106,21253530,7392507,18386499,17437969,17897762,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {402809,14238247,8846864,15628890,1394254,25476988,9768531,20445018,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {4724342,31383028,17023768,33283980,5666748,16675392,21273019,24165352,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {3671473,32986995,19868903,33549652,7343386,19607857,11053667,30367575,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {3776234,23322341,13313550,32344754,10577747,13162296,26428875,26771723,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {243097,14613552,5611701,6484778,5891882,23132752,8395009,22156516,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {21983,28268666,9568230,19429881,6008006,24008050,20887568,30451447,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {3238065,9482522,10764938,25814521,6563812,8831677,10735823,21915536,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {799412,3035304,15262733,26884054,1434085,10521995,16124208,28240181,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {3710111,16217715,18716479,21610969,21762189,23363300,22420670,24987885,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {172576,26167943,14646569,28316841,10493579,28798168,20021148,30720082,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {8420872,31076256,22609922,24941675,15649275,31768823,27195092,27455312,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {2635709,28723033,19580012,22376948,11090157,15926084,17679411,24519876,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {1753128,10357146,2144657,23878125,5910904,9054774,7382210,24872417,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {2453644,32518876,5369995,25186399,12698634,21512754,20357931,32882156,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {8829271,26693212,14001925,27298324,11910802,12882699,13181357,14940933,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {1679170,31059898,6265694,10641735,12015435,23038105,19962212,28620913,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {2643519,33504705,4356599,17500202,9172412,21700003,15721847,33350879,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {2807039,33438306,19754745,32233210,15667749,20376362,18620055,28064823,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {3281486,27251459,14067966,23523487,8259568,22590380,13893561,28476964,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {946954,5651933,12745771,23620660,1348853,30591707,18939991,26188704,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {1194714,20322323,21075964,26871057,2565364,4491315,8937294,22653696,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {637235,3860119,19707990,20376031,13004891,30800108,13847285,27717772,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {3234016,30828372,12722347,24300538,6920497,19090937,7198341,13648746,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {621868,31862815,4019117,8337759,19276345,22342537,30559974,30941776,}}, - {"0000000000000000000000000000000000000000000000000000000000000003", {1732075,20994666,6155543,25866809,3635886,22477080,5123596,13432247,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {2204518,20921515,12777053,25132755,5063934,14554392,10702268,29914364,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {6406067,20218961,20634617,28827338,11295835,16458724,18683265,31436074,}}, - {"0000000000000000000000000000000000000000000000000000000000000004", {7878007,21165294,8071789,31641431,8904023,17259094,10000563,31794352,}}, - {"0000000000000000000000000000000000000000000000000000000000000006", {5750028,25950324,14832510,30742754,19289275,33373074,19551765,30334371,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {785374,3657166,13462872,17039025,841360,21122444,3591794,8663192,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {6663135,16014329,8015567,27532870,8214530,20513665,14329688,20074961,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {10420672,15431588,30669813,32122115,16834934,23685740,17373413,31595830,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {1738923,3877533,5126100,15281834,6162636,24311468,15242152,24469387,}}, - {"0000000000000000000000000000000000000000000000000000000000000002", {3729011,33320159,26077521,26772495,12079870,20340043,18905055,20848710,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {1899782,12613196,7447739,12133044,6983605,21589090,28189402,28320756,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {3684861,24853041,27961196,32686824,6336696,29822601,7668660,16571990,}}, - {"0000000000000000000000000000000000000000000000000000000000000002", {4325123,10679550,7352744,15939111,20554616,27073737,26855425,31062910,}}, - {"0000000000000000000000000000000000000000000000000000000000000002", {6287964,21839182,8649920,14421276,10805018,12118354,12085375,17757398,}}, - {"0000000000000000000000000000000000000000000000000000000000000002", {9517507,20768654,17832112,32506789,16973867,29314279,19522774,31882006,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {4593507,11801862,22776242,27239522,5315575,32178272,19359679,29246067,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {70220,9824590,8585166,32653223,2471066,32929905,28303302,30995340,}}, - {"0000000000000000000000000000000000000000000000000000000000000002", {2112329,13887696,8915094,9388164,2979335,18058216,6638144,7655413,}}, - {"0000000000000000000000000000000000000000000000000000000000000002", {1598751,18664509,3464189,26549834,14569725,21446311,17294910,17945457,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {7407097,11289078,17774594,26390835,12546942,13428469,13407054,25035467,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {2381661,12510873,4702134,8667532,17569183,30421813,19155815,22067174,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {269914,9618692,314041,2748558,8267376,27166809,19380913,22511695,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {4539289,7888502,12855014,22139555,5618221,22440563,12938906,13283299,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {8734566,31269742,18087135,28734273,21477794,21932806,24439753,27006766,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {1188262,29875085,1555802,17924476,12140044,20111770,25232645,25355017,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {1832397,3831442,13088327,29103907,12436658,30784086,21692723,27401659,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {2199576,12822824,3157494,23072288,5198744,17718433,26926524,32792676,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {6419439,25870304,7393245,18802491,7791936,18552601,9473880,22310729,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {7013069,23660256,16998725,21932905,13990149,25724364,16911298,27581808,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {471581,12203475,2723947,7113047,15786079,24354137,19011625,22309954,}}, - {"0000000000000000000000000000000000000000000000000000000000000002", {8896196,16963078,19359299,32096019,8995579,32939764,9810638,25878351,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {1181248,19238611,3809164,29162138,7154558,12567104,13080848,19703519,}}, - {"0000000000000000000000000000000000000000000000000000000000000003", {3159364,30879003,25864645,28052580,7950194,24790693,16701888,16864466,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {1351562,12572515,1820009,2236616,10623632,13443650,12213300,29122917,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {6395614,31532576,7311043,10903613,15213720,21843676,24512158,30509942,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {6477837,27167216,10603653,31769971,9994098,10362636,13678858,20335701,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {10221363,31336574,14990834,18930315,11237243,19825663,19539543,32836293,}}, - {"0000000000000000000000000000000000000000000000000000000000000002", {4367295,26169439,17762319,25998417,9130819,26381016,17089620,33519140,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {4613517,6512918,24599762,26414995,12681444,18904943,17798602,31427364,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {3860451,17465681,12090048,25390051,9715631,26138619,15482251,25481590,}}, - {"0000000000000000000000000000000000000000000000000000000000000003", {784501,11148617,8619935,12096717,19509386,30494905,20301666,25869317,}}, - {"0000000000000000000000000000000000000000000000000000000000000004", {15985863,17262436,29269412,30002853,23454792,31616235,30450428,32986536,}}, - {"0000000000000000000000000000000000000000000000000000000000000004", {9262794,31375100,19724049,31709447,11614400,21767376,12567350,27208647,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {1930259,27620340,9374147,16209672,12127207,15790862,18749713,24745295,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {2037675,14809883,2478700,3880212,4322485,32315203,12270271,16346556,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {117986,8138393,9924260,20860963,4853158,13921015,10507877,17593395,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {11692683,14336396,22099757,23606002,23949189,25590567,24622458,29590174,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {3043651,6225687,17084299,32798569,3588547,5990245,19014563,24645345,}}, - {"0000000000000000000000000000000000000000000000000000000000000002", {568573,17369049,11024897,21817275,3636340,13669739,13852461,23632810,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {2363919,17767456,14656543,28392801,12503350,16087276,13869110,31665137,}}, - {"0000000000000000000000000000000000000000000000000000000000000002", {2199578,6335833,6936547,24494327,6477788,29903938,15516514,31970217,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {10830339,25496585,13882123,33083752,15548721,31652248,19757093,21446046,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {374835,17320644,27040413,32847830,7963957,12019127,12706216,22517651,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {2609477,6610225,19929451,26914203,13981212,26886006,16125588,25033208,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {9363335,29523412,28912941,29371268,16114010,28531419,20059905,28948000,}}, - {"0000000000000000000000000000000000000000000000000000000000000001", {3391197,19317083,15555354,32678769,5616378,18941218,14472636,15965627,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {3715073,28701443,13820848,27234602,4891795,9601840,23734794,25942841,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {3971271,14389739,12618800,28651336,13312973,15535545,24816839,29576036,}}, - {"0000000000000000000000000000000000000000000000000000000000000002", {2144617,32079731,14138184,14863508,5648295,15898822,13407115,26261273,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {8688716,28058207,9670766,27031282,10808709,20387419,23177453,30815061,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {2156330,19076434,5724654,8006651,2841915,3402602,21290399,26647339,}}, - {"0000000000000000000000000000000000000000000000000000000000000000", {40417,20280746,10776364,31468848,2879925,21985288,27692340,31524552,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {6460681,13237162,7709584,31045419,10285519,17375614,15570856,18802679,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {4561870,17803565,5142864,27252551,4878460,12303443,7865598,11300160,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {1089651,25039626,8810095,9296274,3249918,29008340,24645847,26512131,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {7728372,28861696,9545832,19144166,17556589,24119335,21961452,31035364,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {834238,9184343,13243668,23166288,7981278,26794117,14325463,14669701,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {734172,13569750,3562648,29145860,10283866,23063716,13248910,16359387,}}, + {"0000000000000000000000000000000000000000000000000000000000000002", {1587871,17811157,12023427,21207538,5720315,7856396,7103244,24229710,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {1888147,27449466,13224507,14518313,15963469,22950485,17952156,24720854,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {4302677,18772320,9863528,19410554,12176883,14140896,25924630,26251701,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {197279,32404497,11172719,18080543,15487758,28660859,31764039,32249219,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {4024821,20999820,8894371,30988205,7275560,30827261,9405363,21175857,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {1976935,18657882,12319377,33437938,2895318,8491699,8562465,9766831,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {1205583,22738706,10435172,22796265,16651295,26452611,17851968,21396176,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {4703343,12058656,8341840,9642250,12545365,23735257,29717152,30858347,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {692337,24190308,21647683,23770044,6914318,7096840,20965362,26417921,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {474315,31656164,6219098,28125716,5816881,15195781,13568953,29055883,}}, + {"0000000000000000000000000000000000000000000000000000000000000002", {31517,29912071,8389728,8760739,8901626,26743223,10511308,31784346,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {2869946,23991756,8426881,20564925,5642907,26127833,12441891,22131781,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {5580020,20830652,29410091,32809082,15349511,19331016,18657410,26534999,}}, + {"0000000000000000000000000000000000000000000000000000000000000002", {705535,33235971,1184462,26966580,1849828,26167591,18261528,19642580,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {360784,3620708,15346909,27811152,3736810,12736765,9492651,13418606,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {1229600,7684048,20079597,24040691,10128962,30769642,15215479,21182096,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {1684299,12541147,11247589,28636814,5760908,24056463,13771233,20156600,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {366615,1724571,10566227,11511903,17264833,25873819,22389268,27114210,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {2536004,10826889,5554022,25567653,17117623,27087905,24552584,25213783,}}, + {"0000000000000000000000000000000000000000000000000000000000000002", {1477713,7756450,10956188,18843116,5280035,23926642,21485984,25409801,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {7944879,30703371,18593785,31681620,17003578,23749264,23251318,24362277,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {3151970,16283037,12190544,27031633,16929809,21092626,19126308,20966999,}}, + {"0000000000000000000000000000000000000000000000000000000000000002", {11742805,26242944,23697920,25996586,21500488,31327474,26510314,29943352,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {3474994,10457317,7857597,9399886,3867550,30337263,7069425,9680763,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {4070482,23916700,15699207,32888441,13650427,16462993,13669068,32222979,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {1627610,2703221,25539467,26038173,20347871,22002889,27516372,33238984,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {5468299,20890642,15915944,28896368,5606254,30055314,20185515,26677498,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {4462855,25840162,11275769,25729029,4826227,8562549,17814144,29614168,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {4650460,13427503,11884796,27041814,8349794,29591502,8987422,28994357,}}, + {"0000000000000000000000000000000000000000000000000000000000000002", {2166037,24526315,16259633,18008356,12870736,27719518,18085823,19116447,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {3052277,18769667,10791737,29179500,6365222,25640257,12119977,23834845,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {931226,6222676,1981516,29528857,5526494,6437446,10216785,28915484,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {402336,20565306,1583379,17377951,2444738,20364696,20541200,28451640,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {481364,23732599,3623136,30032932,14778581,29656013,16319804,26087720,}}, + {"0000000000000000000000000000000000000000000000000000000000000004", {673463,14487660,3861111,12772690,12841615,19331262,18127729,25891349,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {2688675,19459330,21829421,33160296,2824435,7396953,21175704,24949453,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {421892,18602015,9591135,12373184,7173347,17694169,7290439,33340580,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {3679946,29187321,20720370,29454078,23815548,28025307,24512609,27027920,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {5915260,18635781,13270767,30532080,12087680,29287028,19295798,24363799,}}, + {"0000000000000000000000000000000000000000000000000000000000000002", {1379380,7806321,2502697,6908506,4744762,14959880,13980259,22137966,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {803408,20975966,1413482,13231173,3839363,23141291,13060405,18560250,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {1947212,33079753,4063708,21246355,11314469,30018165,21961696,31328001,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {6801506,7820458,13124300,19286633,13786873,26395883,24579925,27092845,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {4620414,21545333,24603466,27122394,8013117,19976859,26103775,33462356,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {1370285,27998389,15658264,32386855,13657425,28489219,21379429,27671710,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {1046241,9720078,22270576,31073443,2249489,18541008,3403135,25347615,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {6628384,15347228,7109798,12299310,13621159,18901367,17361405,24566552,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {485899,7175305,13204288,20383108,4291864,25276227,15428198,22075223,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {4576157,29654495,26010900,27823742,10508010,28828381,18751049,19433359,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {334007,24126201,14043036,28663573,12796738,30384031,23762812,32543448,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {1564387,20284844,7145783,29120878,16382945,23659265,24017950,25818664,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {1484737,27983306,17749884,21444188,20800690,30784231,28120163,30053577,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {2865891,27768876,4204802,17130915,11616277,31257628,32536380,33369091,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {1725874,5215139,12692907,19278036,15366567,15828025,21793226,31816514,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {734414,21482967,11953109,25118212,20766944,32456333,25492301,31547478,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {362428,14414265,5075444,27902624,9831174,31212666,13737393,32385081,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {145591,8161454,3423499,6631632,10102448,33473585,23115896,28527903,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {5444772,12807948,22417503,25113898,5895721,31533619,9369957,32708724,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {191145,14692308,10562753,23643852,1755413,2466351,12169279,32286664,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {4217796,23246407,8887845,31695154,10533326,30025673,22206874,32714380,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {1753102,14244174,8640641,9405374,2166463,9756880,20869865,32394445,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {8201850,31499684,11129001,16748109,14515976,24003883,17165759,32317200,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {6917819,32404441,19271143,21516446,15418960,20868981,24923177,28394671,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {321206,26913076,14302151,33448705,7685964,24523233,22925251,29572618,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {2903820,23498516,15828657,20209266,9829797,25536341,28768552,32421544,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {9083532,16515943,25935474,33429629,12792895,14550317,28467194,32688447,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {4996695,29308066,7380272,28823119,14269104,28218529,21486846,26875541,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {228029,9456103,5531810,9109588,3885858,13450710,11493960,23832083,}}, + {"0000000000000000000000000000000000000000000000000000000000000002", {958915,15090644,10493937,26335262,2070393,5579592,18459958,26779385,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {3493559,20210149,7605993,29565780,5511822,15350620,12521491,16673167,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {710976,1160173,1850466,12141940,13492316,15225365,27352064,29101085,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {833211,21378874,6103635,22908955,14126213,17853331,21011902,23341861,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {181919,31623201,16582055,19621754,3411910,25415514,12417425,18284193,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {5204608,22166236,7632269,8411635,10740217,26043175,12647988,26574735,}}, + {"0000000000000000000000000000000000000000000000000000000000000005", {4664139,29955587,14704709,25453965,4905764,29351642,16659156,23751368,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {5074419,30890716,6339326,28953313,9291001,24375735,15257160,21165865,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {190613,10145278,13714746,18808813,1423680,9382947,4269988,10838567,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {504650,14462835,10620156,24205954,15972669,20658502,16300078,23707181,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {7086481,22486367,28908448,28999017,18308207,19251588,25979812,32255764,}}, + {"0000000000000000000000000000000000000000000000000000000000000003", {1172269,3423547,9911856,12439428,8953916,22659976,21037751,30753942,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {3184078,22469134,7580931,10118630,9045686,13673962,11524613,33303343,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {342541,746191,25924366,26107112,9690659,21648096,15916528,18201749,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {582456,27300325,15677298,25818305,2923523,31393258,14404095,22050324,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {10098349,15404997,29705933,31559548,11692299,14511261,15242769,23172215,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {6647678,19913634,25164906,26855602,14666922,20168128,24127251,32531463,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {843691,21167176,4272064,8283965,12764152,21618083,24528474,27375014,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {978668,10447726,18233823,25605427,2261375,2637831,2614534,9252646,}}, + {"0000000000000000000000000000000000000000000000000000000000000002", {1523033,15567854,31485034,31653930,3636244,29609827,9083361,13896638,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {14773161,24406294,20062169,23703412,19849451,25344930,21297766,21606960,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {10100496,12477457,16853659,28087974,18171731,31136212,22832204,25990125,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {531788,29206121,8960854,25889718,3126134,22174191,8498009,30497485,}}, + {"0000000000000000000000000000000000000000000000000000000000000002", {1096424,23770446,8053481,14993175,3764227,10960948,6565175,22844110,}}, + {"0000000000000000000000000000000000000000000000000000000000000002", {6429009,13512960,16148076,24871100,8228201,22446947,25288067,28595618,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {1434391,25515128,14612732,17121094,12948147,15232470,18432774,21355020,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {3262210,13836997,4066552,27432736,10722950,27475484,19851879,33265322,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {2137233,17090519,21817897,23680576,4999337,31859639,19266661,21935793,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {11111617,28095860,19042244,26086616,11348636,11733615,12672763,22722616,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {3028356,33444135,24052719,33236905,5745448,17228696,12238401,17713606,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {3682992,24667486,8936251,20577232,21868711,24392760,25828087,25912226,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {7856263,26873641,8940072,26662014,18323682,23361977,27035850,31048059,}}, + {"0000000000000000000000000000000000000000000000000000000000000001", {4788899,18223624,10534029,17985114,14007906,14374373,18385178,32483622,}}, + {"0000000000000000000000000000000000000000000000000000000000000002", {7610807,27213835,11937691,19779229,8510123,27229098,12664187,21714276,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {1108792,32718813,27176467,32141527,9222059,17822217,9907758,25989472,}}, + {"0000000000000000000000000000000000000000000000000000000000000000", {1797437,9489520,25931087,27014881,9885952,31932732,10063945,20983975,}}, }; // NOTE: These tests rely on CreateNewBlock doing its own self-validation! From 92f7426d1962919c5a5ab00bf38320572e61c011 Mon Sep 17 00:00:00 2001 From: Simon Date: Wed, 27 Jul 2016 12:14:44 -0700 Subject: [PATCH 13/16] Make txid const. --- src/primitives/transaction.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/primitives/transaction.h b/src/primitives/transaction.h index ab3f60883..6dbfb582a 100644 --- a/src/primitives/transaction.h +++ b/src/primitives/transaction.h @@ -288,7 +288,7 @@ private: /** Memory only. */ const uint256 hash; void UpdateHash() const; - uint256 txid; + const uint256 txid; void UpdateTxid() const; public: From 3979881fc52354c1dbe71f03d0a12e6cd6138399 Mon Sep 17 00:00:00 2001 From: Simon Date: Thu, 28 Jul 2016 16:40:01 -0700 Subject: [PATCH 14/16] Fix comment. --- src/primitives/transaction.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/primitives/transaction.cpp b/src/primitives/transaction.cpp index 5d157a5c3..2fbaad854 100644 --- a/src/primitives/transaction.cpp +++ b/src/primitives/transaction.cpp @@ -227,7 +227,7 @@ std::string CTransaction::ToString() const return str; } -// Return a txid which is non-malleable. +// Update the txid which is non-malleable. // Signature data is cleared before the transaction is serialized and hashed. void CTransaction::UpdateTxid() const { From c63af91a7833b3cf879d2d615dc6709a5b69c12f Mon Sep 17 00:00:00 2001 From: Simon Date: Thu, 28 Jul 2016 18:44:00 -0700 Subject: [PATCH 15/16] Update comment. --- src/primitives/transaction.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/primitives/transaction.h b/src/primitives/transaction.h index 6dbfb582a..69d209e0d 100644 --- a/src/primitives/transaction.h +++ b/src/primitives/transaction.h @@ -417,7 +417,7 @@ struct CMutableTransaction } /** Compute the hash of this CMutableTransaction. This is computed on the - * fly, as opposed to GetHash() in CTransaction, which uses a cached result. + * fly, as opposed to GetSerializeHash() in CTransaction, which uses a cached result. */ uint256 GetSerializeHash() const; From 74cd8821c7bf7ad2fdda75cdb927f05a4406c90e Mon Sep 17 00:00:00 2001 From: Simon Date: Fri, 29 Jul 2016 23:28:34 -0700 Subject: [PATCH 16/16] Remove GetSerializeHash() method. --- src/primitives/transaction.cpp | 12 +++--------- src/primitives/transaction.h | 11 ++--------- 2 files changed, 5 insertions(+), 18 deletions(-) diff --git a/src/primitives/transaction.cpp b/src/primitives/transaction.cpp index 2fbaad854..854a0be66 100644 --- a/src/primitives/transaction.cpp +++ b/src/primitives/transaction.cpp @@ -116,11 +116,6 @@ CMutableTransaction::CMutableTransaction(const CTransaction& tx) : nVersion(tx.n } -uint256 CMutableTransaction::GetSerializeHash() const -{ - return SerializeHash(*this); -} - void CTransaction::UpdateHash() const { *const_cast(&hash) = SerializeHash(*this); @@ -214,8 +209,8 @@ std::string CTransaction::ToString() const { std::string str; str += strprintf("CTransaction(txid=%s, hash=%s, ver=%d, vin.size=%u, vout.size=%u, nLockTime=%u)\n", - GetTxid().ToString().substr(0,10), - GetSerializeHash().ToString().substr(0,10), + txid.ToString().substr(0,10), + hash.ToString().substr(0,10), nVersion, vin.size(), vout.size(), @@ -245,8 +240,7 @@ void CTransaction::UpdateTxid() const tx.joinSplitSig.assign(0); } - // Return double SHA256 hash - *const_cast(&txid) = tx.GetSerializeHash(); + *const_cast(&txid) = SerializeHash(tx); } // Return a txid which is non-malleable. diff --git a/src/primitives/transaction.h b/src/primitives/transaction.h index 69d209e0d..ecfe40d10 100644 --- a/src/primitives/transaction.h +++ b/src/primitives/transaction.h @@ -343,10 +343,6 @@ public: return vin.empty() && vout.empty(); } - const uint256& GetSerializeHash() const { - return hash; - } - // Return sum of txouts. CAmount GetValueOut() const; // GetValueIn() is a method on CCoinsViewCache, because @@ -416,12 +412,9 @@ struct CMutableTransaction } } - /** Compute the hash of this CMutableTransaction. This is computed on the - * fly, as opposed to GetSerializeHash() in CTransaction, which uses a cached result. + /** Compute the non-malleable txid of this CMutableTransaction. This is computed on the + * fly, as opposed to GetTxid() in CTransaction, which uses a cached result. */ - uint256 GetSerializeHash() const; - - // Compute a non-malleable txid on the fly. uint256 GetTxid() const; };