Skip to content

Commit

Permalink
Started updating to accommodate bitcoind 0.8+...
Browse files Browse the repository at this point in the history
  • Loading branch information
etotheipi committed Dec 26, 2012
1 parent be2485f commit 88519ba
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 13 deletions.
2 changes: 1 addition & 1 deletion armorycolors.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ class ArbitraryStruct: pass
def htmlColor(name):
"""
These are not official HTML colors: this is simply a method
for taking one of the baove colors and converting to a hex string
for taking one of the above colors and converting to a hex string
"""
try:
qcolor = Colors.__dict__[name]
Expand Down
2 changes: 1 addition & 1 deletion armoryengine.py
Original file line number Diff line number Diff line change
Expand Up @@ -1451,7 +1451,7 @@ def parsePrivateKeyData(theStr):
hexChars = '01234567890abcdef'
b58Chars = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'

hexCount = sum([1 if c in hexChars else 0 for c in theStr])
hexCount = sum([1 if c in hexChars else 0 for c in theStr.lower()])
b58Count = sum([1 if c in b58Chars else 0 for c in theStr])
canBeHex = hexCount==len(theStr)
canBeB58 = b58Count==len(theStr)
Expand Down
12 changes: 6 additions & 6 deletions cppForSwig/BinaryData.h
Original file line number Diff line number Diff line change
Expand Up @@ -1200,24 +1200,25 @@ class BinaryStreamBuffer
// left in the stream
bool streamPull(void)
{
SCOPED_TIMER("StreamPull");

uint32_t prevBufSizeRemain = binReader_.getSizeRemaining();
if(fileBytesRemaining_ == 0)
return false;

TIMER_START("Stream Pull");
if( binReader_.getPosition() <= 0)
{
// No data to shuffle, just pull from the stream buffer
if(fileBytesRemaining_ > binReader_.getSize())
{
// Enough left in the stream to fill the entire buffer
TIMER_WRAP_GROUP("StreamJustRead", streamPtr_->read((char*)(binReader_.exposeDataPtr()), binReader_.getSize()));
streamPtr_->read((char*)(binReader_.exposeDataPtr()), binReader_.getSize());
fileBytesRemaining_ -= binReader_.getSize();
}
else
{
// The buffer is bigger than the remaining stream size
TIMER_WRAP_GROUP("StreamJustRead", streamPtr_->read((char*)(binReader_.exposeDataPtr()), fileBytesRemaining_));
streamPtr_->read((char*)(binReader_.exposeDataPtr()), fileBytesRemaining_);
binReader_.resize(fileBytesRemaining_);
fileBytesRemaining_ = 0;
}
Expand All @@ -1233,18 +1234,17 @@ class BinaryStreamBuffer
if(fileBytesRemaining_ > numBytes)
{
// Enough data left in the stream to fill the entire buffer
TIMER_WRAP_GROUP("StreamJustRead", streamPtr_->read((char*)putNewDataPtr, numBytes));
streamPtr_->read((char*)putNewDataPtr, numBytes);
fileBytesRemaining_ -= numBytes;
}
else
{
// The buffer is bigger than the remaining stream size
TIMER_WRAP_GROUP("StreamJustRead", streamPtr_->read((char*)putNewDataPtr, fileBytesRemaining_));
streamPtr_->read((char*)putNewDataPtr, fileBytesRemaining_);
binReader_.resize(fileBytesRemaining_+ prevBufSizeRemain);
fileBytesRemaining_ = 0;
}
}
TIMER_STOP("Stream Pull");

return true;
}
Expand Down
16 changes: 11 additions & 5 deletions cppForSwig/BlockUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2601,14 +2601,20 @@ uint32_t BlockDataManager_FileRefs::parseEntireBlockchain(uint32_t cacheSize)

bool alreadyRead8B = false;
uint32_t nextBlkSize;
TIMER_START("while(bsb.streamPull())");
bool isEOF = false;
BinaryData firstFour(4);
while(bsb.streamPull())
{
while(bsb.reader().getSizeRemaining() > 8)
{
if(!alreadyRead8B)
{
bsb.reader().advance(4);
bsb.reader().get_BinaryData(firstFour, 4);
if(firstFour!=MagicBytes_)
{
isEOF = true;
break;
}
nextBlkSize = bsb.reader().get_uint32_t();
bytesReadSoFar_ += 8;
}
Expand All @@ -2626,10 +2632,10 @@ uint32_t BlockDataManager_FileRefs::parseEntireBlockchain(uint32_t cacheSize)
bytesReadSoFar_ += nextBlkSize;
bsb.reader().advance(nextBlkSize);
}

if(isEOF)
break;
}
//globalCache.openFile(fnum-1, blkfile);
TIMER_STOP("while(bsb.streamPull())");

filesize = BtcUtils::GetFileSize(blkfile);
}

Expand Down
4 changes: 4 additions & 0 deletions versions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
# about the latest version. This is a good way to document progress,
# anyway...

#-------------------------------------------------------------------------------
VERSION 0.86.4
- Bugfix: P2Pool Transactions
Importing wallets with P2Pool transactions no long crash Armory

#-------------------------------------------------------------------------------
VERSION 0.86.3
Expand Down

0 comments on commit 88519ba

Please sign in to comment.