diff --git a/src/SerializeProto.h b/src/SerializeProto.h index 2b1050bb41..23a2260bb7 100644 --- a/src/SerializeProto.h +++ b/src/SerializeProto.h @@ -99,13 +99,14 @@ FIELD(PublicKey, VL, 1) FIELD(MessageKey, VL, 2) FIELD(SigningPubKey, VL, 3) - FIELD(Signature, VL, 4) + FIELD(TxnSignature, VL, 4) FIELD(Generator, VL, 5) - FIELD(Domain, VL, 6) - FIELD(FundCode, VL, 7) - FIELD(RemoveCode, VL, 8) - FIELD(ExpireCode, VL, 9) - FIELD(CreateCode, VL, 10) + FIELD(Signature, VL, 6) + FIELD(Domain, VL, 7) + FIELD(FundCode, VL, 8) + FIELD(RemoveCode, VL, 9) + FIELD(ExpireCode, VL, 10) + FIELD(CreateCode, VL, 11) // account FIELD(Account, ACCOUNT, 1) @@ -129,4 +130,5 @@ // array of objects // ARRAY/1 is reserved for end of array FIELD(SigningAccounts, ARRAY, 2) - FIELD(Signatures, ARRAY, 3) + FIELD(TxnSignatures, ARRAY, 3) + FIELD(Signatures, ARRAY, 4) diff --git a/src/SerializedLedger.cpp b/src/SerializedLedger.cpp index 5b153d11f3..4ba43bd1e3 100644 --- a/src/SerializedLedger.cpp +++ b/src/SerializedLedger.cpp @@ -30,7 +30,11 @@ SerializedLedgerEntry::SerializedLedgerEntry(const Serializer& s, const uint256& throw std::runtime_error("invalid ledger entry type"); mType = mFormat->t_type; if (!setType(mFormat->elements)) + { + Log(lsWARNING) << "Ledger entry not valid for type " << mFormat->t_name; + Log(lsWARNING) << getJson(0); throw std::runtime_error("ledger entry not valid for type"); + } } SerializedLedgerEntry::SerializedLedgerEntry(LedgerEntryType type) : STObject(sfLedgerEntry), mType(type) diff --git a/src/SerializedObject.cpp b/src/SerializedObject.cpp index c810c0de4d..a2980efa21 100644 --- a/src/SerializedObject.cpp +++ b/src/SerializedObject.cpp @@ -250,7 +250,7 @@ void STObject::add(Serializer& s, bool withSigningFields) const if (it.getSType() != STI_NOTPRESENT) { SField::ref fName = it.getFName(); - if (withSigningFields || ((fName != sfSignature) && (fName != sfSignatures))) + if (withSigningFields || ((fName != sfTxnSignature) && (fName != sfTxnSignatures))) fields.insert(std::make_pair(it.getFName().fieldCode, &it)); } } diff --git a/src/SerializedTransaction.cpp b/src/SerializedTransaction.cpp index 1fe5109ce6..aca26946ca 100644 --- a/src/SerializedTransaction.cpp +++ b/src/SerializedTransaction.cpp @@ -94,7 +94,7 @@ std::vector SerializedTransaction::getSignature() const { try { - return getValueFieldVL(sfSignature); + return getValueFieldVL(sfTxnSignature); } catch (...) { @@ -106,14 +106,14 @@ void SerializedTransaction::sign(const NewcoinAddress& naAccountPrivate) { std::vector signature; naAccountPrivate.accountPrivateSign(getSigningHash(), signature); - setValueFieldVL(sfSignature, signature); + setValueFieldVL(sfTxnSignature, signature); } bool SerializedTransaction::checkSign(const NewcoinAddress& naAccountPublic) const { try { - return naAccountPublic.accountPublicVerify(getSigningHash(), getValueFieldVL(sfSignature)); + return naAccountPublic.accountPublicVerify(getSigningHash(), getValueFieldVL(sfTxnSignature)); } catch (...) { diff --git a/src/SerializedTransaction.h b/src/SerializedTransaction.h index 8153a76487..295d0eb3cb 100644 --- a/src/SerializedTransaction.h +++ b/src/SerializedTransaction.h @@ -39,7 +39,7 @@ public: // outer transaction functions / signature functions std::vector getSignature() const; - void setSignature(const std::vector& s) { setValueFieldVL(sfSignature, s); } + void setSignature(const std::vector& s) { setValueFieldVL(sfTxnSignature, s); } uint256 getSigningHash() const; TransactionType getTxnType() const { return mType; }