Temporarily add SetNull/IsNull/GetCheapHash to base_uint
Also add a stub for arith_uint256 and its conversion functions, for now completely based on uint256. Eases step-by-step migration to blob.
This commit is contained in:
@@ -283,6 +283,23 @@ public:
|
||||
{
|
||||
s.read((char*)pn, sizeof(pn));
|
||||
}
|
||||
|
||||
// Temporary for migration to opaque uint160/256
|
||||
uint64_t GetCheapHash() const
|
||||
{
|
||||
return GetLow64();
|
||||
}
|
||||
void SetNull()
|
||||
{
|
||||
memset(pn, 0, sizeof(pn));
|
||||
}
|
||||
bool IsNull() const
|
||||
{
|
||||
for (int i = 0; i < WIDTH; i++)
|
||||
if (pn[i] != 0)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
/** 160-bit unsigned big integer. */
|
||||
@@ -330,4 +347,7 @@ public:
|
||||
uint64_t GetHash(const uint256& salt) const;
|
||||
};
|
||||
|
||||
// Temporary for migration to opaque uint160/256
|
||||
inline uint256 uint256S(const std::string &x) { return uint256(x); }
|
||||
|
||||
#endif // BITCOIN_UINT256_H
|
||||
|
||||
Reference in New Issue
Block a user