aboutsummaryrefslogtreecommitdiff
path: root/src/test/sighash_tests.cpp
diff options
context:
space:
mode:
authorAndrew Chow <[email protected]>2019-12-30 14:05:27 -0500
committerAndrew Chow <[email protected]>2020-01-23 16:35:08 -0500
commit4977c30d59e88a3e5ee248144bcc023debcd895b (patch)
treeffd93cc643f1f5ac0f0255a9da6f3e1c9a202fbf /src/test/sighash_tests.cpp
parentHD Split: Avoid redundant upgrades (diff)
downloaddiscoin-4977c30d59e88a3e5ee248144bcc023debcd895b.tar.xz
discoin-4977c30d59e88a3e5ee248144bcc023debcd895b.zip
refactor: define a UINT256_ONE global constant
Instead of having a uint256 representations of one scattered throughout where it is used, define it globally in uint256.h
Diffstat (limited to 'src/test/sighash_tests.cpp')
-rw-r--r--src/test/sighash_tests.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/test/sighash_tests.cpp b/src/test/sighash_tests.cpp
index 2c56bbdbb..bcc4a4687 100644
--- a/src/test/sighash_tests.cpp
+++ b/src/test/sighash_tests.cpp
@@ -26,10 +26,9 @@ extern UniValue read_json(const std::string& jsondata);
// Old script.cpp SignatureHash function
uint256 static SignatureHashOld(CScript scriptCode, const CTransaction& txTo, unsigned int nIn, int nHashType)
{
- static const uint256 one(uint256S("0000000000000000000000000000000000000000000000000000000000000001"));
if (nIn >= txTo.vin.size())
{
- return one;
+ return UINT256_ONE();
}
CMutableTransaction txTmp(txTo);
@@ -59,7 +58,7 @@ uint256 static SignatureHashOld(CScript scriptCode, const CTransaction& txTo, un
unsigned int nOut = nIn;
if (nOut >= txTmp.vout.size())
{
- return one;
+ return UINT256_ONE();
}
txTmp.vout.resize(nOut+1);
for (unsigned int i = 0; i < nOut; i++)