aboutsummaryrefslogtreecommitdiff
path: root/src/test/DoS_tests.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/DoS_tests.cpp')
-rw-r--r--src/test/DoS_tests.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/test/DoS_tests.cpp b/src/test/DoS_tests.cpp
index d86cc7a29..3a4584441 100644
--- a/src/test/DoS_tests.cpp
+++ b/src/test/DoS_tests.cpp
@@ -8,7 +8,6 @@
-#include "bignum.h"
#include "keystore.h"
#include "main.h"
#include "net.h"
@@ -106,9 +105,9 @@ static bool CheckNBits(unsigned int nbits1, int64_t time1, unsigned int nbits2,
return CheckNBits(nbits2, time2, nbits1, time1);
int64_t deltaTime = time2-time1;
- CBigNum required;
+ uint256 required;
required.SetCompact(ComputeMinWork(nbits1, deltaTime));
- CBigNum have;
+ uint256 have;
have.SetCompact(nbits2);
return (have <= required);
}
@@ -168,7 +167,7 @@ BOOST_AUTO_TEST_CASE(DoS_mapOrphans)
// 50 orphan transactions:
for (int i = 0; i < 50; i++)
{
- CTransaction tx;
+ CMutableTransaction tx;
tx.vin.resize(1);
tx.vin[0].prevout.n = 0;
tx.vin[0].prevout.hash = GetRandHash();
@@ -185,7 +184,7 @@ BOOST_AUTO_TEST_CASE(DoS_mapOrphans)
{
CTransaction txPrev = RandomOrphan();
- CTransaction tx;
+ CMutableTransaction tx;
tx.vin.resize(1);
tx.vin[0].prevout.n = 0;
tx.vin[0].prevout.hash = txPrev.GetHash();
@@ -202,7 +201,7 @@ BOOST_AUTO_TEST_CASE(DoS_mapOrphans)
{
CTransaction txPrev = RandomOrphan();
- CTransaction tx;
+ CMutableTransaction tx;
tx.vout.resize(1);
tx.vout[0].nValue = 1*CENT;
tx.vout[0].scriptPubKey.SetDestination(key.GetPubKey().GetID());
@@ -243,10 +242,10 @@ BOOST_AUTO_TEST_CASE(DoS_checkSig)
// 100 orphan transactions:
static const int NPREV=100;
- CTransaction orphans[NPREV];
+ CMutableTransaction orphans[NPREV];
for (int i = 0; i < NPREV; i++)
{
- CTransaction& tx = orphans[i];
+ CMutableTransaction& tx = orphans[i];
tx.vin.resize(1);
tx.vin[0].prevout.n = 0;
tx.vin[0].prevout.hash = GetRandHash();
@@ -259,7 +258,7 @@ BOOST_AUTO_TEST_CASE(DoS_checkSig)
}
// Create a transaction that depends on orphans:
- CTransaction tx;
+ CMutableTransaction tx;
tx.vout.resize(1);
tx.vout[0].nValue = 1*CENT;
tx.vout[0].scriptPubKey.SetDestination(key.GetPubKey().GetID());