17
17
#include " version.h"
18
18
19
19
#include < boost/algorithm/string.hpp>
20
- #include < boost/dynamic_bitset.hpp>
21
20
22
21
#include < univalue.h>
23
22
@@ -502,7 +501,8 @@ static bool rest_getutxos(HTTPRequest* req, const std::string& strURIPart)
502
501
vector<unsigned char > bitmap;
503
502
vector<CCoin> outs;
504
503
std::string bitmapStringRepresentation;
505
- boost::dynamic_bitset<unsigned char > hits (vOutPoints.size ());
504
+ std::vector<bool > hits;
505
+ bitmap.resize ((vOutPoints.size () + 7 ) / 8 );
506
506
{
507
507
LOCK2 (cs_main, mempool.cs );
508
508
@@ -518,10 +518,11 @@ static bool rest_getutxos(HTTPRequest* req, const std::string& strURIPart)
518
518
for (size_t i = 0 ; i < vOutPoints.size (); i++) {
519
519
CCoins coins;
520
520
uint256 hash = vOutPoints[i].hash ;
521
+ bool hit = false ;
521
522
if (view.GetCoins (hash, coins)) {
522
523
mempool.pruneSpent (hash, coins);
523
524
if (coins.IsAvailable (vOutPoints[i].n )) {
524
- hits[i] = true ;
525
+ hit = true ;
525
526
// Safe to index into vout here because IsAvailable checked if it's off the end of the array, or if
526
527
// n is valid but points to an already spent output (IsNull).
527
528
CCoin coin;
@@ -533,10 +534,11 @@ static bool rest_getutxos(HTTPRequest* req, const std::string& strURIPart)
533
534
}
534
535
}
535
536
536
- bitmapStringRepresentation.append (hits[i] ? " 1" : " 0" ); // form a binary string representation (human-readable for json output)
537
+ hits.push_back (hit);
538
+ bitmapStringRepresentation.append (hit ? " 1" : " 0" ); // form a binary string representation (human-readable for json output)
539
+ bitmap[i / 8 ] |= ((uint8_t )hit) << (i % 8 );
537
540
}
538
541
}
539
- boost::to_block_range (hits, std::back_inserter (bitmap));
540
542
541
543
switch (rf) {
542
544
case RF_BINARY: {
0 commit comments