mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
39 lines
778 B
C++
39 lines
778 B
C++
#include "RegularKeySetTransactor.h"
|
|
#include "Log.h"
|
|
|
|
|
|
SETUP_LOG();
|
|
|
|
|
|
void RegularKeySetTransactor::calculateFee()
|
|
{
|
|
Transactor::calculateFee();
|
|
|
|
if ( !(mTxnAccount->getFlags() & lsfPasswordSpent) &&
|
|
(mSigningPubKey.getAccountID() == mTxnAccountID))
|
|
{ // flag is armed and they signed with the right account
|
|
|
|
mSourceBalance = mTxnAccount->getFieldAmount(sfBalance);
|
|
if(mSourceBalance < mFeeDue) mFeeDue = 0;
|
|
}
|
|
}
|
|
|
|
|
|
TER RegularKeySetTransactor::doApply()
|
|
{
|
|
std::cerr << "doRegularKeySet>" << std::endl;
|
|
|
|
if(mFeeDue.isZero())
|
|
{
|
|
mTxnAccount->setFlag(lsfPasswordSpent);
|
|
}
|
|
|
|
uint160 uAuthKeyID=mTxn.getFieldAccount160(sfRegularKey);
|
|
mTxnAccount->setFieldAccount(sfRegularKey, uAuthKeyID);
|
|
|
|
|
|
std::cerr << "doRegularKeySet<" << std::endl;
|
|
|
|
return tesSUCCESS;
|
|
}
|