diff --git a/src/SerializedTransaction.cpp b/src/SerializedTransaction.cpp index 99ceda0fb3..dda530c453 100644 --- a/src/SerializedTransaction.cpp +++ b/src/SerializedTransaction.cpp @@ -12,7 +12,7 @@ SerializedTransaction::SerializedTransaction(TransactionType type) : mType(type) mMiddleTxn.giveObject(new STAccount("SourceAccount")); mMiddleTxn.giveObject(new STUInt32("Sequence")); mMiddleTxn.giveObject(new STUInt16("Type", static_cast(type))); - mMiddleTxn.giveObject(new STAmount("Fee")); + mMiddleTxn.giveObject(new STUInt64("Fee")); mInnerTxn = STObject(mFormat->elements, "InnerTransaction"); } @@ -42,7 +42,7 @@ SerializedTransaction::SerializedTransaction(SerializerIterator& sit, int length Log(lsERROR) << "Transaction has invalid type"; throw std::runtime_error("Transaction has invalid type"); } - mMiddleTxn.giveObject(new STAmount("Fee", sit.get64())); + mMiddleTxn.giveObject(new STUInt64("Fee", sit.get64())); mInnerTxn = STObject(mFormat->elements, sit, "InnerTransaction"); } @@ -149,18 +149,18 @@ void SerializedTransaction::setSignature(const std::vector& sig) mSignature.setValue(sig); } -STAmount SerializedTransaction::getTransactionFee() const +uint64 SerializedTransaction::getTransactionFee() const { - const STAmount* v = dynamic_cast(mMiddleTxn.peekAtPIndex(TransactionIFee)); + const STUInt64* v = dynamic_cast(mMiddleTxn.peekAtPIndex(TransactionIFee)); if (!v) throw std::runtime_error("corrupt transaction"); - return v->getNValue(); + return v->getValue(); } -void SerializedTransaction::setTransactionFee(STAmount saFee) +void SerializedTransaction::setTransactionFee(uint64 fee) { - STAmount* v = dynamic_cast(mMiddleTxn.getPIndex(TransactionIFee)); + STUInt64* v = dynamic_cast(mMiddleTxn.getPIndex(TransactionIFee)); if (!v) throw std::runtime_error("corrupt transaction"); - v->setNValue(saFee); + v->setValue(fee); } uint32 SerializedTransaction::getSequence() const diff --git a/src/SerializedTransaction.h b/src/SerializedTransaction.h index 53093fd38a..24d412b679 100644 --- a/src/SerializedTransaction.h +++ b/src/SerializedTransaction.h @@ -44,8 +44,8 @@ public: uint256 getSigningHash() const; TransactionType getTxnType() const { return mType; } - STAmount getTransactionFee() const; - void setTransactionFee(STAmount saFee); + uint64 getTransactionFee() const; + void setTransactionFee(uint64 fee); const NewcoinAddress& getSourceAccount() const { return mSourceAccount; } std::vector getSigningPubKey() const;