btnRecvBtc = QPushButton("Receive Bitcoins")
btnWltProps = QPushButton("Wallet Properties")
btnOfflineTx = QPushButton("Offline Transactions")
- btnDevTools = QPushButton("Expert Tools")
self.connect(btnWltProps, SIGNAL('clicked()'), self.execDlgWalletDetails)
self.connect(btnRecvBtc, SIGNAL('clicked()'), self.clickReceiveCoins)
self.connect(btnSendBtc, SIGNAL('clicked()'), self.clickSendBitcoins)
- self.connect(btnDevTools, SIGNAL('clicked()'), self.openToolsDlg)
self.connect(btnOfflineTx,SIGNAL('clicked()'), self.execOfflineTx)
verStr = 'Armory %s-alpha / %s User' % (getVersionString(BTCARMORY_VERSION), \
if self.usermode in (USERMODE.Advanced, USERMODE.Expert):
logoBtnFrame.append(btnOfflineTx)
logoBtnFrame.append(lblInfo)
- #logoBtnFrame.append(btnDevTools)
logoBtnFrame.append('Stretch')
btnFrame = makeVertFrame(logoBtnFrame, STYLE_SUNKEN)
# just seeing the updated balance when they get back to the main
# screen
if not TheBDM.getTxByHash(newTxHash).isInitialized():
- #failedFN = os.path.join(ARMORY_HOME_DIR, 'failedtx.bin')
- #f = open(failedFN, 'ab')
- #bp = BinaryPacker()
- #bp.put(UINT64, long(RightNow()))
- #f.write(bp.getBinaryString())
- #f.write(pytx.serialize())
- #f.close()
LOGERROR('Transaction was not accepted by the Satoshi client')
LOGERROR('Raw transaction:')
LOGRAWDATA(pytx.serialize(), logging.ERROR)
LOGERROR('Transaction details')
LOGPPRINT(pytx, logging.ERROR)
QMessageBox.warning(self, 'Invalid Transaction', \
- 'The transaction that you just executed, does not '
- 'appear to have been accepted by the Bitcoin network. '
- 'This sometimes happens with legitimate transactions '
- 'when a fee is not included but was required. Sometimes '
- 'it will happen when you have zero-confirmation transactions '
- 'waiting to get into the blockchain. Or it is due to a '
- 'bug in the Armory software. '
- '<br><br>Please consider reporting this error the the Armory '
- 'developers. All information the developers need is '
- 'in the following file: <br><br>' + ARMORY_LOG_FILE + '<br><br>'
- 'This file never '
- 'contains any sensitive data, so it is safe to send to '
- 'the Armory developers for help diagnosing the issue, and '
- 'fixing any potential bugs. '
- 'Please email the above file to '
- 'alan.reiner@gmail.com along with any information you can '
- 'provide about the context of this failed transaction.', QMessageBox.Ok)
+ 'The transaction that you just executed, does not '
+ 'appear to have been accepted by the Bitcoin network. '
+ 'This sometimes happens with legitimate transactions '
+ 'when a fee is not included but was required. Sometimes it '
+ 'is caused by network issues. '
+ 'Or it is due to a bug in the Armory software. '
+ '<br><br>Please consider reporting this error the the Armory '
+ 'developers. If you do, please use '
+ '"<b>File</b>"-->"<b>Export Log File</b>" '
+ 'from the main window to make a copy of your log file to send '
+ 'via email to alan.reiner@gmail.com. Please also include any '
+ 'information you might consider relevant about the context of '
+ 'this failed transaction.' , \
+ QMessageBox.Ok)
reactor.callLater(2, sendGetDataMsg)
reactor.callLater(4, checkForTxInBDM)
rootLogger = logging.getLogger('')
if CLI_OPTIONS.doDebug:
# Drop it all one level: console will see INFO, file will see DEBUG
- DEFAULT_FILE_LOGTHRESH -= 10
- DEFAULT_PPRINT_LOGTHRESH -= 10
+ DEFAULT_CONSOLE_LOGTHRESH -= 10
+ DEFAULT_FILE_LOGTHRESH -= 10
if CLI_OPTIONS.logDisable:
theObj.pprint()
printedStr = sys.stdout.getStr()
sys.stdout = sys.__stdout__
- stkOneUp = traceback.extract_stack()[1]
- filename = stkOneUp[0]
- methodLine = stkOneUp[1]
- methodStr = '(PPRINT from %s::%d)\n' % (filename,methodLine)
+ stkOneUp = traceback.extract_stack()[-2]
+ filename,method = stkOneUp[0], stkOneUp[1]
+ methodStr = '(PPRINT from %s:%d)\n' % (filename,method)
logging.log(loglevel, methodStr + printedStr)
# For super-debug mode, we'll write out raw data
def LOGRAWDATA(rawStr, loglevel=DEFAULT_RAWDATA_LOGLEVEL):
dtype = isLikelyDataType(rawStr)
- stkOneUp = traceback.extract_stack()[1]
- filename = stkOneUp[0]
- methodLine = stkOneUp[1]
- methodStr = '(PPRINT from %s::%d)\n' % (filename,methodLine)
+ stkOneUp = traceback.extract_stack()[-2]
+ filename,method = stkOneUp[0], stkOneUp[1]
+ methodStr = '(PPRINT from %s:%d)\n' % (filename,method)
pstr = rawStr[:]
if dtype==DATATYPE.Binary:
pstr = binary_to_hex(rawStr)
- pstr = prettyHex(pstr, indent=' ')
+ pstr = prettyHex(pstr, indent=' ', withAddr=False)
elif dtype==DATATYPE.Hex:
- pstr = prettyHex(pstr, indent=' ')
+ pstr = prettyHex(pstr, indent=' ', withAddr=False)
+ else:
+ pstr = ' ' + '\n '.join(pstr.split('\n'))
logging.log(loglevel, methodStr + pstr)
-DATATYPE = enum("Binary", "ASCII", 'Base58', 'Hex')
+DATATYPE = enum("Binary", 'Base58', 'Hex')
def isLikelyDataType(theStr, dtype=None):
"""
This really shouldn't be used on short strings. Hence
ret = None
hexCount = sum([1 if c in BASE16CHARS else 0 for c in theStr])
b58Count = sum([1 if c in BASE58CHARS else 0 for c in theStr])
- ascCount = sum([1 if 32<=ord(c)<=126 else 0 for c in theStr])
canBeHex = hexCount==len(theStr)
canBeB58 = b58Count==len(theStr)
if canBeHex:
ret = DATATYPE.Hex
elif canBeB58 and not canBeHex:
ret = DATATYPE.Base58
- elif ascCount==len(theStr):
- ret = DATATYPE.ASCII
else:
ret = DATATYPE.Binary
endline = ('-------END-TRANSACTION-' + self.uniqueB58 + '-----').ljust(80,'-')
txdpLines.append( endline )
- self.pprint()
+ LOGPPRINT(self, logging.DEBUG)
return '\n'.join(txdpLines)
if kdfUnit.lower()=='kb':
self.kdfBytes = round(float(kdfM))*(1024.0)
- print 'KDF takes', self.kdfSec, 'sec and', self.kdfBytes, 'bytes'
+ LOGINFO('KDF takes', self.kdfSec, 'sec and', self.kdfBytes, 'bytes')
except:
QMessageBox.critical(self, 'Invalid KDF Parameters', \
'Please specify time with units, such as '
'fixed automatically. Please double-check that you entered the '
'text exactly as it appears on the wallet-backup page.', \
QMessageBox.Ok)
- print 'BadData!'
+ LOGERROR('Error in wallet restore field')
self.labels[i].setText('<font color="red">'+str(self.labels[i].text())+'</font>')
return
if not fixedData==data:
thepathBackup = wlt.getWalletPath('backup')
if self.radioWatch.isChecked():
- print '***Converting to watching-only wallet'
+ LOGINFO('***Converting to watching-only wallet')
newWltPath = wlt.getWalletPath('WatchOnly')
wlt.forkOnlineWallet(newWltPath, wlt.labelName, wlt.labelDescr)
newWlt = PyBtcWallet().readWalletFile(newWltPath)
self.main.statusBar().showMessage( \
'Wallet %s was replaced with a watching-only wallet.' % wltID, 10000)
elif self.radioDelete.isChecked():
- print '***Completely deleting wallet'
+ LOGINFO('***Completely deleting wallet')
os.remove(thepath)
os.remove(thepathBackup)
self.main.removeWalletFromApplication(wltID)
finalTx = txdp.prepareFinalTx()
if len(commentStr)>0:
self.wlt.setComment(finalTx.getHash(), commentStr)
- print binary_to_hex(finalTx.serialize())
self.main.broadcastTransaction(finalTx)
self.accept()
try:
self.selectedBehavior = ''
if totalChange>0:
self.change160 = self.determineChangeAddr(utxoSelect)
- print 'Change address behavior: ', self.selectedBehavior
+ LOGINFO('Change address behavior: ', self.selectedBehavior)
if not self.change160:
return
recipValuePairs.append( [self.change160, totalChange])
filename = self.main.getFileSave('Save Transaction', \
['Transactions (*.signed.tx *.unsigned.tx)'], \
defaultFilename)
- print "Default:", defaultFilename
- print filename
+ LOGINFO('Saved transaction file: %s', filename)
if len(str(filename))>0:
f = open(filename, 'w')
def loadTx(self):
filename = self.main.getFileLoad('Load Transaction', \
['Transactions (*.signed.tx *.unsigned.tx)'])
- print filename
+
if len(str(filename))>0:
+ LOGINFO('Selected transaction file to load: %s', filename)
f = open(filename, 'r')
self.txtTxDP.setText(f.read())
f.close()
txOutToList[-1].append(pubs)
txOutToList[-1].append(mstype[0]) # this is M (from M-of-N)
elif scrType in (TXOUT_SCRIPT_OP_EVAL,):
- print 'No OP_EVAL support yet!'
+ LOGERROR('OP_EVAL doesn\'t exist anymore. How did we get here?')
txOutToList[-1].append(txout.binScript)
elif scrType in (TXOUT_SCRIPT_UNKNOWN,):
- #print 'Unknown TxOut type'
+ LOGERROR('Unknown TxOut type')
txOutToList[-1].append(txout.binScript)
else:
- print 'How did we miss TXOUT_SCRIPT_UNKNOWN txout type?'
+ LOGERROR('Unrecognized txout script that isn\'t TXOUT_SCRIPT_UNKNOWN...?')
sumTxOut += txout.value
txinFromList[-1].append(prevTxOut.getParentTxPtr().getThisHash())
txinFromList[-1].append(prevTxOut.getIndex())
else:
- print 'How did we get a bad parent pointer? (extractTxInfo)'
+ LOGERROR('How did we get a bad parent pointer? (extractTxInfo)')
prevTxOut.pprint()
txinFromList[-1].append('')
txinFromList[-1].append('')
elif 'descend' in sortTxt:
ledgerTable.sort(key=lambda x: x[LEDGERCOLS.TxHash], reverse=True)
else:
- print '***ERROR: bad sort string!?'
+ LOGERROR('***ERROR: bad sort string!?')
return