Exemple #1
0
	DomainData Resolve(RCString domain) override {
		if (!ResolverMode)
			Throw(E_NOTIMPL);
		DomainData r;
		EXT_LOCK (MtxSqlite) {
			DbDataReader dr = m_cmdFindDomain.Bind(1, domain).ExecuteReader();
			if (dr.Read()) {
				r.AddressData = dr.GetString(0);
				r.Height = dr.GetInt32(1);
			}
		}
		return r;
	}
Exemple #2
0
	pair<int, int> FindPrevTxCoords(DbWriter& wr, int height, const HashValue& hash) override {
//!!!		ASSERT(!MtxSqlite.try_lock());

		DbDataReader dr = m_cmdTxHashToBlockordIdx
								.Bind(1, ReducedHashValue(hash))
								.ExecuteVector();
		int heightOut = dr.GetInt32(0);
		wr.Write7BitEncoded(height-heightOut+1);
		pair<int, int> pp = TxHashesOutNums(dr.GetBytes(1)).StartingTxOutIdx(hash);
		if (pp.second < 0)
			Throw(E_COIN_InconsistentDatabase);
		return pp;
	}
Exemple #3
0
	int GetNameHeight(const ConstBuf& cbufName, int heightExpired) override {
		DbDataReader dr = m_cmdNameHeight.Bind(1, ToStringName(cbufName)).ExecuteReader();
		return dr.Read() ? dr.GetInt32(0) : -1;
	}