File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 77
88#include " uint256.h"
99#include " utilstrencodings.h"
10+ #include " crypto/common.h"
1011
1112#include < stdio.h>
1213#include < string.h>
@@ -246,14 +247,14 @@ uint32_t arith_uint256::GetCompact(bool fNegative) const
246247uint256 ArithToUint256 (const arith_uint256 &a)
247248{
248249 uint256 b;
249- // TODO: needs bswap32 on big-endian
250- memcpy (b.begin (), a. pn , a.size () );
250+ for ( int x= 0 ; x<a. WIDTH ; ++x)
251+ WriteLE32 (b.begin () + x* 4 , a.pn [x] );
251252 return b;
252253}
253254arith_uint256 UintToArith256 (const uint256 &a)
254255{
255256 arith_uint256 b;
256- // TODO: needs bswap32 on big-endian
257- memcpy ( b.pn , a.begin (), a. size () );
257+ for ( int x= 0 ; x<b. WIDTH ; ++x)
258+ b.pn [x] = ReadLE32 ( a.begin () + x* 4 );
258259 return b;
259260}
You can’t perform that action at this time.
0 commit comments