fix problem sending the last cent with sub-cent fractional change
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@151 1a98c847-1fd6-4fd8-948a-caf3550aa51b
This commit is contained in:
parent
8555125a1a
commit
00728c24e7
3 changed files with 7 additions and 6 deletions
9
main.cpp
9
main.cpp
|
@ -2774,8 +2774,8 @@ void CallCPUID(int in, int& aret, int& cret)
|
||||||
asm (
|
asm (
|
||||||
"mov %2, %%eax; " // in into eax
|
"mov %2, %%eax; " // in into eax
|
||||||
"cpuid;"
|
"cpuid;"
|
||||||
"mov %%eax, %0;" // eax into ret
|
"mov %%eax, %0;" // eax into a
|
||||||
"mov %%ecx, %1;" // eax into ret
|
"mov %%ecx, %1;" // eax into c
|
||||||
:"=r"(a),"=r"(c) /* output */
|
:"=r"(a),"=r"(c) /* output */
|
||||||
:"r"(in) /* input */
|
:"r"(in) /* input */
|
||||||
:"%eax","%ecx" /* clobbered register */
|
:"%eax","%ecx" /* clobbered register */
|
||||||
|
@ -3311,7 +3311,8 @@ bool CreateTransaction(CScript scriptPubKey, int64 nValue, CWalletTx& wtxNew, CK
|
||||||
wtxNew.vout.push_back(CTxOut(nValueOut, scriptPubKey));
|
wtxNew.vout.push_back(CTxOut(nValueOut, scriptPubKey));
|
||||||
|
|
||||||
// Fill a vout back to self with any change
|
// Fill a vout back to self with any change
|
||||||
if (nValueIn > nTotalValue)
|
int64 nChange = nValueIn - nTotalValue;
|
||||||
|
if (nChange >= CENT)
|
||||||
{
|
{
|
||||||
// Note: We use a new key here to keep it from being obvious which side is the change.
|
// Note: We use a new key here to keep it from being obvious which side is the change.
|
||||||
// The drawback is that by not reusing a previous key, the change may be lost if a
|
// The drawback is that by not reusing a previous key, the change may be lost if a
|
||||||
|
@ -3330,7 +3331,7 @@ bool CreateTransaction(CScript scriptPubKey, int64 nValue, CWalletTx& wtxNew, CK
|
||||||
scriptChange.SetBitcoinAddress(keyRet.GetPubKey());
|
scriptChange.SetBitcoinAddress(keyRet.GetPubKey());
|
||||||
else
|
else
|
||||||
scriptChange << keyRet.GetPubKey() << OP_CHECKSIG;
|
scriptChange << keyRet.GetPubKey() << OP_CHECKSIG;
|
||||||
wtxNew.vout.push_back(CTxOut(nValueIn - nTotalValue, scriptChange));
|
wtxNew.vout.push_back(CTxOut(nChange, scriptChange));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fill a vout to the payee
|
// Fill a vout to the payee
|
||||||
|
|
|
@ -23,7 +23,7 @@ class CAutoFile;
|
||||||
static const unsigned int MAX_SIZE = 0x02000000;
|
static const unsigned int MAX_SIZE = 0x02000000;
|
||||||
|
|
||||||
static const int VERSION = 312;
|
static const int VERSION = 312;
|
||||||
static const char* pszSubVer = ".2";
|
static const char* pszSubVer = ".3";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
2
ui.cpp
2
ui.cpp
|
@ -184,7 +184,7 @@ int ThreadSafeMessageBox(const string& message, const string& caption, int style
|
||||||
|
|
||||||
bool ThreadSafeAskFee(int64 nFeeRequired, const string& strCaption, wxWindow* parent)
|
bool ThreadSafeAskFee(int64 nFeeRequired, const string& strCaption, wxWindow* parent)
|
||||||
{
|
{
|
||||||
if (nFeeRequired == 0 || fDaemon)
|
if (nFeeRequired < CENT || fDaemon)
|
||||||
return true;
|
return true;
|
||||||
string strMessage = strprintf(
|
string strMessage = strprintf(
|
||||||
_("This transaction is over the size limit. You can still send it for a fee of %s, "
|
_("This transaction is over the size limit. You can still send it for a fee of %s, "
|
||||||
|
|
Loading…
Add table
Reference in a new issue