Here's another little feature I've made, which could be useful to others, perhaps?
This mod adds a 'safety limit', i.e. an amount above which a payment will not get sent even
if you have the funds available.
This is just a little protection layer to keep yourself from accidentally sending your
whole balance because of a typo (misplaced decimal points, etc) or if you happen
to be tired, distracted, or drunk when making a payment
diff of wallet.py:
262d261
< self.saf = 1000000000
631d629
< 'saf':self.saf,
675d672
< self.saf = d.get('saf',1000000000)
diff of gui_qt.py:
496c496
< if inputs and amount < self.wallet.saf :
---
> if inputs:
566,569c566
< if amount >= self.wallet.saf:
< QMessageBox.warning(self, "Message", "Cancelled: The amount is above the safety limit.")
< else:
< tx = self.wallet.mktx( to_address, amount, label, password, fee)
---
> tx = self.wallet.mktx( to_address, amount, label, password, fee)
1172c1169
<
---
>
1205,1211d1201
<
< saf_e = QLineEdit()
< saf_e.setText("%s"% str( Decimal( self.wallet.saf)/100000000 ) )
< grid.addWidget(QLabel(_('Safety cap')), 4, 0)
< grid.addWidget(HelpButton(_('This is a safety measure that limits the amount that may be sent in a single transaction.')), 4, 2)
< grid.addWidget(saf_e, 4, 1)
< saf_e.textChanged.connect(lambda: numbify(saf_e,False))
1214c1204
< grid.addWidget(cb, 5, 0)
---
> grid.addWidget(cb, 4, 0)
1220c1210
< grid.addWidget(usechange_cb, 6, 0)
---
> grid.addWidget(usechange_cb, 5, 0)
1233,1235c1223,1225
< grid.addWidget(QLabel(_('Gap limit')), 7, 0)
< grid.addWidget(gap_e, 7, 1)
< grid.addWidget(HelpButton(msg), 7, 2)
---
> grid.addWidget(QLabel(_('Gap limit')), 6, 0)
> grid.addWidget(gap_e, 6, 1)
> grid.addWidget(HelpButton(msg), 6, 2)
1255,1265d1244
<
< saf = unicode(saf_e.text())
< try:
< saf = int( 100000000 * Decimal(saf) )
< except:
< QMessageBox.warning(self, _('Error'), _('Invalid value') +': %s'%saf, _('OK'))
< return
<
< if self.wallet.saf != saf:
< self.wallet.saf = saf
< self.wallet.save()