From b8333f8d92734b73b7cb9d91d9524acef2ec70a9 Mon Sep 17 00:00:00 2001 From: Arthur Britto Date: Thu, 17 May 2012 20:33:14 -0700 Subject: [PATCH] Remove obsolete TargetLedger support from TransactionFromats. --- src/Transaction.cpp | 15 +++------------ src/Transaction.h | 5 +---- src/TransactionFormats.cpp | 15 ++++++--------- 3 files changed, 10 insertions(+), 25 deletions(-) diff --git a/src/Transaction.cpp b/src/Transaction.cpp index cf76b88b5d..78f6357aee 100644 --- a/src/Transaction.cpp +++ b/src/Transaction.cpp @@ -57,8 +57,7 @@ Transaction::Transaction( const NewcoinAddress& naSourceAccount, uint32 uSeq, uint64 uFee, - uint32 uSourceTag, - uint32 uLedger) : + uint32 uSourceTag) : mStatus(NEW) { mAccountFrom = naSourceAccount; @@ -79,12 +78,6 @@ Transaction::Transaction( mTransaction->makeITFieldPresent(sfSourceTag); mTransaction->setITFieldU32(sfSourceTag, uSourceTag); } - - if (uLedger) - { - mTransaction->makeITFieldPresent(sfTargetLedger); - mTransaction->setITFieldU32(sfTargetLedger, uLedger); - } } bool Transaction::sign(const NewcoinAddress& naAccountPrivate) @@ -179,13 +172,12 @@ Transaction::pointer Transaction::sharedCreate( uint32 uSeq, uint64 uFee, uint32 uSourceTag, - uint32 uLedger, const NewcoinAddress& naCreateAccountID, uint64 uFund) { pointer tResult = boost::make_shared(ttPAYMENT, naPublicKey, naSourceAccount, - uSeq, uFee, uSourceTag, uLedger); + uSeq, uFee, uSourceTag); return tResult->setCreate(naPrivateKey, naCreateAccountID, uFund); } @@ -213,13 +205,12 @@ Transaction::pointer Transaction::sharedPayment( uint32 uSeq, uint64 uFee, uint32 uSourceTag, - uint32 uLedger, const NewcoinAddress& toAccount, uint64 uAmount) { pointer tResult = boost::make_shared(ttPAYMENT, naPublicKey, naSourceAccount, - uSeq, uFee, uSourceTag, uLedger); + uSeq, uFee, uSourceTag); return tResult->setPayment(naPrivateKey, toAccount, uAmount); } diff --git a/src/Transaction.h b/src/Transaction.h index eb6c86703f..3f114e0b71 100644 --- a/src/Transaction.h +++ b/src/Transaction.h @@ -74,8 +74,7 @@ public: const NewcoinAddress& naSourceAccount, // To identify the paying account. uint32 uSeq, // To order transactions. uint64 uFee, // Transaction fee. - uint32 uSourceTag, // User call back value. - uint32 uLedger=0); + uint32 uSourceTag); // User call back value. // Claim a wallet. static Transaction::pointer sharedClaim( @@ -93,7 +92,6 @@ public: uint32 uSeq, uint64 uFee, uint32 uSourceTag, - uint32 uLedger, const NewcoinAddress& naCreateAccountID, // Account to create. uint64 uFund); // Initial funds in XNC. @@ -104,7 +102,6 @@ public: uint32 uSeq, uint64 uFee, uint32 uSourceTag, - uint32 uLedger, const NewcoinAddress& toAccount, uint64 uAmount); diff --git a/src/TransactionFormats.cpp b/src/TransactionFormats.cpp index 070233965a..902aff111e 100644 --- a/src/TransactionFormats.cpp +++ b/src/TransactionFormats.cpp @@ -11,8 +11,7 @@ TransactionFormat InnerTxnFormats[]= { S_FIELD(Amount), STI_AMOUNT, SOE_REQUIRED, 0 }, { S_FIELD(Currency), STI_HASH160, SOE_IFFLAG, 1 }, { S_FIELD(SourceTag), STI_UINT32, SOE_IFFLAG, 2 }, - { S_FIELD(TargetLedger), STI_UINT32, SOE_IFFLAG, 4 }, - { S_FIELD(InvoiceID), STI_HASH256, SOE_IFFLAG, 8 }, + { S_FIELD(InvoiceID), STI_HASH256, SOE_IFFLAG, 4 }, { S_FIELD(Extensions), STI_TL, SOE_IFFLAG, 0x02000000 }, { sfInvalid, NULL, STI_DONE, SOE_NEVER, -1 } } }, @@ -32,8 +31,7 @@ TransactionFormat InnerTxnFormats[]= { S_FIELD(Currency), STI_HASH160, SOE_IFFLAG, 1 }, { S_FIELD(SourceTag), STI_UINT32, SOE_IFFLAG, 2 }, { S_FIELD(Destination), STI_ACCOUNT, SOE_IFFLAG, 4 }, - { S_FIELD(TargetLedger), STI_UINT32, SOE_IFFLAG, 8 }, - { S_FIELD(Identifier), STI_VL, SOE_IFFLAG, 16 }, + { S_FIELD(Identifier), STI_VL, SOE_IFFLAG, 8 }, { S_FIELD(Extensions), STI_TL, SOE_IFFLAG, 0x02000000 }, { sfInvalid, NULL, STI_DONE, SOE_NEVER, -1 } } }, @@ -45,9 +43,8 @@ TransactionFormat InnerTxnFormats[]= { S_FIELD(CurrencyOut), STI_HASH160, SOE_IFFLAG, 4 }, { S_FIELD(SourceTag), STI_UINT32, SOE_IFFLAG, 8 }, { S_FIELD(Destination), STI_ACCOUNT, SOE_IFFLAG, 16 }, - { S_FIELD(TargetLedger), STI_UINT32, SOE_IFFLAG, 32 }, - { S_FIELD(ExpireLedger), STI_UINT32, SOE_IFFLAG, 64 }, - { S_FIELD(Identifier), STI_VL, SOE_IFFLAG, 128 }, + { S_FIELD(ExpireLedger), STI_UINT32, SOE_IFFLAG, 32 }, + { S_FIELD(Identifier), STI_VL, SOE_IFFLAG, 64 }, { S_FIELD(Extensions), STI_TL, SOE_IFFLAG, 0x02000000 }, { sfInvalid, NULL, STI_DONE, SOE_NEVER, -1 } } }, @@ -57,9 +54,9 @@ TransactionFormat InnerTxnFormats[]= TransactionFormat* getTxnFormat(TransactionType t) { TransactionFormat* f = InnerTxnFormats; - while(f->t_name != NULL) + while (f->t_name != NULL) { - if(f->t_type == t) return f; + if (f->t_type == t) return f; ++f; } return NULL;