diff --git a/src/SerializedTransaction.cpp b/src/SerializedTransaction.cpp index 982102790a..67a067ea2e 100644 --- a/src/SerializedTransaction.cpp +++ b/src/SerializedTransaction.cpp @@ -8,6 +8,7 @@ SerializedTransaction::SerializedTransaction(TransactionType type) : mType(type) mMiddleTxn.giveObject(new STUInt32("Magic", TransactionMagic)); mMiddleTxn.giveObject(new STVariableLength("SigningPubKey")); + mMiddleTxn.giveObject(new STAccount("SourceAccount")); mMiddleTxn.giveObject(new STUInt32("Sequence")); mMiddleTxn.giveObject(new STUInt8("Type", static_cast(type))); mMiddleTxn.giveObject(new STUInt64("Fee")); @@ -29,6 +30,7 @@ SerializedTransaction::SerializedTransaction(SerializerIterator& sit, int length mMiddleTxn.giveObject(new STUInt32("Magic", TransactionMagic)); mMiddleTxn.giveObject(new STVariableLength("SigningPubKey", sit.getVL())); + mMiddleTxn.giveObject(new STAccount("SourceAccount", sit.getVL())); mMiddleTxn.giveObject(new STUInt32("Sequence", sit.get32())); mType = static_cast(sit.get32()); @@ -224,10 +226,9 @@ const NewcoinAddress& SerializedTransaction::setSourceAccount(const NewcoinAddre { mSourceAccount = naSource; - STHash160* v = dynamic_cast(mMiddleTxn.getPIndex(TransactionISourceID)); + STAccount* v = dynamic_cast(mMiddleTxn.getPIndex(TransactionISourceID)); if (!v) throw std::runtime_error("corrupt transaction"); - v->setValue(mSourceAccount.getAccountID()); - + v->setValueNCA(mSourceAccount); return mSourceAccount; } diff --git a/src/Transaction.cpp b/src/Transaction.cpp index 37fa0a8bfa..ef39a564c0 100644 --- a/src/Transaction.cpp +++ b/src/Transaction.cpp @@ -27,7 +27,6 @@ Transaction::Transaction(const NewcoinAddress& naPublicKey, const NewcoinAddress mTransaction->setSourceAccount(mAccountFrom); mTransaction->setSequence(iSeq); - assert(mTransaction->getSequence() != 0); mTransaction->setTransactionFee(100); // for now