Skip to content

Commit 82cf464

Browse files
committed
scripted-diff: Replace UINT256_ONE() with uint256::ONE
-BEGIN VERIFY SCRIPT- sed -i '/inline.* UINT256_ONE() {/,+1d' src/uint256.h sed -i 's/UINT256_ONE()/uint256::ONE/' $(git grep -l UINT256_ONE) -END VERIFY SCRIPT-
1 parent 183f308 commit 82cf464

File tree

5 files changed

+5
-7
lines changed

5 files changed

+5
-7
lines changed

src/script/interpreter.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1375,7 +1375,7 @@ uint256 SignatureHash(const CScript& scriptCode, const T& txTo, unsigned int nIn
13751375
if ((nHashType & 0x1f) == SIGHASH_SINGLE) {
13761376
if (nIn >= txTo.vout.size()) {
13771377
// nOut out of range
1378-
return UINT256_ONE();
1378+
return uint256::ONE;
13791379
}
13801380
}
13811381

src/test/sighash_tests.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ uint256 static SignatureHashOld(CScript scriptCode, const CTransaction& txTo, un
2828
{
2929
if (nIn >= txTo.vin.size())
3030
{
31-
return UINT256_ONE();
31+
return uint256::ONE;
3232
}
3333
CMutableTransaction txTmp(txTo);
3434

@@ -58,7 +58,7 @@ uint256 static SignatureHashOld(CScript scriptCode, const CTransaction& txTo, un
5858
unsigned int nOut = nIn;
5959
if (nOut >= txTmp.vout.size())
6060
{
61-
return UINT256_ONE();
61+
return uint256::ONE;
6262
}
6363
txTmp.vout.resize(nOut+1);
6464
for (unsigned int i = 0; i < nOut; i++)

src/uint256.h

-2
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,4 @@ inline uint256 uint256S(const std::string& str)
150150
return rv;
151151
}
152152

153-
inline const uint256& UINT256_ONE() { return uint256::ONE; }
154-
155153
#endif // BITCOIN_UINT256_H

src/wallet/scriptpubkeyman.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,7 @@ std::unique_ptr<CKeyMetadata> LegacyScriptPubKeyMan::GetMetadata(const CTxDestin
655655

656656
uint256 LegacyScriptPubKeyMan::GetID() const
657657
{
658-
return UINT256_ONE();
658+
return uint256::ONE;
659659
}
660660

661661
/**

src/wallet/wallet.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ std::shared_ptr<CWallet> CreateWallet(interfaces::Chain& chain, const std::strin
324324
return wallet;
325325
}
326326

327-
const uint256 CWalletTx::ABANDON_HASH(UINT256_ONE());
327+
const uint256 CWalletTx::ABANDON_HASH(uint256::ONE);
328328

329329
/** @defgroup mapWallet
330330
*

0 commit comments

Comments
 (0)