@@ -641,68 +641,16 @@ class CWallet : public CCryptoKeyStore, public CValidationInterface
641
641
642
642
isminetype IsMine (const CTxIn& txin) const ;
643
643
CAmount GetDebit (const CTxIn& txin, const isminefilter& filter) const ;
644
- isminetype IsMine (const CTxOut& txout) const
645
- {
646
- return ::IsMine (*this , txout.scriptPubKey );
647
- }
648
- CAmount GetCredit (const CTxOut& txout, const isminefilter& filter) const
649
- {
650
- if (!MoneyRange (txout.nValue ))
651
- throw std::runtime_error (" CWallet::GetCredit(): value out of range" );
652
- return ((IsMine (txout) & filter) ? txout.nValue : 0 );
653
- }
644
+ isminetype IsMine (const CTxOut& txout) const ;
645
+ CAmount GetCredit (const CTxOut& txout, const isminefilter& filter) const ;
654
646
bool IsChange (const CTxOut& txout) const ;
655
- CAmount GetChange (const CTxOut& txout) const
656
- {
657
- if (!MoneyRange (txout.nValue ))
658
- throw std::runtime_error (" CWallet::GetChange(): value out of range" );
659
- return (IsChange (txout) ? txout.nValue : 0 );
660
- }
661
- bool IsMine (const CTransaction& tx) const
662
- {
663
- BOOST_FOREACH (const CTxOut& txout, tx.vout )
664
- if (IsMine (txout))
665
- return true ;
666
- return false ;
667
- }
647
+ CAmount GetChange (const CTxOut& txout) const ;
648
+ bool IsMine (const CTransaction& tx) const ;
668
649
/* * should probably be renamed to IsRelevantToMe */
669
- bool IsFromMe (const CTransaction& tx) const
670
- {
671
- return (GetDebit (tx, ISMINE_ALL) > 0 );
672
- }
673
- CAmount GetDebit (const CTransaction& tx, const isminefilter& filter) const
674
- {
675
- CAmount nDebit = 0 ;
676
- BOOST_FOREACH (const CTxIn& txin, tx.vin )
677
- {
678
- nDebit += GetDebit (txin, filter);
679
- if (!MoneyRange (nDebit))
680
- throw std::runtime_error (" CWallet::GetDebit(): value out of range" );
681
- }
682
- return nDebit;
683
- }
684
- CAmount GetCredit (const CTransaction& tx, const isminefilter& filter) const
685
- {
686
- CAmount nCredit = 0 ;
687
- BOOST_FOREACH (const CTxOut& txout, tx.vout )
688
- {
689
- nCredit += GetCredit (txout, filter);
690
- if (!MoneyRange (nCredit))
691
- throw std::runtime_error (" CWallet::GetCredit(): value out of range" );
692
- }
693
- return nCredit;
694
- }
695
- CAmount GetChange (const CTransaction& tx) const
696
- {
697
- CAmount nChange = 0 ;
698
- BOOST_FOREACH (const CTxOut& txout, tx.vout )
699
- {
700
- nChange += GetChange (txout);
701
- if (!MoneyRange (nChange))
702
- throw std::runtime_error (" CWallet::GetChange(): value out of range" );
703
- }
704
- return nChange;
705
- }
650
+ bool IsFromMe (const CTransaction& tx) const ;
651
+ CAmount GetDebit (const CTransaction& tx, const isminefilter& filter) const ;
652
+ CAmount GetCredit (const CTransaction& tx, const isminefilter& filter) const ;
653
+ CAmount GetChange (const CTransaction& tx) const ;
706
654
void SetBestChain (const CBlockLocator& loc);
707
655
708
656
DBErrors LoadWallet (bool & fFirstRunRet );
0 commit comments