@ -17,6 +17,7 @@
# include "ui_interface.h"
# include "ui_interface.h"
# include "util.h"
# include "util.h"
class CAccountingEntry ;
class CWalletTx ;
class CWalletTx ;
class CReserveKey ;
class CReserveKey ;
class CWalletDB ;
class CWalletDB ;
@ -143,6 +144,10 @@ public:
bool ChangeWalletPassphrase ( const SecureString & strOldWalletPassphrase , const SecureString & strNewWalletPassphrase ) ;
bool ChangeWalletPassphrase ( const SecureString & strOldWalletPassphrase , const SecureString & strNewWalletPassphrase ) ;
bool EncryptWallet ( const SecureString & strWalletPassphrase ) ;
bool EncryptWallet ( const SecureString & strWalletPassphrase ) ;
typedef std : : pair < CWalletTx * , CAccountingEntry * > TxPair ;
typedef std : : multimap < int64 , TxPair > TxItems ;
TxItems OrderedTxItems ( std : : string strAccount = " " ) ;
void MarkDirty ( ) ;
void MarkDirty ( ) ;
bool AddToWallet ( const CWalletTx & wtxIn ) ;
bool AddToWallet ( const CWalletTx & wtxIn ) ;
bool AddToWalletIfInvolvingMe ( const CTransaction & tx , const CBlock * pblock , bool fUpdate = false , bool fFindBlock = false ) ;
bool AddToWalletIfInvolvingMe ( const CTransaction & tx , const CBlock * pblock , bool fUpdate = false , bool fFindBlock = false ) ;
@ -351,6 +356,7 @@ public:
std : : vector < std : : pair < std : : string , std : : string > > vOrderForm ;
std : : vector < std : : pair < std : : string , std : : string > > vOrderForm ;
unsigned int fTimeReceivedIsTxTime ;
unsigned int fTimeReceivedIsTxTime ;
unsigned int nTimeReceived ; // time received by this node
unsigned int nTimeReceived ; // time received by this node
unsigned int nTimeSmart ;
char fFromMe ;
char fFromMe ;
std : : string strFromAccount ;
std : : string strFromAccount ;
std : : vector < char > vfSpent ; // which outputs are already spent
std : : vector < char > vfSpent ; // which outputs are already spent
@ -394,6 +400,7 @@ public:
vOrderForm . clear ( ) ;
vOrderForm . clear ( ) ;
fTimeReceivedIsTxTime = false ;
fTimeReceivedIsTxTime = false ;
nTimeReceived = 0 ;
nTimeReceived = 0 ;
nTimeSmart = 0 ;
fFromMe = false ;
fFromMe = false ;
strFromAccount . clear ( ) ;
strFromAccount . clear ( ) ;
vfSpent . clear ( ) ;
vfSpent . clear ( ) ;
@ -429,6 +436,9 @@ public:
pthis - > mapValue [ " spent " ] = str ;
pthis - > mapValue [ " spent " ] = str ;
WriteOrderPos ( pthis - > nOrderPos , pthis - > mapValue ) ;
WriteOrderPos ( pthis - > nOrderPos , pthis - > mapValue ) ;
if ( nTimeSmart )
pthis - > mapValue [ " timesmart " ] = strprintf ( " %u " , nTimeSmart ) ;
}
}
nSerSize + = SerReadWrite ( s , * ( CMerkleTx * ) this , nType , nVersion , ser_action ) ;
nSerSize + = SerReadWrite ( s , * ( CMerkleTx * ) this , nType , nVersion , ser_action ) ;
@ -449,15 +459,17 @@ public:
pthis - > vfSpent . push_back ( c ! = ' 0 ' ) ;
pthis - > vfSpent . push_back ( c ! = ' 0 ' ) ;
else
else
pthis - > vfSpent . assign ( vout . size ( ) , fSpent ) ;
pthis - > vfSpent . assign ( vout . size ( ) , fSpent ) ;
}
if ( fRead )
ReadOrderPos ( pthis - > nOrderPos , pthis - > mapValue ) ;
ReadOrderPos ( pthis - > nOrderPos , pthis - > mapValue ) ;
pthis - > nTimeSmart = mapValue . count ( " timesmart " ) ? ( unsigned int ) atoi64 ( pthis - > mapValue [ " timesmart " ] ) : 0 ;
}
pthis - > mapValue . erase ( " fromaccount " ) ;
pthis - > mapValue . erase ( " fromaccount " ) ;
pthis - > mapValue . erase ( " version " ) ;
pthis - > mapValue . erase ( " version " ) ;
pthis - > mapValue . erase ( " spent " ) ;
pthis - > mapValue . erase ( " spent " ) ;
pthis - > mapValue . erase ( " n " ) ;
pthis - > mapValue . erase ( " n " ) ;
pthis - > mapValue . erase ( " timesmart " ) ;
)
)
// marks certain txout's as spent
// marks certain txout's as spent