From 1d140e8829747de25e23ca76156ac3e4b49b10ed Mon Sep 17 00:00:00 2001 From: JoelKatz Date: Mon, 7 Nov 2011 13:45:32 -0800 Subject: [PATCH] Sync Linux tweaks. --- Application.cpp | 2 +- BitcoinUtil.cpp | 9 +- BitcoinUtil.h | 5 +- KnownNodeList.h | 1 + Ledger.cpp | 29 +- Ledger.h | 9 +- LedgerHistory.cpp | 4 +- LedgerHistory.h | 4 +- LedgerMaster.h | 2 +- Makefile | 17 +- PackedMessage.h | 2 +- ValidationCollection.cpp | 18 +- bignum.h | 2 +- database/SqliteDatabase.cpp | 2 +- database/SqliteDatabase.h | 2 +- database/database.h | 2 +- database/linux/mysqldatabase.h | 2 +- newcoin.pb.h | 2596 ++++++++++++++++++++++++++++++++ uint256.h | 14 +- 19 files changed, 2674 insertions(+), 48 deletions(-) create mode 100644 newcoin.pb.h diff --git a/Application.cpp b/Application.cpp index c5b3a5aaab..1eff4609ae 100644 --- a/Application.cpp +++ b/Application.cpp @@ -34,7 +34,7 @@ Application::Application() void Application::run() { - string filename=strprintf("%sdata.db",theConfig.DATA_DIR); + string filename=strprintf("%sdata.db",theConfig.DATA_DIR.c_str()); theApp->setDB(new SqliteDatabase(filename.c_str())); mDatabase->connect(); diff --git a/BitcoinUtil.cpp b/BitcoinUtil.cpp index 86150203dc..1315b85033 100644 --- a/BitcoinUtil.cpp +++ b/BitcoinUtil.cpp @@ -1,9 +1,14 @@ #include "BitcoinUtil.h" #include -#include #include #include +#if defined(WIN32) || defined(WIN64) +#include +#else +#include +#endif + using namespace std; std::string gFormatStr("v1"); @@ -45,7 +50,7 @@ string strprintf(const char* format, ...) inline int64 GetPerformanceCounter() { int64 nCounter = 0; -#ifdef WIN32 +#if defined(WIN32) || defined(WIN64) QueryPerformanceCounter((LARGE_INTEGER*)&nCounter); #else timeval t; diff --git a/BitcoinUtil.h b/BitcoinUtil.h index a1a04a0123..5f01ead5a0 100644 --- a/BitcoinUtil.h +++ b/BitcoinUtil.h @@ -16,8 +16,11 @@ void RandAddSeedPerfmon(); static const unsigned int MAX_SIZE = 0x02000000; #define loop for (;;) +#define PAIR(t1, t2) pair - +#if !defined(WIN32) && !defined(WIN64) +#define _vsnprintf(a,b,c,d) vsnprintf(a,b,c,d) +#endif template diff --git a/KnownNodeList.h b/KnownNodeList.h index eb655d5c61..6609314ccb 100644 --- a/KnownNodeList.h +++ b/KnownNodeList.h @@ -2,6 +2,7 @@ #define __KNOWNNODELIST__ #include "vector" +#include class KnownNode { diff --git a/Ledger.cpp b/Ledger.cpp index 595b646de2..6d13bad1e9 100644 --- a/Ledger.cpp +++ b/Ledger.cpp @@ -49,9 +49,8 @@ newcoin::FullLedger* Ledger::createFullLedger() ledger->set_index(mIndex); ledger->set_hash(getHash().begin(),getHash().GetSerializeSize()); ledger->set_parenthash(mParentHash.begin(),mParentHash.GetSerializeSize()); - - pair >& account=pair >(); - BOOST_FOREACH(account,mAccounts) + + BOOST_FOREACH(PAIR(const uint160, Account)& account, mAccounts) { newcoin::Account* saveAccount=ledger->add_accounts(); saveAccount->set_address(account.first.begin(),account.first.GetSerializeSize()); @@ -99,7 +98,7 @@ Ledger::pointer Ledger::getParent() // TODO: we can optimize so the ledgers only hold the delta from the accepted ledger // TODO: check to make sure the ledger is consistent after we load it -bool Ledger::load(uint256& hash) +bool Ledger::load(const uint256& hash) { Database* db=theApp->getDB(); @@ -125,7 +124,8 @@ bool Ledger::load(uint256& hash) char buf[100]; sql="SELECT Transactions.* from Transactions,LedgerTransactionMap where Transactions.TransactionID=LedgerTransactionMap.TransactionID and LedgerTransactionMap.LedgerID="; - sql.append(itoa( db->getInt(0),buf,10) ); + sprintf(buf, "%d", db->getInt(0)); + sql.append(buf); if(db->executeSQL(sql.c_str())) { unsigned char tbuf[1000]; @@ -188,13 +188,15 @@ void Ledger::save() { // this ledger isn't in the DB char buf[100]; sql="INSERT INTO Ledgers (LedgerIndex,Hash,ParentHash,FeeHeld) values ("; - sql.append(itoa(mIndex,buf,10)); + sprintf(buf, "%d", mIndex); + sql.append(buf); sql.append(","); - sql.append(itoa(mIndex,buf,10)); + sql.append(buf); sql.append(","); - sql.append(itoa(mIndex,buf,10)); + sql.append(buf); sql.append(","); - sql.append(itoa(mFeeHeld,buf,10)); + sprintf(buf, "%llu", mFeeHeld); + sql.append(buf); sql.append(")"); sql="SELECT LAST_INSERT_ID()"; @@ -203,7 +205,7 @@ void Ledger::save() } } -int64 Ledger::getAmountHeld(uint160& address) +int64 Ledger::getAmountHeld(const uint160& address) { if(mAccounts.count(address)) { @@ -212,7 +214,7 @@ int64 Ledger::getAmountHeld(uint160& address) return(0); } -Ledger::Account* Ledger::getAccount(uint160& address) +Ledger::Account* Ledger::getAccount(const uint160& address) { if(mAccounts.count(address)) { @@ -495,8 +497,7 @@ void Ledger::mergeIn(Ledger::pointer other) void Ledger::correctAccounts() { - pair& fullAccount=pair(); - BOOST_FOREACH(fullAccount,mAccounts) + BOOST_FOREACH(PAIR(const uint160, Account)& fullAccount, mAccounts) { if(fullAccount.second.first <0 ) { @@ -507,7 +508,7 @@ void Ledger::correctAccounts() // Must look for transactions to discard to make this account positive // When we chuck transactions it might cause other accounts to need correcting -void Ledger::correctAccount(uint160& address) +void Ledger::correctAccount(const uint160& address) { list effected; diff --git a/Ledger.h b/Ledger.h index f973bef39d..184d3236a3 100644 --- a/Ledger.h +++ b/Ledger.h @@ -44,9 +44,8 @@ private: void hash(); void addTransactionAllowNeg(TransactionPtr trans); void correctAccounts(); - void correctAccount(uint160& address); + void correctAccount(const uint160& address); public: - typedef boost::shared_ptr pointer; Ledger(); Ledger(uint32 index); Ledger(newcoin::FullLedger& ledger); @@ -56,7 +55,7 @@ public: void mergeIn(Ledger::pointer other); void save(); - bool load(uint256& hash); + bool load(const uint256& hash); void recalculate(bool recursive=true); @@ -65,7 +64,7 @@ public: std::list& getTransactions(){ return(mTransactions); } bool hasTransaction(TransactionPtr trans); - int64 getAmountHeld(uint160& address); + int64 getAmountHeld(const uint160& address); void parentAddedTransaction(TransactionPtr cause); bool addTransaction(TransactionPtr trans,bool checkDuplicate=true); void addValidation(newcoin::Validation& valid); @@ -77,7 +76,7 @@ public: uint32 getValidSeqNum(){ return(mValidationSeqNum); } unsigned int getNumTransactions(){ return(mTransactions.size()); } std::map& getAccounts(){ return(mAccounts); } - Account* getAccount(uint160& address); + Account* getAccount(const uint160& address); newcoin::FullLedger* createFullLedger(); Ledger::pointer getParent(); diff --git a/LedgerHistory.cpp b/LedgerHistory.cpp index f02f65c3b7..d3611873b5 100644 --- a/LedgerHistory.cpp +++ b/LedgerHistory.cpp @@ -15,7 +15,7 @@ void LedgerHistory::load() } -bool LedgerHistory::loadLedger(uint256& hash) +bool LedgerHistory::loadLedger(const uint256& hash) { Ledger::pointer ledger=Ledger::pointer(new Ledger()); if(ledger->load(hash)) @@ -61,7 +61,7 @@ void LedgerHistory::addLedger(Ledger::pointer ledger) ledger->save(); } -Ledger::pointer LedgerHistory::getLedger(uint256& hash) +Ledger::pointer LedgerHistory::getLedger(const uint256& hash) { if(mAllLedgers.count(hash)) return(mAllLedgers[hash]); diff --git a/LedgerHistory.h b/LedgerHistory.h index ff8c6d507a..374e978b75 100644 --- a/LedgerHistory.h +++ b/LedgerHistory.h @@ -19,7 +19,7 @@ class LedgerHistory std::map mAllLedgers; bool loadAcceptedLedger(uint32 index); - bool loadLedger(uint256& hash); + bool loadLedger(const uint256& hash); public: void load(); @@ -27,7 +27,7 @@ public: void addAcceptedLedger(Ledger::pointer ledger); Ledger::pointer getAcceptedLedger(uint32 index); - Ledger::pointer getLedger(uint256& hash); + Ledger::pointer getLedger(const uint256& hash); }; #endif \ No newline at end of file diff --git a/LedgerMaster.h b/LedgerMaster.h index 91b0848025..81826f6d8a 100644 --- a/LedgerMaster.h +++ b/LedgerMaster.h @@ -43,7 +43,7 @@ public: uint32 getCurrentLedgerIndex(); Ledger::pointer getAcceptedLedger(uint32 index){ return(mLedgerHistory.getAcceptedLedger(index)); } - Ledger::pointer getLedger(uint256& hash){ return(mLedgerHistory.getLedger(hash)); } + Ledger::pointer getLedger(const uint256& hash){ return(mLedgerHistory.getLedger(hash)); } int64 getAmountHeld(std::string& addr); int64 getAmountHeld(uint160& addr); diff --git a/Makefile b/Makefile index 138886b064..43c18d8d75 100644 --- a/Makefile +++ b/Makefile @@ -4,10 +4,6 @@ CXX=g++ -I/packages/openssl-1.0.0/include -WXINCLUDEPATHS=$(shell wx-config --cxxflags) - -WXLIBS=$(shell wx-config --libs) - #USE_UPNP:=0 DEFS=-DNOPCH -DUSE_SSL @@ -18,11 +14,11 @@ LIBS= \ -l boost_filesystem-mt \ -l boost_program_options-mt \ -l boost_thread-mt \ + -l protobuf \ /packages/openssl-1.0.0/libssl.a /packages/openssl-1.0.0/libcrypto.a ifdef USE_UPNP - LIBS += -l miniupnpc - DEFS += -DUSE_UPNP=$(USE_UPNP) + LIBS += -l miniupnpc DEFS += -DUSE_UPNP=$(USE_UPNP) endif LIBS+= \ @@ -78,8 +74,8 @@ SRCS= \ CallRPC.cpp KnownNodeList.cpp PackedMessage.cpp RPCDoor.cpp ValidationCollection.cpp \ Config.cpp Ledger.cpp Peer.cpp RPCServer.cpp Wallet.cpp \ ConnectionPool.cpp LedgerHistory.cpp PeerDoor.cpp TimingService.cpp \ - Conversion.cpp LedgerMaster.cpp RequestParser.cpp TransactionBundle.cpp - + Conversion.cpp LedgerMaster.cpp RequestParser.cpp TransactionBundle.cpp util/pugixml.o +# database/linux/mysqldatabase.cpp database/database.cpp database/SqliteDatabase.cpp OBJS= $(SRCS:%.cpp=obj/%.o) cryptopp/obj/sha.o cryptopp/obj/cpu.o @@ -97,7 +93,10 @@ obj/%.o: %.cpp $(HEADERS) newcoin.pb.h: newcoin.proto protoc --cpp_out=. newcoin.proto -newcoind: newcoin.pb.h $(OBJS) +newcoin.pb.o: newcoin.pb.h + $(CXX) -c $(CXXFLAGS) -o $@ newcoin.pb.cc + +newcoind: newcoin.pb.o $(OBJS) $(CXX) $(CXXFLAGS) -o $@ $^ $(LIBS) clean: diff --git a/PackedMessage.h b/PackedMessage.h index ae17f8c28b..f4a20ff377 100644 --- a/PackedMessage.h +++ b/PackedMessage.h @@ -33,7 +33,7 @@ class PackedMessage : public boost::enable_shared_from_this std::vector mBuffer; public: - typedef boost::shared_ptr<::google::protobuf::Message> MessagePointer; + typedef boost::shared_ptr< ::google::protobuf::Message > MessagePointer; typedef boost::shared_ptr pointer; MessagePointer mMsg; diff --git a/ValidationCollection.cpp b/ValidationCollection.cpp index ee400ed3b6..5d65a9050f 100644 --- a/ValidationCollection.cpp +++ b/ValidationCollection.cpp @@ -49,7 +49,8 @@ bool ValidationCollection::hasValidation(uint32 ledgerIndex,uint160& hanko,uint3 string hankoStr; Database* db=theApp->getDB(); db->escape(hanko.begin(),hanko.GetSerializeSize(),hankoStr); - string sql=strprintf("SELECT ValidationID,seqnum from Validations where LedgerIndex=%d and hanko=%s",ledgerIndex,hankoStr); + string sql=strprintf("SELECT ValidationID,seqnum from Validations where LedgerIndex=%d and hanko=%s", + ledgerIndex,hankoStr.c_str()); if(db->executeSQL(sql.c_str())) { if(db->startIterRows()) @@ -195,6 +196,14 @@ void ValidationCollection::getValidations(uint32 ledgerIndex,vector&’ from + an rvalue of type ‘std::vector’ +invalid initialization of non-const reference of type ‘ValidationCollection::Group&’ from + an rvalue of type ‘ValidationCollection::Group’ + // look through all the validated hashes at that index // put the ledgers into compatible groups // Pick the group with the most votes @@ -205,9 +214,9 @@ bool ValidationCollection::getConsensusLedger(uint32 ledgerIndex, uint256& ourHa { unsigned int maxVotes=theConfig.MIN_VOTES_FOR_CONSENSUS; - vector& mostValid=vector(); + vector& mostValid=vector(); // DJS ERROR HERE vector< Group >& groups=mIndexGroups[ledgerIndex]; - Group& maxGroup=Group(); + Group& maxGroup=Group(); // DJS ERROR HERE BOOST_FOREACH(Group& group,groups) { if(group.mValidations.size()>maxVotes) @@ -230,4 +239,5 @@ bool ValidationCollection::getConsensusLedger(uint32 ledgerIndex, uint256& ourHa } return(ret); -} \ No newline at end of file +} +#endif diff --git a/bignum.h b/bignum.h index 56548b1ed2..72296106e2 100644 --- a/bignum.h +++ b/bignum.h @@ -9,7 +9,7 @@ #include #include -#include "bitcoinUtil.h" +#include "BitcoinUtil.h" class bignum_error : public std::runtime_error { diff --git a/database/SqliteDatabase.cpp b/database/SqliteDatabase.cpp index d6bb75c8c8..d29d9f1b5e 100644 --- a/database/SqliteDatabase.cpp +++ b/database/SqliteDatabase.cpp @@ -146,7 +146,7 @@ uint64 SqliteDatabase::getBigInt(int colIndex) BLOB literals are string literals containing hexadecimal data and preceded by a single "x" or "X" character. For example: X'53514C697465' */ -void SqliteDatabase::escape(unsigned char* start,int size,std::string& retStr) +void SqliteDatabase::escape(const unsigned char* start,int size,std::string& retStr) { retStr.clear(); diff --git a/database/SqliteDatabase.h b/database/SqliteDatabase.h index 4c3f8959fe..8211896907 100644 --- a/database/SqliteDatabase.h +++ b/database/SqliteDatabase.h @@ -37,6 +37,6 @@ public: int getBinary(int colIndex,unsigned char* buf,int maxSize); uint64 getBigInt(int colIndex); - void escape(unsigned char* start,int size,std::string& retStr); + void escape(const unsigned char* start,int size,std::string& retStr); }; \ No newline at end of file diff --git a/database/database.h b/database/database.h index 4bdb48eb20..553377aca2 100644 --- a/database/database.h +++ b/database/database.h @@ -29,7 +29,7 @@ public: std::string& getPass(){ return(mDBPass); } - virtual void escape(unsigned char* start,int size,std::string& retStr)=0; + virtual void escape(const unsigned char* start,int size,std::string& retStr)=0; // returns true if the query went ok virtual bool executeSQL(const char* sql)=0; diff --git a/database/linux/mysqldatabase.h b/database/linux/mysqldatabase.h index d7e4400123..1fb9cae106 100644 --- a/database/linux/mysqldatabase.h +++ b/database/linux/mysqldatabase.h @@ -3,7 +3,7 @@ #include "../database.h" #include "string/i4string.h" -#include "mysql.h" +#include "mysql/mysql.h" /* this maintains the connection to the database diff --git a/newcoin.pb.h b/newcoin.pb.h new file mode 100644 index 0000000000..2b8def3022 --- /dev/null +++ b/newcoin.pb.h @@ -0,0 +1,2596 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: newcoin.proto + +#ifndef PROTOBUF_newcoin_2eproto__INCLUDED +#define PROTOBUF_newcoin_2eproto__INCLUDED + +#include + +#include + +#if GOOGLE_PROTOBUF_VERSION < 2004000 +#error This file was generated by a newer version of protoc which is +#error incompatible with your Protocol Buffer headers. Please update +#error your headers. +#endif +#if 2004001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION +#error This file was generated by an older version of protoc which is +#error incompatible with your Protocol Buffer headers. Please +#error regenerate this file with a newer version of protoc. +#endif + +#include +#include +#include +#include +// @@protoc_insertion_point(includes) + +namespace newcoin { + +// Internal implementation detail -- do not call these. +void protobuf_AddDesc_newcoin_2eproto(); +void protobuf_AssignDesc_newcoin_2eproto(); +void protobuf_ShutdownFile_newcoin_2eproto(); + +class Hello; +class Transaction; +class Validation; +class Account; +class FullLedger; +class GetFullLedger; +class GetValidations; +class Contact; +class ProposeLedger; +class ErrorMsg; + +enum Type { + HELLO = 1, + TRANSACTION = 2, + FULL_LEDGER = 3, + VALIDATION = 4, + PROPOSE_LEDGER = 5, + GET_FULL_LEDGER = 6, + GET_VALIDATIONS = 7, + GET_CONTACTS = 8, + CONTACT = 9, + ERROR_MSG = 10 +}; +bool Type_IsValid(int value); +const Type Type_MIN = HELLO; +const Type Type_MAX = ERROR_MSG; +const int Type_ARRAYSIZE = Type_MAX + 1; + +const ::google::protobuf::EnumDescriptor* Type_descriptor(); +inline const ::std::string& Type_Name(Type value) { + return ::google::protobuf::internal::NameOfEnum( + Type_descriptor(), value); +} +inline bool Type_Parse( + const ::std::string& name, Type* value) { + return ::google::protobuf::internal::ParseNamedEnum( + Type_descriptor(), name, value); +} +// =================================================================== + +class Hello : public ::google::protobuf::Message { + public: + Hello(); + virtual ~Hello(); + + Hello(const Hello& from); + + inline Hello& operator=(const Hello& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const Hello& default_instance(); + + void Swap(Hello* other); + + // implements Message ---------------------------------------------- + + Hello* New() const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const Hello& from); + void MergeFrom(const Hello& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // required int32 version = 1; + inline bool has_version() const; + inline void clear_version(); + static const int kVersionFieldNumber = 1; + inline ::google::protobuf::int32 version() const; + inline void set_version(::google::protobuf::int32 value); + + // required bytes nodeID = 2; + inline bool has_nodeid() const; + inline void clear_nodeid(); + static const int kNodeIDFieldNumber = 2; + inline const ::std::string& nodeid() const; + inline void set_nodeid(const ::std::string& value); + inline void set_nodeid(const char* value); + inline void set_nodeid(const void* value, size_t size); + inline ::std::string* mutable_nodeid(); + inline ::std::string* release_nodeid(); + + // required int32 port = 3; + inline bool has_port() const; + inline void clear_port(); + static const int kPortFieldNumber = 3; + inline ::google::protobuf::int32 port() const; + inline void set_port(::google::protobuf::int32 value); + + // @@protoc_insertion_point(class_scope:newcoin.Hello) + private: + inline void set_has_version(); + inline void clear_has_version(); + inline void set_has_nodeid(); + inline void clear_has_nodeid(); + inline void set_has_port(); + inline void clear_has_port(); + + ::google::protobuf::UnknownFieldSet _unknown_fields_; + + ::std::string* nodeid_; + ::google::protobuf::int32 version_; + ::google::protobuf::int32 port_; + + mutable int _cached_size_; + ::google::protobuf::uint32 _has_bits_[(3 + 31) / 32]; + + friend void protobuf_AddDesc_newcoin_2eproto(); + friend void protobuf_AssignDesc_newcoin_2eproto(); + friend void protobuf_ShutdownFile_newcoin_2eproto(); + + void InitAsDefaultInstance(); + static Hello* default_instance_; +}; +// ------------------------------------------------------------------- + +class Transaction : public ::google::protobuf::Message { + public: + Transaction(); + virtual ~Transaction(); + + Transaction(const Transaction& from); + + inline Transaction& operator=(const Transaction& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const Transaction& default_instance(); + + void Swap(Transaction* other); + + // implements Message ---------------------------------------------- + + Transaction* New() const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const Transaction& from); + void MergeFrom(const Transaction& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // required bytes from = 1; + inline bool has_from() const; + inline void clear_from(); + static const int kFromFieldNumber = 1; + inline const ::std::string& from() const; + inline void set_from(const ::std::string& value); + inline void set_from(const char* value); + inline void set_from(const void* value, size_t size); + inline ::std::string* mutable_from(); + inline ::std::string* release_from(); + + // required bytes dest = 2; + inline bool has_dest() const; + inline void clear_dest(); + static const int kDestFieldNumber = 2; + inline const ::std::string& dest() const; + inline void set_dest(const ::std::string& value); + inline void set_dest(const char* value); + inline void set_dest(const void* value, size_t size); + inline ::std::string* mutable_dest(); + inline ::std::string* release_dest(); + + // required uint64 amount = 3; + inline bool has_amount() const; + inline void clear_amount(); + static const int kAmountFieldNumber = 3; + inline ::google::protobuf::uint64 amount() const; + inline void set_amount(::google::protobuf::uint64 value); + + // required uint32 ledgerIndex = 4; + inline bool has_ledgerindex() const; + inline void clear_ledgerindex(); + static const int kLedgerIndexFieldNumber = 4; + inline ::google::protobuf::uint32 ledgerindex() const; + inline void set_ledgerindex(::google::protobuf::uint32 value); + + // required int32 seqNum = 5; + inline bool has_seqnum() const; + inline void clear_seqnum(); + static const int kSeqNumFieldNumber = 5; + inline ::google::protobuf::int32 seqnum() const; + inline void set_seqnum(::google::protobuf::int32 value); + + // required bytes pubKey = 6; + inline bool has_pubkey() const; + inline void clear_pubkey(); + static const int kPubKeyFieldNumber = 6; + inline const ::std::string& pubkey() const; + inline void set_pubkey(const ::std::string& value); + inline void set_pubkey(const char* value); + inline void set_pubkey(const void* value, size_t size); + inline ::std::string* mutable_pubkey(); + inline ::std::string* release_pubkey(); + + // required bytes sig = 7; + inline bool has_sig() const; + inline void clear_sig(); + static const int kSigFieldNumber = 7; + inline const ::std::string& sig() const; + inline void set_sig(const ::std::string& value); + inline void set_sig(const char* value); + inline void set_sig(const void* value, size_t size); + inline ::std::string* mutable_sig(); + inline ::std::string* release_sig(); + + // @@protoc_insertion_point(class_scope:newcoin.Transaction) + private: + inline void set_has_from(); + inline void clear_has_from(); + inline void set_has_dest(); + inline void clear_has_dest(); + inline void set_has_amount(); + inline void clear_has_amount(); + inline void set_has_ledgerindex(); + inline void clear_has_ledgerindex(); + inline void set_has_seqnum(); + inline void clear_has_seqnum(); + inline void set_has_pubkey(); + inline void clear_has_pubkey(); + inline void set_has_sig(); + inline void clear_has_sig(); + + ::google::protobuf::UnknownFieldSet _unknown_fields_; + + ::std::string* from_; + ::std::string* dest_; + ::google::protobuf::uint64 amount_; + ::google::protobuf::uint32 ledgerindex_; + ::google::protobuf::int32 seqnum_; + ::std::string* pubkey_; + ::std::string* sig_; + + mutable int _cached_size_; + ::google::protobuf::uint32 _has_bits_[(7 + 31) / 32]; + + friend void protobuf_AddDesc_newcoin_2eproto(); + friend void protobuf_AssignDesc_newcoin_2eproto(); + friend void protobuf_ShutdownFile_newcoin_2eproto(); + + void InitAsDefaultInstance(); + static Transaction* default_instance_; +}; +// ------------------------------------------------------------------- + +class Validation : public ::google::protobuf::Message { + public: + Validation(); + virtual ~Validation(); + + Validation(const Validation& from); + + inline Validation& operator=(const Validation& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const Validation& default_instance(); + + void Swap(Validation* other); + + // implements Message ---------------------------------------------- + + Validation* New() const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const Validation& from); + void MergeFrom(const Validation& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // required uint32 ledgerIndex = 1; + inline bool has_ledgerindex() const; + inline void clear_ledgerindex(); + static const int kLedgerIndexFieldNumber = 1; + inline ::google::protobuf::uint32 ledgerindex() const; + inline void set_ledgerindex(::google::protobuf::uint32 value); + + // required bytes hash = 2; + inline bool has_hash() const; + inline void clear_hash(); + static const int kHashFieldNumber = 2; + inline const ::std::string& hash() const; + inline void set_hash(const ::std::string& value); + inline void set_hash(const char* value); + inline void set_hash(const void* value, size_t size); + inline ::std::string* mutable_hash(); + inline ::std::string* release_hash(); + + // required bytes hanko = 3; + inline bool has_hanko() const; + inline void clear_hanko(); + static const int kHankoFieldNumber = 3; + inline const ::std::string& hanko() const; + inline void set_hanko(const ::std::string& value); + inline void set_hanko(const char* value); + inline void set_hanko(const void* value, size_t size); + inline ::std::string* mutable_hanko(); + inline ::std::string* release_hanko(); + + // required int32 seqNum = 4; + inline bool has_seqnum() const; + inline void clear_seqnum(); + static const int kSeqNumFieldNumber = 4; + inline ::google::protobuf::int32 seqnum() const; + inline void set_seqnum(::google::protobuf::int32 value); + + // required bytes sig = 5; + inline bool has_sig() const; + inline void clear_sig(); + static const int kSigFieldNumber = 5; + inline const ::std::string& sig() const; + inline void set_sig(const ::std::string& value); + inline void set_sig(const char* value); + inline void set_sig(const void* value, size_t size); + inline ::std::string* mutable_sig(); + inline ::std::string* release_sig(); + + // @@protoc_insertion_point(class_scope:newcoin.Validation) + private: + inline void set_has_ledgerindex(); + inline void clear_has_ledgerindex(); + inline void set_has_hash(); + inline void clear_has_hash(); + inline void set_has_hanko(); + inline void clear_has_hanko(); + inline void set_has_seqnum(); + inline void clear_has_seqnum(); + inline void set_has_sig(); + inline void clear_has_sig(); + + ::google::protobuf::UnknownFieldSet _unknown_fields_; + + ::std::string* hash_; + ::google::protobuf::uint32 ledgerindex_; + ::google::protobuf::int32 seqnum_; + ::std::string* hanko_; + ::std::string* sig_; + + mutable int _cached_size_; + ::google::protobuf::uint32 _has_bits_[(5 + 31) / 32]; + + friend void protobuf_AddDesc_newcoin_2eproto(); + friend void protobuf_AssignDesc_newcoin_2eproto(); + friend void protobuf_ShutdownFile_newcoin_2eproto(); + + void InitAsDefaultInstance(); + static Validation* default_instance_; +}; +// ------------------------------------------------------------------- + +class Account : public ::google::protobuf::Message { + public: + Account(); + virtual ~Account(); + + Account(const Account& from); + + inline Account& operator=(const Account& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const Account& default_instance(); + + void Swap(Account* other); + + // implements Message ---------------------------------------------- + + Account* New() const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const Account& from); + void MergeFrom(const Account& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // required bytes address = 1; + inline bool has_address() const; + inline void clear_address(); + static const int kAddressFieldNumber = 1; + inline const ::std::string& address() const; + inline void set_address(const ::std::string& value); + inline void set_address(const char* value); + inline void set_address(const void* value, size_t size); + inline ::std::string* mutable_address(); + inline ::std::string* release_address(); + + // required uint64 amount = 2; + inline bool has_amount() const; + inline void clear_amount(); + static const int kAmountFieldNumber = 2; + inline ::google::protobuf::uint64 amount() const; + inline void set_amount(::google::protobuf::uint64 value); + + // required uint32 seqNum = 3; + inline bool has_seqnum() const; + inline void clear_seqnum(); + static const int kSeqNumFieldNumber = 3; + inline ::google::protobuf::uint32 seqnum() const; + inline void set_seqnum(::google::protobuf::uint32 value); + + // @@protoc_insertion_point(class_scope:newcoin.Account) + private: + inline void set_has_address(); + inline void clear_has_address(); + inline void set_has_amount(); + inline void clear_has_amount(); + inline void set_has_seqnum(); + inline void clear_has_seqnum(); + + ::google::protobuf::UnknownFieldSet _unknown_fields_; + + ::std::string* address_; + ::google::protobuf::uint64 amount_; + ::google::protobuf::uint32 seqnum_; + + mutable int _cached_size_; + ::google::protobuf::uint32 _has_bits_[(3 + 31) / 32]; + + friend void protobuf_AddDesc_newcoin_2eproto(); + friend void protobuf_AssignDesc_newcoin_2eproto(); + friend void protobuf_ShutdownFile_newcoin_2eproto(); + + void InitAsDefaultInstance(); + static Account* default_instance_; +}; +// ------------------------------------------------------------------- + +class FullLedger : public ::google::protobuf::Message { + public: + FullLedger(); + virtual ~FullLedger(); + + FullLedger(const FullLedger& from); + + inline FullLedger& operator=(const FullLedger& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const FullLedger& default_instance(); + + void Swap(FullLedger* other); + + // implements Message ---------------------------------------------- + + FullLedger* New() const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const FullLedger& from); + void MergeFrom(const FullLedger& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // required uint32 index = 1; + inline bool has_index() const; + inline void clear_index(); + static const int kIndexFieldNumber = 1; + inline ::google::protobuf::uint32 index() const; + inline void set_index(::google::protobuf::uint32 value); + + // required bytes hash = 2; + inline bool has_hash() const; + inline void clear_hash(); + static const int kHashFieldNumber = 2; + inline const ::std::string& hash() const; + inline void set_hash(const ::std::string& value); + inline void set_hash(const char* value); + inline void set_hash(const void* value, size_t size); + inline ::std::string* mutable_hash(); + inline ::std::string* release_hash(); + + // required bytes parentHash = 3; + inline bool has_parenthash() const; + inline void clear_parenthash(); + static const int kParentHashFieldNumber = 3; + inline const ::std::string& parenthash() const; + inline void set_parenthash(const ::std::string& value); + inline void set_parenthash(const char* value); + inline void set_parenthash(const void* value, size_t size); + inline ::std::string* mutable_parenthash(); + inline ::std::string* release_parenthash(); + + // required uint64 feeHeld = 4; + inline bool has_feeheld() const; + inline void clear_feeheld(); + static const int kFeeHeldFieldNumber = 4; + inline ::google::protobuf::uint64 feeheld() const; + inline void set_feeheld(::google::protobuf::uint64 value); + + // repeated .newcoin.Account accounts = 5; + inline int accounts_size() const; + inline void clear_accounts(); + static const int kAccountsFieldNumber = 5; + inline const ::newcoin::Account& accounts(int index) const; + inline ::newcoin::Account* mutable_accounts(int index); + inline ::newcoin::Account* add_accounts(); + inline const ::google::protobuf::RepeatedPtrField< ::newcoin::Account >& + accounts() const; + inline ::google::protobuf::RepeatedPtrField< ::newcoin::Account >* + mutable_accounts(); + + // repeated .newcoin.Transaction transactions = 6; + inline int transactions_size() const; + inline void clear_transactions(); + static const int kTransactionsFieldNumber = 6; + inline const ::newcoin::Transaction& transactions(int index) const; + inline ::newcoin::Transaction* mutable_transactions(int index); + inline ::newcoin::Transaction* add_transactions(); + inline const ::google::protobuf::RepeatedPtrField< ::newcoin::Transaction >& + transactions() const; + inline ::google::protobuf::RepeatedPtrField< ::newcoin::Transaction >* + mutable_transactions(); + + // @@protoc_insertion_point(class_scope:newcoin.FullLedger) + private: + inline void set_has_index(); + inline void clear_has_index(); + inline void set_has_hash(); + inline void clear_has_hash(); + inline void set_has_parenthash(); + inline void clear_has_parenthash(); + inline void set_has_feeheld(); + inline void clear_has_feeheld(); + + ::google::protobuf::UnknownFieldSet _unknown_fields_; + + ::std::string* hash_; + ::std::string* parenthash_; + ::google::protobuf::uint64 feeheld_; + ::google::protobuf::RepeatedPtrField< ::newcoin::Account > accounts_; + ::google::protobuf::RepeatedPtrField< ::newcoin::Transaction > transactions_; + ::google::protobuf::uint32 index_; + + mutable int _cached_size_; + ::google::protobuf::uint32 _has_bits_[(6 + 31) / 32]; + + friend void protobuf_AddDesc_newcoin_2eproto(); + friend void protobuf_AssignDesc_newcoin_2eproto(); + friend void protobuf_ShutdownFile_newcoin_2eproto(); + + void InitAsDefaultInstance(); + static FullLedger* default_instance_; +}; +// ------------------------------------------------------------------- + +class GetFullLedger : public ::google::protobuf::Message { + public: + GetFullLedger(); + virtual ~GetFullLedger(); + + GetFullLedger(const GetFullLedger& from); + + inline GetFullLedger& operator=(const GetFullLedger& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const GetFullLedger& default_instance(); + + void Swap(GetFullLedger* other); + + // implements Message ---------------------------------------------- + + GetFullLedger* New() const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const GetFullLedger& from); + void MergeFrom(const GetFullLedger& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // required bytes hash = 1; + inline bool has_hash() const; + inline void clear_hash(); + static const int kHashFieldNumber = 1; + inline const ::std::string& hash() const; + inline void set_hash(const ::std::string& value); + inline void set_hash(const char* value); + inline void set_hash(const void* value, size_t size); + inline ::std::string* mutable_hash(); + inline ::std::string* release_hash(); + + // @@protoc_insertion_point(class_scope:newcoin.GetFullLedger) + private: + inline void set_has_hash(); + inline void clear_has_hash(); + + ::google::protobuf::UnknownFieldSet _unknown_fields_; + + ::std::string* hash_; + + mutable int _cached_size_; + ::google::protobuf::uint32 _has_bits_[(1 + 31) / 32]; + + friend void protobuf_AddDesc_newcoin_2eproto(); + friend void protobuf_AssignDesc_newcoin_2eproto(); + friend void protobuf_ShutdownFile_newcoin_2eproto(); + + void InitAsDefaultInstance(); + static GetFullLedger* default_instance_; +}; +// ------------------------------------------------------------------- + +class GetValidations : public ::google::protobuf::Message { + public: + GetValidations(); + virtual ~GetValidations(); + + GetValidations(const GetValidations& from); + + inline GetValidations& operator=(const GetValidations& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const GetValidations& default_instance(); + + void Swap(GetValidations* other); + + // implements Message ---------------------------------------------- + + GetValidations* New() const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const GetValidations& from); + void MergeFrom(const GetValidations& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // required uint32 ledgerIndex = 1; + inline bool has_ledgerindex() const; + inline void clear_ledgerindex(); + static const int kLedgerIndexFieldNumber = 1; + inline ::google::protobuf::uint32 ledgerindex() const; + inline void set_ledgerindex(::google::protobuf::uint32 value); + + // @@protoc_insertion_point(class_scope:newcoin.GetValidations) + private: + inline void set_has_ledgerindex(); + inline void clear_has_ledgerindex(); + + ::google::protobuf::UnknownFieldSet _unknown_fields_; + + ::google::protobuf::uint32 ledgerindex_; + + mutable int _cached_size_; + ::google::protobuf::uint32 _has_bits_[(1 + 31) / 32]; + + friend void protobuf_AddDesc_newcoin_2eproto(); + friend void protobuf_AssignDesc_newcoin_2eproto(); + friend void protobuf_ShutdownFile_newcoin_2eproto(); + + void InitAsDefaultInstance(); + static GetValidations* default_instance_; +}; +// ------------------------------------------------------------------- + +class Contact : public ::google::protobuf::Message { + public: + Contact(); + virtual ~Contact(); + + Contact(const Contact& from); + + inline Contact& operator=(const Contact& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const Contact& default_instance(); + + void Swap(Contact* other); + + // implements Message ---------------------------------------------- + + Contact* New() const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const Contact& from); + void MergeFrom(const Contact& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // required string nodeID = 1; + inline bool has_nodeid() const; + inline void clear_nodeid(); + static const int kNodeIDFieldNumber = 1; + inline const ::std::string& nodeid() const; + inline void set_nodeid(const ::std::string& value); + inline void set_nodeid(const char* value); + inline void set_nodeid(const char* value, size_t size); + inline ::std::string* mutable_nodeid(); + inline ::std::string* release_nodeid(); + + // required string nodeIP = 2; + inline bool has_nodeip() const; + inline void clear_nodeip(); + static const int kNodeIPFieldNumber = 2; + inline const ::std::string& nodeip() const; + inline void set_nodeip(const ::std::string& value); + inline void set_nodeip(const char* value); + inline void set_nodeip(const char* value, size_t size); + inline ::std::string* mutable_nodeip(); + inline ::std::string* release_nodeip(); + + // required int32 port = 3; + inline bool has_port() const; + inline void clear_port(); + static const int kPortFieldNumber = 3; + inline ::google::protobuf::int32 port() const; + inline void set_port(::google::protobuf::int32 value); + + // @@protoc_insertion_point(class_scope:newcoin.Contact) + private: + inline void set_has_nodeid(); + inline void clear_has_nodeid(); + inline void set_has_nodeip(); + inline void clear_has_nodeip(); + inline void set_has_port(); + inline void clear_has_port(); + + ::google::protobuf::UnknownFieldSet _unknown_fields_; + + ::std::string* nodeid_; + ::std::string* nodeip_; + ::google::protobuf::int32 port_; + + mutable int _cached_size_; + ::google::protobuf::uint32 _has_bits_[(3 + 31) / 32]; + + friend void protobuf_AddDesc_newcoin_2eproto(); + friend void protobuf_AssignDesc_newcoin_2eproto(); + friend void protobuf_ShutdownFile_newcoin_2eproto(); + + void InitAsDefaultInstance(); + static Contact* default_instance_; +}; +// ------------------------------------------------------------------- + +class ProposeLedger : public ::google::protobuf::Message { + public: + ProposeLedger(); + virtual ~ProposeLedger(); + + ProposeLedger(const ProposeLedger& from); + + inline ProposeLedger& operator=(const ProposeLedger& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const ProposeLedger& default_instance(); + + void Swap(ProposeLedger* other); + + // implements Message ---------------------------------------------- + + ProposeLedger* New() const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const ProposeLedger& from); + void MergeFrom(const ProposeLedger& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // required uint32 ledgerIndex = 1; + inline bool has_ledgerindex() const; + inline void clear_ledgerindex(); + static const int kLedgerIndexFieldNumber = 1; + inline ::google::protobuf::uint32 ledgerindex() const; + inline void set_ledgerindex(::google::protobuf::uint32 value); + + // required bytes hash = 2; + inline bool has_hash() const; + inline void clear_hash(); + static const int kHashFieldNumber = 2; + inline const ::std::string& hash() const; + inline void set_hash(const ::std::string& value); + inline void set_hash(const char* value); + inline void set_hash(const void* value, size_t size); + inline ::std::string* mutable_hash(); + inline ::std::string* release_hash(); + + // optional uint64 numTransactions = 3; + inline bool has_numtransactions() const; + inline void clear_numtransactions(); + static const int kNumTransactionsFieldNumber = 3; + inline ::google::protobuf::uint64 numtransactions() const; + inline void set_numtransactions(::google::protobuf::uint64 value); + + // @@protoc_insertion_point(class_scope:newcoin.ProposeLedger) + private: + inline void set_has_ledgerindex(); + inline void clear_has_ledgerindex(); + inline void set_has_hash(); + inline void clear_has_hash(); + inline void set_has_numtransactions(); + inline void clear_has_numtransactions(); + + ::google::protobuf::UnknownFieldSet _unknown_fields_; + + ::std::string* hash_; + ::google::protobuf::uint64 numtransactions_; + ::google::protobuf::uint32 ledgerindex_; + + mutable int _cached_size_; + ::google::protobuf::uint32 _has_bits_[(3 + 31) / 32]; + + friend void protobuf_AddDesc_newcoin_2eproto(); + friend void protobuf_AssignDesc_newcoin_2eproto(); + friend void protobuf_ShutdownFile_newcoin_2eproto(); + + void InitAsDefaultInstance(); + static ProposeLedger* default_instance_; +}; +// ------------------------------------------------------------------- + +class ErrorMsg : public ::google::protobuf::Message { + public: + ErrorMsg(); + virtual ~ErrorMsg(); + + ErrorMsg(const ErrorMsg& from); + + inline ErrorMsg& operator=(const ErrorMsg& from) { + CopyFrom(from); + return *this; + } + + inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const { + return _unknown_fields_; + } + + inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() { + return &_unknown_fields_; + } + + static const ::google::protobuf::Descriptor* descriptor(); + static const ErrorMsg& default_instance(); + + void Swap(ErrorMsg* other); + + // implements Message ---------------------------------------------- + + ErrorMsg* New() const; + void CopyFrom(const ::google::protobuf::Message& from); + void MergeFrom(const ::google::protobuf::Message& from); + void CopyFrom(const ErrorMsg& from); + void MergeFrom(const ErrorMsg& from); + void Clear(); + bool IsInitialized() const; + + int ByteSize() const; + bool MergePartialFromCodedStream( + ::google::protobuf::io::CodedInputStream* input); + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const; + int GetCachedSize() const { return _cached_size_; } + private: + void SharedCtor(); + void SharedDtor(); + void SetCachedSize(int size) const; + public: + + ::google::protobuf::Metadata GetMetadata() const; + + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + + // optional int32 errorCode = 1; + inline bool has_errorcode() const; + inline void clear_errorcode(); + static const int kErrorCodeFieldNumber = 1; + inline ::google::protobuf::int32 errorcode() const; + inline void set_errorcode(::google::protobuf::int32 value); + + // optional string message = 2; + inline bool has_message() const; + inline void clear_message(); + static const int kMessageFieldNumber = 2; + inline const ::std::string& message() const; + inline void set_message(const ::std::string& value); + inline void set_message(const char* value); + inline void set_message(const char* value, size_t size); + inline ::std::string* mutable_message(); + inline ::std::string* release_message(); + + // @@protoc_insertion_point(class_scope:newcoin.ErrorMsg) + private: + inline void set_has_errorcode(); + inline void clear_has_errorcode(); + inline void set_has_message(); + inline void clear_has_message(); + + ::google::protobuf::UnknownFieldSet _unknown_fields_; + + ::std::string* message_; + ::google::protobuf::int32 errorcode_; + + mutable int _cached_size_; + ::google::protobuf::uint32 _has_bits_[(2 + 31) / 32]; + + friend void protobuf_AddDesc_newcoin_2eproto(); + friend void protobuf_AssignDesc_newcoin_2eproto(); + friend void protobuf_ShutdownFile_newcoin_2eproto(); + + void InitAsDefaultInstance(); + static ErrorMsg* default_instance_; +}; +// =================================================================== + + +// =================================================================== + +// Hello + +// required int32 version = 1; +inline bool Hello::has_version() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void Hello::set_has_version() { + _has_bits_[0] |= 0x00000001u; +} +inline void Hello::clear_has_version() { + _has_bits_[0] &= ~0x00000001u; +} +inline void Hello::clear_version() { + version_ = 0; + clear_has_version(); +} +inline ::google::protobuf::int32 Hello::version() const { + return version_; +} +inline void Hello::set_version(::google::protobuf::int32 value) { + set_has_version(); + version_ = value; +} + +// required bytes nodeID = 2; +inline bool Hello::has_nodeid() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void Hello::set_has_nodeid() { + _has_bits_[0] |= 0x00000002u; +} +inline void Hello::clear_has_nodeid() { + _has_bits_[0] &= ~0x00000002u; +} +inline void Hello::clear_nodeid() { + if (nodeid_ != &::google::protobuf::internal::kEmptyString) { + nodeid_->clear(); + } + clear_has_nodeid(); +} +inline const ::std::string& Hello::nodeid() const { + return *nodeid_; +} +inline void Hello::set_nodeid(const ::std::string& value) { + set_has_nodeid(); + if (nodeid_ == &::google::protobuf::internal::kEmptyString) { + nodeid_ = new ::std::string; + } + nodeid_->assign(value); +} +inline void Hello::set_nodeid(const char* value) { + set_has_nodeid(); + if (nodeid_ == &::google::protobuf::internal::kEmptyString) { + nodeid_ = new ::std::string; + } + nodeid_->assign(value); +} +inline void Hello::set_nodeid(const void* value, size_t size) { + set_has_nodeid(); + if (nodeid_ == &::google::protobuf::internal::kEmptyString) { + nodeid_ = new ::std::string; + } + nodeid_->assign(reinterpret_cast(value), size); +} +inline ::std::string* Hello::mutable_nodeid() { + set_has_nodeid(); + if (nodeid_ == &::google::protobuf::internal::kEmptyString) { + nodeid_ = new ::std::string; + } + return nodeid_; +} +inline ::std::string* Hello::release_nodeid() { + clear_has_nodeid(); + if (nodeid_ == &::google::protobuf::internal::kEmptyString) { + return NULL; + } else { + ::std::string* temp = nodeid_; + nodeid_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + return temp; + } +} + +// required int32 port = 3; +inline bool Hello::has_port() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void Hello::set_has_port() { + _has_bits_[0] |= 0x00000004u; +} +inline void Hello::clear_has_port() { + _has_bits_[0] &= ~0x00000004u; +} +inline void Hello::clear_port() { + port_ = 0; + clear_has_port(); +} +inline ::google::protobuf::int32 Hello::port() const { + return port_; +} +inline void Hello::set_port(::google::protobuf::int32 value) { + set_has_port(); + port_ = value; +} + +// ------------------------------------------------------------------- + +// Transaction + +// required bytes from = 1; +inline bool Transaction::has_from() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void Transaction::set_has_from() { + _has_bits_[0] |= 0x00000001u; +} +inline void Transaction::clear_has_from() { + _has_bits_[0] &= ~0x00000001u; +} +inline void Transaction::clear_from() { + if (from_ != &::google::protobuf::internal::kEmptyString) { + from_->clear(); + } + clear_has_from(); +} +inline const ::std::string& Transaction::from() const { + return *from_; +} +inline void Transaction::set_from(const ::std::string& value) { + set_has_from(); + if (from_ == &::google::protobuf::internal::kEmptyString) { + from_ = new ::std::string; + } + from_->assign(value); +} +inline void Transaction::set_from(const char* value) { + set_has_from(); + if (from_ == &::google::protobuf::internal::kEmptyString) { + from_ = new ::std::string; + } + from_->assign(value); +} +inline void Transaction::set_from(const void* value, size_t size) { + set_has_from(); + if (from_ == &::google::protobuf::internal::kEmptyString) { + from_ = new ::std::string; + } + from_->assign(reinterpret_cast(value), size); +} +inline ::std::string* Transaction::mutable_from() { + set_has_from(); + if (from_ == &::google::protobuf::internal::kEmptyString) { + from_ = new ::std::string; + } + return from_; +} +inline ::std::string* Transaction::release_from() { + clear_has_from(); + if (from_ == &::google::protobuf::internal::kEmptyString) { + return NULL; + } else { + ::std::string* temp = from_; + from_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + return temp; + } +} + +// required bytes dest = 2; +inline bool Transaction::has_dest() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void Transaction::set_has_dest() { + _has_bits_[0] |= 0x00000002u; +} +inline void Transaction::clear_has_dest() { + _has_bits_[0] &= ~0x00000002u; +} +inline void Transaction::clear_dest() { + if (dest_ != &::google::protobuf::internal::kEmptyString) { + dest_->clear(); + } + clear_has_dest(); +} +inline const ::std::string& Transaction::dest() const { + return *dest_; +} +inline void Transaction::set_dest(const ::std::string& value) { + set_has_dest(); + if (dest_ == &::google::protobuf::internal::kEmptyString) { + dest_ = new ::std::string; + } + dest_->assign(value); +} +inline void Transaction::set_dest(const char* value) { + set_has_dest(); + if (dest_ == &::google::protobuf::internal::kEmptyString) { + dest_ = new ::std::string; + } + dest_->assign(value); +} +inline void Transaction::set_dest(const void* value, size_t size) { + set_has_dest(); + if (dest_ == &::google::protobuf::internal::kEmptyString) { + dest_ = new ::std::string; + } + dest_->assign(reinterpret_cast(value), size); +} +inline ::std::string* Transaction::mutable_dest() { + set_has_dest(); + if (dest_ == &::google::protobuf::internal::kEmptyString) { + dest_ = new ::std::string; + } + return dest_; +} +inline ::std::string* Transaction::release_dest() { + clear_has_dest(); + if (dest_ == &::google::protobuf::internal::kEmptyString) { + return NULL; + } else { + ::std::string* temp = dest_; + dest_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + return temp; + } +} + +// required uint64 amount = 3; +inline bool Transaction::has_amount() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void Transaction::set_has_amount() { + _has_bits_[0] |= 0x00000004u; +} +inline void Transaction::clear_has_amount() { + _has_bits_[0] &= ~0x00000004u; +} +inline void Transaction::clear_amount() { + amount_ = GOOGLE_ULONGLONG(0); + clear_has_amount(); +} +inline ::google::protobuf::uint64 Transaction::amount() const { + return amount_; +} +inline void Transaction::set_amount(::google::protobuf::uint64 value) { + set_has_amount(); + amount_ = value; +} + +// required uint32 ledgerIndex = 4; +inline bool Transaction::has_ledgerindex() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void Transaction::set_has_ledgerindex() { + _has_bits_[0] |= 0x00000008u; +} +inline void Transaction::clear_has_ledgerindex() { + _has_bits_[0] &= ~0x00000008u; +} +inline void Transaction::clear_ledgerindex() { + ledgerindex_ = 0u; + clear_has_ledgerindex(); +} +inline ::google::protobuf::uint32 Transaction::ledgerindex() const { + return ledgerindex_; +} +inline void Transaction::set_ledgerindex(::google::protobuf::uint32 value) { + set_has_ledgerindex(); + ledgerindex_ = value; +} + +// required int32 seqNum = 5; +inline bool Transaction::has_seqnum() const { + return (_has_bits_[0] & 0x00000010u) != 0; +} +inline void Transaction::set_has_seqnum() { + _has_bits_[0] |= 0x00000010u; +} +inline void Transaction::clear_has_seqnum() { + _has_bits_[0] &= ~0x00000010u; +} +inline void Transaction::clear_seqnum() { + seqnum_ = 0; + clear_has_seqnum(); +} +inline ::google::protobuf::int32 Transaction::seqnum() const { + return seqnum_; +} +inline void Transaction::set_seqnum(::google::protobuf::int32 value) { + set_has_seqnum(); + seqnum_ = value; +} + +// required bytes pubKey = 6; +inline bool Transaction::has_pubkey() const { + return (_has_bits_[0] & 0x00000020u) != 0; +} +inline void Transaction::set_has_pubkey() { + _has_bits_[0] |= 0x00000020u; +} +inline void Transaction::clear_has_pubkey() { + _has_bits_[0] &= ~0x00000020u; +} +inline void Transaction::clear_pubkey() { + if (pubkey_ != &::google::protobuf::internal::kEmptyString) { + pubkey_->clear(); + } + clear_has_pubkey(); +} +inline const ::std::string& Transaction::pubkey() const { + return *pubkey_; +} +inline void Transaction::set_pubkey(const ::std::string& value) { + set_has_pubkey(); + if (pubkey_ == &::google::protobuf::internal::kEmptyString) { + pubkey_ = new ::std::string; + } + pubkey_->assign(value); +} +inline void Transaction::set_pubkey(const char* value) { + set_has_pubkey(); + if (pubkey_ == &::google::protobuf::internal::kEmptyString) { + pubkey_ = new ::std::string; + } + pubkey_->assign(value); +} +inline void Transaction::set_pubkey(const void* value, size_t size) { + set_has_pubkey(); + if (pubkey_ == &::google::protobuf::internal::kEmptyString) { + pubkey_ = new ::std::string; + } + pubkey_->assign(reinterpret_cast(value), size); +} +inline ::std::string* Transaction::mutable_pubkey() { + set_has_pubkey(); + if (pubkey_ == &::google::protobuf::internal::kEmptyString) { + pubkey_ = new ::std::string; + } + return pubkey_; +} +inline ::std::string* Transaction::release_pubkey() { + clear_has_pubkey(); + if (pubkey_ == &::google::protobuf::internal::kEmptyString) { + return NULL; + } else { + ::std::string* temp = pubkey_; + pubkey_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + return temp; + } +} + +// required bytes sig = 7; +inline bool Transaction::has_sig() const { + return (_has_bits_[0] & 0x00000040u) != 0; +} +inline void Transaction::set_has_sig() { + _has_bits_[0] |= 0x00000040u; +} +inline void Transaction::clear_has_sig() { + _has_bits_[0] &= ~0x00000040u; +} +inline void Transaction::clear_sig() { + if (sig_ != &::google::protobuf::internal::kEmptyString) { + sig_->clear(); + } + clear_has_sig(); +} +inline const ::std::string& Transaction::sig() const { + return *sig_; +} +inline void Transaction::set_sig(const ::std::string& value) { + set_has_sig(); + if (sig_ == &::google::protobuf::internal::kEmptyString) { + sig_ = new ::std::string; + } + sig_->assign(value); +} +inline void Transaction::set_sig(const char* value) { + set_has_sig(); + if (sig_ == &::google::protobuf::internal::kEmptyString) { + sig_ = new ::std::string; + } + sig_->assign(value); +} +inline void Transaction::set_sig(const void* value, size_t size) { + set_has_sig(); + if (sig_ == &::google::protobuf::internal::kEmptyString) { + sig_ = new ::std::string; + } + sig_->assign(reinterpret_cast(value), size); +} +inline ::std::string* Transaction::mutable_sig() { + set_has_sig(); + if (sig_ == &::google::protobuf::internal::kEmptyString) { + sig_ = new ::std::string; + } + return sig_; +} +inline ::std::string* Transaction::release_sig() { + clear_has_sig(); + if (sig_ == &::google::protobuf::internal::kEmptyString) { + return NULL; + } else { + ::std::string* temp = sig_; + sig_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + return temp; + } +} + +// ------------------------------------------------------------------- + +// Validation + +// required uint32 ledgerIndex = 1; +inline bool Validation::has_ledgerindex() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void Validation::set_has_ledgerindex() { + _has_bits_[0] |= 0x00000001u; +} +inline void Validation::clear_has_ledgerindex() { + _has_bits_[0] &= ~0x00000001u; +} +inline void Validation::clear_ledgerindex() { + ledgerindex_ = 0u; + clear_has_ledgerindex(); +} +inline ::google::protobuf::uint32 Validation::ledgerindex() const { + return ledgerindex_; +} +inline void Validation::set_ledgerindex(::google::protobuf::uint32 value) { + set_has_ledgerindex(); + ledgerindex_ = value; +} + +// required bytes hash = 2; +inline bool Validation::has_hash() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void Validation::set_has_hash() { + _has_bits_[0] |= 0x00000002u; +} +inline void Validation::clear_has_hash() { + _has_bits_[0] &= ~0x00000002u; +} +inline void Validation::clear_hash() { + if (hash_ != &::google::protobuf::internal::kEmptyString) { + hash_->clear(); + } + clear_has_hash(); +} +inline const ::std::string& Validation::hash() const { + return *hash_; +} +inline void Validation::set_hash(const ::std::string& value) { + set_has_hash(); + if (hash_ == &::google::protobuf::internal::kEmptyString) { + hash_ = new ::std::string; + } + hash_->assign(value); +} +inline void Validation::set_hash(const char* value) { + set_has_hash(); + if (hash_ == &::google::protobuf::internal::kEmptyString) { + hash_ = new ::std::string; + } + hash_->assign(value); +} +inline void Validation::set_hash(const void* value, size_t size) { + set_has_hash(); + if (hash_ == &::google::protobuf::internal::kEmptyString) { + hash_ = new ::std::string; + } + hash_->assign(reinterpret_cast(value), size); +} +inline ::std::string* Validation::mutable_hash() { + set_has_hash(); + if (hash_ == &::google::protobuf::internal::kEmptyString) { + hash_ = new ::std::string; + } + return hash_; +} +inline ::std::string* Validation::release_hash() { + clear_has_hash(); + if (hash_ == &::google::protobuf::internal::kEmptyString) { + return NULL; + } else { + ::std::string* temp = hash_; + hash_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + return temp; + } +} + +// required bytes hanko = 3; +inline bool Validation::has_hanko() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void Validation::set_has_hanko() { + _has_bits_[0] |= 0x00000004u; +} +inline void Validation::clear_has_hanko() { + _has_bits_[0] &= ~0x00000004u; +} +inline void Validation::clear_hanko() { + if (hanko_ != &::google::protobuf::internal::kEmptyString) { + hanko_->clear(); + } + clear_has_hanko(); +} +inline const ::std::string& Validation::hanko() const { + return *hanko_; +} +inline void Validation::set_hanko(const ::std::string& value) { + set_has_hanko(); + if (hanko_ == &::google::protobuf::internal::kEmptyString) { + hanko_ = new ::std::string; + } + hanko_->assign(value); +} +inline void Validation::set_hanko(const char* value) { + set_has_hanko(); + if (hanko_ == &::google::protobuf::internal::kEmptyString) { + hanko_ = new ::std::string; + } + hanko_->assign(value); +} +inline void Validation::set_hanko(const void* value, size_t size) { + set_has_hanko(); + if (hanko_ == &::google::protobuf::internal::kEmptyString) { + hanko_ = new ::std::string; + } + hanko_->assign(reinterpret_cast(value), size); +} +inline ::std::string* Validation::mutable_hanko() { + set_has_hanko(); + if (hanko_ == &::google::protobuf::internal::kEmptyString) { + hanko_ = new ::std::string; + } + return hanko_; +} +inline ::std::string* Validation::release_hanko() { + clear_has_hanko(); + if (hanko_ == &::google::protobuf::internal::kEmptyString) { + return NULL; + } else { + ::std::string* temp = hanko_; + hanko_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + return temp; + } +} + +// required int32 seqNum = 4; +inline bool Validation::has_seqnum() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void Validation::set_has_seqnum() { + _has_bits_[0] |= 0x00000008u; +} +inline void Validation::clear_has_seqnum() { + _has_bits_[0] &= ~0x00000008u; +} +inline void Validation::clear_seqnum() { + seqnum_ = 0; + clear_has_seqnum(); +} +inline ::google::protobuf::int32 Validation::seqnum() const { + return seqnum_; +} +inline void Validation::set_seqnum(::google::protobuf::int32 value) { + set_has_seqnum(); + seqnum_ = value; +} + +// required bytes sig = 5; +inline bool Validation::has_sig() const { + return (_has_bits_[0] & 0x00000010u) != 0; +} +inline void Validation::set_has_sig() { + _has_bits_[0] |= 0x00000010u; +} +inline void Validation::clear_has_sig() { + _has_bits_[0] &= ~0x00000010u; +} +inline void Validation::clear_sig() { + if (sig_ != &::google::protobuf::internal::kEmptyString) { + sig_->clear(); + } + clear_has_sig(); +} +inline const ::std::string& Validation::sig() const { + return *sig_; +} +inline void Validation::set_sig(const ::std::string& value) { + set_has_sig(); + if (sig_ == &::google::protobuf::internal::kEmptyString) { + sig_ = new ::std::string; + } + sig_->assign(value); +} +inline void Validation::set_sig(const char* value) { + set_has_sig(); + if (sig_ == &::google::protobuf::internal::kEmptyString) { + sig_ = new ::std::string; + } + sig_->assign(value); +} +inline void Validation::set_sig(const void* value, size_t size) { + set_has_sig(); + if (sig_ == &::google::protobuf::internal::kEmptyString) { + sig_ = new ::std::string; + } + sig_->assign(reinterpret_cast(value), size); +} +inline ::std::string* Validation::mutable_sig() { + set_has_sig(); + if (sig_ == &::google::protobuf::internal::kEmptyString) { + sig_ = new ::std::string; + } + return sig_; +} +inline ::std::string* Validation::release_sig() { + clear_has_sig(); + if (sig_ == &::google::protobuf::internal::kEmptyString) { + return NULL; + } else { + ::std::string* temp = sig_; + sig_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + return temp; + } +} + +// ------------------------------------------------------------------- + +// Account + +// required bytes address = 1; +inline bool Account::has_address() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void Account::set_has_address() { + _has_bits_[0] |= 0x00000001u; +} +inline void Account::clear_has_address() { + _has_bits_[0] &= ~0x00000001u; +} +inline void Account::clear_address() { + if (address_ != &::google::protobuf::internal::kEmptyString) { + address_->clear(); + } + clear_has_address(); +} +inline const ::std::string& Account::address() const { + return *address_; +} +inline void Account::set_address(const ::std::string& value) { + set_has_address(); + if (address_ == &::google::protobuf::internal::kEmptyString) { + address_ = new ::std::string; + } + address_->assign(value); +} +inline void Account::set_address(const char* value) { + set_has_address(); + if (address_ == &::google::protobuf::internal::kEmptyString) { + address_ = new ::std::string; + } + address_->assign(value); +} +inline void Account::set_address(const void* value, size_t size) { + set_has_address(); + if (address_ == &::google::protobuf::internal::kEmptyString) { + address_ = new ::std::string; + } + address_->assign(reinterpret_cast(value), size); +} +inline ::std::string* Account::mutable_address() { + set_has_address(); + if (address_ == &::google::protobuf::internal::kEmptyString) { + address_ = new ::std::string; + } + return address_; +} +inline ::std::string* Account::release_address() { + clear_has_address(); + if (address_ == &::google::protobuf::internal::kEmptyString) { + return NULL; + } else { + ::std::string* temp = address_; + address_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + return temp; + } +} + +// required uint64 amount = 2; +inline bool Account::has_amount() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void Account::set_has_amount() { + _has_bits_[0] |= 0x00000002u; +} +inline void Account::clear_has_amount() { + _has_bits_[0] &= ~0x00000002u; +} +inline void Account::clear_amount() { + amount_ = GOOGLE_ULONGLONG(0); + clear_has_amount(); +} +inline ::google::protobuf::uint64 Account::amount() const { + return amount_; +} +inline void Account::set_amount(::google::protobuf::uint64 value) { + set_has_amount(); + amount_ = value; +} + +// required uint32 seqNum = 3; +inline bool Account::has_seqnum() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void Account::set_has_seqnum() { + _has_bits_[0] |= 0x00000004u; +} +inline void Account::clear_has_seqnum() { + _has_bits_[0] &= ~0x00000004u; +} +inline void Account::clear_seqnum() { + seqnum_ = 0u; + clear_has_seqnum(); +} +inline ::google::protobuf::uint32 Account::seqnum() const { + return seqnum_; +} +inline void Account::set_seqnum(::google::protobuf::uint32 value) { + set_has_seqnum(); + seqnum_ = value; +} + +// ------------------------------------------------------------------- + +// FullLedger + +// required uint32 index = 1; +inline bool FullLedger::has_index() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void FullLedger::set_has_index() { + _has_bits_[0] |= 0x00000001u; +} +inline void FullLedger::clear_has_index() { + _has_bits_[0] &= ~0x00000001u; +} +inline void FullLedger::clear_index() { + index_ = 0u; + clear_has_index(); +} +inline ::google::protobuf::uint32 FullLedger::index() const { + return index_; +} +inline void FullLedger::set_index(::google::protobuf::uint32 value) { + set_has_index(); + index_ = value; +} + +// required bytes hash = 2; +inline bool FullLedger::has_hash() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void FullLedger::set_has_hash() { + _has_bits_[0] |= 0x00000002u; +} +inline void FullLedger::clear_has_hash() { + _has_bits_[0] &= ~0x00000002u; +} +inline void FullLedger::clear_hash() { + if (hash_ != &::google::protobuf::internal::kEmptyString) { + hash_->clear(); + } + clear_has_hash(); +} +inline const ::std::string& FullLedger::hash() const { + return *hash_; +} +inline void FullLedger::set_hash(const ::std::string& value) { + set_has_hash(); + if (hash_ == &::google::protobuf::internal::kEmptyString) { + hash_ = new ::std::string; + } + hash_->assign(value); +} +inline void FullLedger::set_hash(const char* value) { + set_has_hash(); + if (hash_ == &::google::protobuf::internal::kEmptyString) { + hash_ = new ::std::string; + } + hash_->assign(value); +} +inline void FullLedger::set_hash(const void* value, size_t size) { + set_has_hash(); + if (hash_ == &::google::protobuf::internal::kEmptyString) { + hash_ = new ::std::string; + } + hash_->assign(reinterpret_cast(value), size); +} +inline ::std::string* FullLedger::mutable_hash() { + set_has_hash(); + if (hash_ == &::google::protobuf::internal::kEmptyString) { + hash_ = new ::std::string; + } + return hash_; +} +inline ::std::string* FullLedger::release_hash() { + clear_has_hash(); + if (hash_ == &::google::protobuf::internal::kEmptyString) { + return NULL; + } else { + ::std::string* temp = hash_; + hash_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + return temp; + } +} + +// required bytes parentHash = 3; +inline bool FullLedger::has_parenthash() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void FullLedger::set_has_parenthash() { + _has_bits_[0] |= 0x00000004u; +} +inline void FullLedger::clear_has_parenthash() { + _has_bits_[0] &= ~0x00000004u; +} +inline void FullLedger::clear_parenthash() { + if (parenthash_ != &::google::protobuf::internal::kEmptyString) { + parenthash_->clear(); + } + clear_has_parenthash(); +} +inline const ::std::string& FullLedger::parenthash() const { + return *parenthash_; +} +inline void FullLedger::set_parenthash(const ::std::string& value) { + set_has_parenthash(); + if (parenthash_ == &::google::protobuf::internal::kEmptyString) { + parenthash_ = new ::std::string; + } + parenthash_->assign(value); +} +inline void FullLedger::set_parenthash(const char* value) { + set_has_parenthash(); + if (parenthash_ == &::google::protobuf::internal::kEmptyString) { + parenthash_ = new ::std::string; + } + parenthash_->assign(value); +} +inline void FullLedger::set_parenthash(const void* value, size_t size) { + set_has_parenthash(); + if (parenthash_ == &::google::protobuf::internal::kEmptyString) { + parenthash_ = new ::std::string; + } + parenthash_->assign(reinterpret_cast(value), size); +} +inline ::std::string* FullLedger::mutable_parenthash() { + set_has_parenthash(); + if (parenthash_ == &::google::protobuf::internal::kEmptyString) { + parenthash_ = new ::std::string; + } + return parenthash_; +} +inline ::std::string* FullLedger::release_parenthash() { + clear_has_parenthash(); + if (parenthash_ == &::google::protobuf::internal::kEmptyString) { + return NULL; + } else { + ::std::string* temp = parenthash_; + parenthash_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + return temp; + } +} + +// required uint64 feeHeld = 4; +inline bool FullLedger::has_feeheld() const { + return (_has_bits_[0] & 0x00000008u) != 0; +} +inline void FullLedger::set_has_feeheld() { + _has_bits_[0] |= 0x00000008u; +} +inline void FullLedger::clear_has_feeheld() { + _has_bits_[0] &= ~0x00000008u; +} +inline void FullLedger::clear_feeheld() { + feeheld_ = GOOGLE_ULONGLONG(0); + clear_has_feeheld(); +} +inline ::google::protobuf::uint64 FullLedger::feeheld() const { + return feeheld_; +} +inline void FullLedger::set_feeheld(::google::protobuf::uint64 value) { + set_has_feeheld(); + feeheld_ = value; +} + +// repeated .newcoin.Account accounts = 5; +inline int FullLedger::accounts_size() const { + return accounts_.size(); +} +inline void FullLedger::clear_accounts() { + accounts_.Clear(); +} +inline const ::newcoin::Account& FullLedger::accounts(int index) const { + return accounts_.Get(index); +} +inline ::newcoin::Account* FullLedger::mutable_accounts(int index) { + return accounts_.Mutable(index); +} +inline ::newcoin::Account* FullLedger::add_accounts() { + return accounts_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::newcoin::Account >& +FullLedger::accounts() const { + return accounts_; +} +inline ::google::protobuf::RepeatedPtrField< ::newcoin::Account >* +FullLedger::mutable_accounts() { + return &accounts_; +} + +// repeated .newcoin.Transaction transactions = 6; +inline int FullLedger::transactions_size() const { + return transactions_.size(); +} +inline void FullLedger::clear_transactions() { + transactions_.Clear(); +} +inline const ::newcoin::Transaction& FullLedger::transactions(int index) const { + return transactions_.Get(index); +} +inline ::newcoin::Transaction* FullLedger::mutable_transactions(int index) { + return transactions_.Mutable(index); +} +inline ::newcoin::Transaction* FullLedger::add_transactions() { + return transactions_.Add(); +} +inline const ::google::protobuf::RepeatedPtrField< ::newcoin::Transaction >& +FullLedger::transactions() const { + return transactions_; +} +inline ::google::protobuf::RepeatedPtrField< ::newcoin::Transaction >* +FullLedger::mutable_transactions() { + return &transactions_; +} + +// ------------------------------------------------------------------- + +// GetFullLedger + +// required bytes hash = 1; +inline bool GetFullLedger::has_hash() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void GetFullLedger::set_has_hash() { + _has_bits_[0] |= 0x00000001u; +} +inline void GetFullLedger::clear_has_hash() { + _has_bits_[0] &= ~0x00000001u; +} +inline void GetFullLedger::clear_hash() { + if (hash_ != &::google::protobuf::internal::kEmptyString) { + hash_->clear(); + } + clear_has_hash(); +} +inline const ::std::string& GetFullLedger::hash() const { + return *hash_; +} +inline void GetFullLedger::set_hash(const ::std::string& value) { + set_has_hash(); + if (hash_ == &::google::protobuf::internal::kEmptyString) { + hash_ = new ::std::string; + } + hash_->assign(value); +} +inline void GetFullLedger::set_hash(const char* value) { + set_has_hash(); + if (hash_ == &::google::protobuf::internal::kEmptyString) { + hash_ = new ::std::string; + } + hash_->assign(value); +} +inline void GetFullLedger::set_hash(const void* value, size_t size) { + set_has_hash(); + if (hash_ == &::google::protobuf::internal::kEmptyString) { + hash_ = new ::std::string; + } + hash_->assign(reinterpret_cast(value), size); +} +inline ::std::string* GetFullLedger::mutable_hash() { + set_has_hash(); + if (hash_ == &::google::protobuf::internal::kEmptyString) { + hash_ = new ::std::string; + } + return hash_; +} +inline ::std::string* GetFullLedger::release_hash() { + clear_has_hash(); + if (hash_ == &::google::protobuf::internal::kEmptyString) { + return NULL; + } else { + ::std::string* temp = hash_; + hash_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + return temp; + } +} + +// ------------------------------------------------------------------- + +// GetValidations + +// required uint32 ledgerIndex = 1; +inline bool GetValidations::has_ledgerindex() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void GetValidations::set_has_ledgerindex() { + _has_bits_[0] |= 0x00000001u; +} +inline void GetValidations::clear_has_ledgerindex() { + _has_bits_[0] &= ~0x00000001u; +} +inline void GetValidations::clear_ledgerindex() { + ledgerindex_ = 0u; + clear_has_ledgerindex(); +} +inline ::google::protobuf::uint32 GetValidations::ledgerindex() const { + return ledgerindex_; +} +inline void GetValidations::set_ledgerindex(::google::protobuf::uint32 value) { + set_has_ledgerindex(); + ledgerindex_ = value; +} + +// ------------------------------------------------------------------- + +// Contact + +// required string nodeID = 1; +inline bool Contact::has_nodeid() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void Contact::set_has_nodeid() { + _has_bits_[0] |= 0x00000001u; +} +inline void Contact::clear_has_nodeid() { + _has_bits_[0] &= ~0x00000001u; +} +inline void Contact::clear_nodeid() { + if (nodeid_ != &::google::protobuf::internal::kEmptyString) { + nodeid_->clear(); + } + clear_has_nodeid(); +} +inline const ::std::string& Contact::nodeid() const { + return *nodeid_; +} +inline void Contact::set_nodeid(const ::std::string& value) { + set_has_nodeid(); + if (nodeid_ == &::google::protobuf::internal::kEmptyString) { + nodeid_ = new ::std::string; + } + nodeid_->assign(value); +} +inline void Contact::set_nodeid(const char* value) { + set_has_nodeid(); + if (nodeid_ == &::google::protobuf::internal::kEmptyString) { + nodeid_ = new ::std::string; + } + nodeid_->assign(value); +} +inline void Contact::set_nodeid(const char* value, size_t size) { + set_has_nodeid(); + if (nodeid_ == &::google::protobuf::internal::kEmptyString) { + nodeid_ = new ::std::string; + } + nodeid_->assign(reinterpret_cast(value), size); +} +inline ::std::string* Contact::mutable_nodeid() { + set_has_nodeid(); + if (nodeid_ == &::google::protobuf::internal::kEmptyString) { + nodeid_ = new ::std::string; + } + return nodeid_; +} +inline ::std::string* Contact::release_nodeid() { + clear_has_nodeid(); + if (nodeid_ == &::google::protobuf::internal::kEmptyString) { + return NULL; + } else { + ::std::string* temp = nodeid_; + nodeid_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + return temp; + } +} + +// required string nodeIP = 2; +inline bool Contact::has_nodeip() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void Contact::set_has_nodeip() { + _has_bits_[0] |= 0x00000002u; +} +inline void Contact::clear_has_nodeip() { + _has_bits_[0] &= ~0x00000002u; +} +inline void Contact::clear_nodeip() { + if (nodeip_ != &::google::protobuf::internal::kEmptyString) { + nodeip_->clear(); + } + clear_has_nodeip(); +} +inline const ::std::string& Contact::nodeip() const { + return *nodeip_; +} +inline void Contact::set_nodeip(const ::std::string& value) { + set_has_nodeip(); + if (nodeip_ == &::google::protobuf::internal::kEmptyString) { + nodeip_ = new ::std::string; + } + nodeip_->assign(value); +} +inline void Contact::set_nodeip(const char* value) { + set_has_nodeip(); + if (nodeip_ == &::google::protobuf::internal::kEmptyString) { + nodeip_ = new ::std::string; + } + nodeip_->assign(value); +} +inline void Contact::set_nodeip(const char* value, size_t size) { + set_has_nodeip(); + if (nodeip_ == &::google::protobuf::internal::kEmptyString) { + nodeip_ = new ::std::string; + } + nodeip_->assign(reinterpret_cast(value), size); +} +inline ::std::string* Contact::mutable_nodeip() { + set_has_nodeip(); + if (nodeip_ == &::google::protobuf::internal::kEmptyString) { + nodeip_ = new ::std::string; + } + return nodeip_; +} +inline ::std::string* Contact::release_nodeip() { + clear_has_nodeip(); + if (nodeip_ == &::google::protobuf::internal::kEmptyString) { + return NULL; + } else { + ::std::string* temp = nodeip_; + nodeip_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + return temp; + } +} + +// required int32 port = 3; +inline bool Contact::has_port() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void Contact::set_has_port() { + _has_bits_[0] |= 0x00000004u; +} +inline void Contact::clear_has_port() { + _has_bits_[0] &= ~0x00000004u; +} +inline void Contact::clear_port() { + port_ = 0; + clear_has_port(); +} +inline ::google::protobuf::int32 Contact::port() const { + return port_; +} +inline void Contact::set_port(::google::protobuf::int32 value) { + set_has_port(); + port_ = value; +} + +// ------------------------------------------------------------------- + +// ProposeLedger + +// required uint32 ledgerIndex = 1; +inline bool ProposeLedger::has_ledgerindex() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void ProposeLedger::set_has_ledgerindex() { + _has_bits_[0] |= 0x00000001u; +} +inline void ProposeLedger::clear_has_ledgerindex() { + _has_bits_[0] &= ~0x00000001u; +} +inline void ProposeLedger::clear_ledgerindex() { + ledgerindex_ = 0u; + clear_has_ledgerindex(); +} +inline ::google::protobuf::uint32 ProposeLedger::ledgerindex() const { + return ledgerindex_; +} +inline void ProposeLedger::set_ledgerindex(::google::protobuf::uint32 value) { + set_has_ledgerindex(); + ledgerindex_ = value; +} + +// required bytes hash = 2; +inline bool ProposeLedger::has_hash() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void ProposeLedger::set_has_hash() { + _has_bits_[0] |= 0x00000002u; +} +inline void ProposeLedger::clear_has_hash() { + _has_bits_[0] &= ~0x00000002u; +} +inline void ProposeLedger::clear_hash() { + if (hash_ != &::google::protobuf::internal::kEmptyString) { + hash_->clear(); + } + clear_has_hash(); +} +inline const ::std::string& ProposeLedger::hash() const { + return *hash_; +} +inline void ProposeLedger::set_hash(const ::std::string& value) { + set_has_hash(); + if (hash_ == &::google::protobuf::internal::kEmptyString) { + hash_ = new ::std::string; + } + hash_->assign(value); +} +inline void ProposeLedger::set_hash(const char* value) { + set_has_hash(); + if (hash_ == &::google::protobuf::internal::kEmptyString) { + hash_ = new ::std::string; + } + hash_->assign(value); +} +inline void ProposeLedger::set_hash(const void* value, size_t size) { + set_has_hash(); + if (hash_ == &::google::protobuf::internal::kEmptyString) { + hash_ = new ::std::string; + } + hash_->assign(reinterpret_cast(value), size); +} +inline ::std::string* ProposeLedger::mutable_hash() { + set_has_hash(); + if (hash_ == &::google::protobuf::internal::kEmptyString) { + hash_ = new ::std::string; + } + return hash_; +} +inline ::std::string* ProposeLedger::release_hash() { + clear_has_hash(); + if (hash_ == &::google::protobuf::internal::kEmptyString) { + return NULL; + } else { + ::std::string* temp = hash_; + hash_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + return temp; + } +} + +// optional uint64 numTransactions = 3; +inline bool ProposeLedger::has_numtransactions() const { + return (_has_bits_[0] & 0x00000004u) != 0; +} +inline void ProposeLedger::set_has_numtransactions() { + _has_bits_[0] |= 0x00000004u; +} +inline void ProposeLedger::clear_has_numtransactions() { + _has_bits_[0] &= ~0x00000004u; +} +inline void ProposeLedger::clear_numtransactions() { + numtransactions_ = GOOGLE_ULONGLONG(0); + clear_has_numtransactions(); +} +inline ::google::protobuf::uint64 ProposeLedger::numtransactions() const { + return numtransactions_; +} +inline void ProposeLedger::set_numtransactions(::google::protobuf::uint64 value) { + set_has_numtransactions(); + numtransactions_ = value; +} + +// ------------------------------------------------------------------- + +// ErrorMsg + +// optional int32 errorCode = 1; +inline bool ErrorMsg::has_errorcode() const { + return (_has_bits_[0] & 0x00000001u) != 0; +} +inline void ErrorMsg::set_has_errorcode() { + _has_bits_[0] |= 0x00000001u; +} +inline void ErrorMsg::clear_has_errorcode() { + _has_bits_[0] &= ~0x00000001u; +} +inline void ErrorMsg::clear_errorcode() { + errorcode_ = 0; + clear_has_errorcode(); +} +inline ::google::protobuf::int32 ErrorMsg::errorcode() const { + return errorcode_; +} +inline void ErrorMsg::set_errorcode(::google::protobuf::int32 value) { + set_has_errorcode(); + errorcode_ = value; +} + +// optional string message = 2; +inline bool ErrorMsg::has_message() const { + return (_has_bits_[0] & 0x00000002u) != 0; +} +inline void ErrorMsg::set_has_message() { + _has_bits_[0] |= 0x00000002u; +} +inline void ErrorMsg::clear_has_message() { + _has_bits_[0] &= ~0x00000002u; +} +inline void ErrorMsg::clear_message() { + if (message_ != &::google::protobuf::internal::kEmptyString) { + message_->clear(); + } + clear_has_message(); +} +inline const ::std::string& ErrorMsg::message() const { + return *message_; +} +inline void ErrorMsg::set_message(const ::std::string& value) { + set_has_message(); + if (message_ == &::google::protobuf::internal::kEmptyString) { + message_ = new ::std::string; + } + message_->assign(value); +} +inline void ErrorMsg::set_message(const char* value) { + set_has_message(); + if (message_ == &::google::protobuf::internal::kEmptyString) { + message_ = new ::std::string; + } + message_->assign(value); +} +inline void ErrorMsg::set_message(const char* value, size_t size) { + set_has_message(); + if (message_ == &::google::protobuf::internal::kEmptyString) { + message_ = new ::std::string; + } + message_->assign(reinterpret_cast(value), size); +} +inline ::std::string* ErrorMsg::mutable_message() { + set_has_message(); + if (message_ == &::google::protobuf::internal::kEmptyString) { + message_ = new ::std::string; + } + return message_; +} +inline ::std::string* ErrorMsg::release_message() { + clear_has_message(); + if (message_ == &::google::protobuf::internal::kEmptyString) { + return NULL; + } else { + ::std::string* temp = message_; + message_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString); + return temp; + } +} + + +// @@protoc_insertion_point(namespace_scope) + +} // namespace newcoin + +#ifndef SWIG +namespace google { +namespace protobuf { + +template <> +inline const EnumDescriptor* GetEnumDescriptor< newcoin::Type>() { + return newcoin::Type_descriptor(); +} + +} // namespace google +} // namespace protobuf +#endif // SWIG + +// @@protoc_insertion_point(global_scope) + +#endif // PROTOBUF_newcoin_2eproto__INCLUDED diff --git a/uint256.h b/uint256.h index 3482b5267b..4146c2d507 100644 --- a/uint256.h +++ b/uint256.h @@ -9,6 +9,8 @@ #include #include #include +#include +#include #if defined(_MSC_VER) || defined(__BORLANDC__) typedef __int64 int64; @@ -357,6 +359,16 @@ public: return (unsigned char*)&pn[WIDTH]; } + const unsigned char* begin() const + { + return (const unsigned char*)&pn[0]; + } + + const unsigned char* end() const + { + return (unsigned char*)&pn[WIDTH]; + } + unsigned int size() { return sizeof(pn); @@ -369,7 +381,7 @@ public: } template - void Serialize(Stream& s, int nType=0, int nVersion=VERSION) const + void Serialize(Stream& s, int nType=0, int nVersion=4000) const /* DJS: version default? */ { s.write((char*)pn, sizeof(pn)); }