From 04d98296f82895082f9bdef7206e7510f0a9932b Mon Sep 17 00:00:00 2001 From: Arthur Britto Date: Sun, 20 May 2012 02:20:29 -0700 Subject: [PATCH 1/3] Remove obsolete SQLiteDatabases.sql --- SQLiteDatabases.sql | 87 --------------------------------------------- 1 file changed, 87 deletions(-) delete mode 100644 SQLiteDatabases.sql diff --git a/SQLiteDatabases.sql b/SQLiteDatabases.sql deleted file mode 100644 index 7efa3eb281..0000000000 --- a/SQLiteDatabases.sql +++ /dev/null @@ -1,87 +0,0 @@ - -CREATE TABLE Transactions ( -- transactions in all states - TransID CHARACTER(64) PRIMARY KEY, -- in hex - TransType CHARACTER(24), - FromAcct CHARACTER(40), -- 20 byte hash of pub key in hex - FromSeq BIGINT UNSIGNED, -- account seq - OtherAcct CHARACTER(40), -- 20 byte hash of pub key - Amount BIGINT UNSINGED< -- if newcoin transfer - FirstSeen TEXT, -- time first seen - CommitSeq BIGINT UNSIGNED, -- ledger commited to, 0 if none - Status CHARACTER(1), -- (N)ew, (A)ctive, (C)onflicted, (D)one, (H)eld - RawTxn BLOB -); - -CREATE TABLE PubKeys ( -- holds pub keys for nodes and accounts - ID CHARACTER(40) PRIMARY KEY, - PubKey BLOB -); - - - - -CREATE TABLE Ledgers ( -- closed/accepted ledgers - LedgerHash CHARACTER(64) PRIMARY KEY, - LedgerSeq BIGINT UNSIGNED, - PrevHash CHARACTER(64), - FeeHeld BIGINT UNSIGNED, - ClosingTime BIGINT UNSINGED, - AccountSetHash CHARACTER(64), - TransSetHash CHARACTER(64) -); - -CREATE INDEX SeqLedger ON Ledgers(LedgerSeq); - -CREATE TABLE LedgerConfirmations ( - LedgerSeq BIGINT UNSIGNED, - LedgerHash CHARACTER(64), - Hanko CHARACTER(40), - Signature BLOB -); - -CREATE INDEX LedgerConfByHash ON LedgerConfirmations(LedgerHash); - - - - -CREATE TABLE TrustedNodes ( - Hanko CHARACTER(40) PRIMARY KEY, - TrustLevel SMALLINT, - Comment TEXT -); - -CREATE TABLE KnownNodes ( - Hanko CHARACTER(40) PRIMARY KEY, - LastSeen TEXT, -- YYYY-MM-DD HH:MM:SS.SSS - HaveContactInfo CHARACTER(1), - ContactObject BLOB -); - - -CREATE TABLE CommittedObjects ( -- used to synch nodes - Hash CHARACTER(64) PRIMARY KEY, - ObjType CHAR(1) NOT NULL, -- (L)edger, (T)ransaction, (A)ccount node, transaction (N)ode - LedgerIndex BIGINT UNSIGNED, -- 0 if none - Object BLOB -); - -CREATE INDEX ObjectLocate ON CommittedObjects(LedgerIndex, ObjType); - -CREATE TABLE LocalAcctFamilies ( -- a family of accounts that share a payphrase - FamilyName CHARACTER(40) PRIMARY KEY, - RootPubKey CHARACTER(66), - Seq BIGINT UNSIGNED, -- next one to issue - Name TEXT, - Comment TEXT -); - -CREATE TABLE LocalAccounts ( -- an individual account - ID CHARACTER(40) PRIMARY KEY, - KeyType CHARACTER(1) -- F=family - PrivateKey TEXT, -- For F, FamilyName:Seq - Seq BIGINT UNSIGNED, -- last transaction seen/issued - Balance BIGINT UNSIGNED, - LedgerSeq BIGINT UNSIGNED, -- ledger this balance is from - Name TEXT, - Comment TEXT -); From 09a29ac00d82c00524757d994ce64fb26da0f32c Mon Sep 17 00:00:00 2001 From: Arthur Britto Date: Sun, 20 May 2012 02:29:23 -0700 Subject: [PATCH 2/3] Remove references to Hanko class. --- src/Avalanche.h | 5 ++--- src/Hanko.cpp | 1 + src/Hanko.h | 3 ++- src/Ledger.h | 2 +- src/Transaction.h | 1 - 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Avalanche.h b/src/Avalanche.h index 363aaf14ca..301188edd4 100644 --- a/src/Avalanche.h +++ b/src/Avalanche.h @@ -5,14 +5,13 @@ #include #include "Transaction.h" -#include "Hanko.h" class DisputedTransaction { protected: Transaction::pointer mTransaction; - std::vector mNodesIncluding; - std::vector mNodesRejecting; +// std::vector mNodesIncluding; +// std::vector mNodesRejecting; uint64 mTimeTaken; // when we took our position on this transaction bool mOurPosition; }; diff --git a/src/Hanko.cpp b/src/Hanko.cpp index 98b397740d..4c2bb25b81 100644 --- a/src/Hanko.cpp +++ b/src/Hanko.cpp @@ -9,3 +9,4 @@ Hanko::Hanko() { } +// vim:ts=4 diff --git a/src/Hanko.h b/src/Hanko.h index 9220c6e719..4a1079a5b8 100644 --- a/src/Hanko.h +++ b/src/Hanko.h @@ -39,7 +39,7 @@ public: const CKey& GetPublicKey() const { return mPubKey; } int UpdateContact(std::vector& Contact); - + bool CheckHashSign(const uint256& hash, const std::vector& Signature); bool CheckPrefixSign(const std::vector& data, uint64 type, const std::vector &signature); @@ -62,3 +62,4 @@ public: }; #endif +// vim:ts=4 diff --git a/src/Ledger.h b/src/Ledger.h index aa0c77583f..42e32bdf87 100644 --- a/src/Ledger.h +++ b/src/Ledger.h @@ -177,7 +177,7 @@ public: static int getOfferSkip(const uint256& offerId); bool isCompatible(boost::shared_ptr other); - bool signLedger(std::vector &signature, const LocalHanko &hanko); +// bool signLedger(std::vector &signature, const LocalHanko &hanko); void addJson(Json::Value&); diff --git a/src/Transaction.h b/src/Transaction.h index 97dfed9061..e2a7d43e1e 100644 --- a/src/Transaction.h +++ b/src/Transaction.h @@ -12,7 +12,6 @@ #include "key.h" #include "uint256.h" #include "../obj/src/newcoin.pb.h" -#include "Hanko.h" #include "Serializer.h" #include "SHAMap.h" #include "SerializedTransaction.h" From dfd218c07951941205f3511b65977bfdf947f336 Mon Sep 17 00:00:00 2001 From: Arthur Britto Date: Sun, 20 May 2012 18:47:05 -0700 Subject: [PATCH 3/3] Optimize and fix STAmount. --- src/Amount.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/Amount.cpp b/src/Amount.cpp index 9d63998d13..6aa3439728 100644 --- a/src/Amount.cpp +++ b/src/Amount.cpp @@ -35,9 +35,7 @@ bool STAmount::currencyFromString(uint160& uDstCurrency, const std::string& sCur s.addZeros(16/8); s.addZeros(24/8); - SerializerIterator sit(s); - - uDstCurrency = sit.get160(); + s.get160(uDstCurrency, 0); } else { @@ -57,8 +55,8 @@ std::string STAmount::getCurrencyHuman() } else { - uint160 uReserved = mCurrency; - Serializer s(160/20); + uint160 uReserved = mCurrency; + Serializer s(160/8); s.add160(mCurrency);