diff --git a/src/uint256.h b/src/uint256.h index a13c814dc3..2529705f32 100644 --- a/src/uint256.h +++ b/src/uint256.h @@ -138,6 +138,20 @@ public: return ret; } + base_uint& operator+=(const base_uint& b) + { + uint64 carry = 0; + + for (int i = 0; i < WIDTH; i++) + { + uint64 n = carry + pn[i] + b.pn[i]; + pn[i] = n & 0xffffffff; + carry = n >> 32; + } + + return *this; + } + std::size_t hash_combine(std::size_t& seed) const { for (int i = 0; i < WIDTH; ++i)