diff --git a/lib-protocol/source/channel.cpp b/lib-protocol/source/channel.cpp index 47f66f317..211b24c4d 100644 --- a/lib-protocol/source/channel.cpp +++ b/lib-protocol/source/channel.cpp @@ -170,7 +170,8 @@ task Channel::Send(const Buffer &data) { writ = std::move(error); }); }, *(sctp->*Loot::pointer)); - orc_assert((co_await *writ).ok()); + const auto error(co_await *writ); + orc_assert_(error.ok(), error.message()); } task Description(const S &base, std::vector ice) { diff --git a/lib-protocol/source/layer.hpp b/lib-protocol/source/layer.hpp index 38cf04d1b..ed0f463f6 100644 --- a/lib-protocol/source/layer.hpp +++ b/lib-protocol/source/layer.hpp @@ -73,7 +73,7 @@ auto Layer(Base &base, const Locator &locator, const std::function>>(std::move(stream))); } else orc_assert(false); - }, "connected to " << endpoint); } catch (...) { + }, "using endpoint " << endpoint); } catch (...) { // XXX: maybe I should merge the exceptions? that would be cool if (error == nullptr) error = std::current_exception(); diff --git a/lib-protocol/source/valve.hpp b/lib-protocol/source/valve.hpp index 0918bbd97..bd7e59145 100644 --- a/lib-protocol/source/valve.hpp +++ b/lib-protocol/source/valve.hpp @@ -42,7 +42,7 @@ class Valve { protected: void Stop() noexcept { - orc_insist(!shut_); + orc_insist_(!shut_, "double stop: " << type_); shut_(); } diff --git a/srv-daemon/source/croupier.hpp b/srv-daemon/source/croupier.hpp index b663192e7..b1841c585 100644 --- a/srv-daemon/source/croupier.hpp +++ b/srv-daemon/source/croupier.hpp @@ -60,7 +60,7 @@ class Croupier { const S &Find1(const Address &contract, const uint256_t &chain) { const auto lottery(lotteries1_.find(chain)); - orc_assert(lottery != lotteries1_.end()); + orc_assert_(lottery != lotteries1_.end(), "unsupported lottery chain " << chain); orc_assert(lottery->second->Contract() == contract); return lottery->second; } diff --git a/srv-daemon/source/server.cpp b/srv-daemon/source/server.cpp index b2e1f5a88..5dc4ddef9 100644 --- a/srv-daemon/source/server.cpp +++ b/srv-daemon/source/server.cpp @@ -174,7 +174,7 @@ void Server::Submit0(Pipe *pipe, const Socket &source, const Bytes32 &id const auto until(start + range); const auto now(Timestamp()); - orc_assert(until > now); + orc_assert_(until > now, "expired ticket (by " << (now - until) << " seconds)"); const auto &lottery(croupier_->Find0(contract, chain, recipient)); const uint64_t gas(receipt.size() == 0 ? 84000 /*83267*/ : 103000); @@ -275,8 +275,9 @@ void Server::Submit1(Pipe *pipe, const Socket &source, const Bytes32 &id orc_assert_(recipient == croupier_->Recipient(), recipient << " != " << croupier_->Recipient() << " in " << data); + const auto until(issued + expire); const auto now(Timestamp()); - orc_assert(issued + expire > now); + orc_assert_(until > now, "expired ticket (by " << (now - until) << " seconds)"); const auto &lottery(croupier_->Find1(contract, chain)); const uint64_t gas(60000);