From 950aebe690b0100372c2fcaef1aa1681cb2b1e3c Mon Sep 17 00:00:00 2001 From: intelliot Date: Fri, 24 Mar 2023 05:32:31 +0000 Subject: [PATCH] deploy: 7aad6e51278a90fdb743b45d6b5df94a03d90d31 --- AmendmentTable_8cpp_source.html | 962 ++--- AmendmentTable_8h_source.html | 14 +- AmendmentTable__test_8cpp_source.html | 1802 ++++----- Application_8cpp_source.html | 8 +- CassandraFactory_8cpp_source.html | 5 +- Config_8cpp_source.html | 2 +- Env_8h_source.html | 6 +- Env__test_8cpp_source.html | 2 +- Feature.html | 4 +- Feature_8cpp_source.html | 880 ++--- Feature_8h_source.html | 27 +- Feature__test_8cpp_source.html | 833 +++-- NuDBFactory_8cpp_source.html | 5 +- SField_8cpp_source.html | 3 +- TxQ__test_8cpp_source.html | 2 +- Wallet_8h_source.html | 3 +- classripple_1_1AmendmentTableImpl.html | 40 +- ...ipple_1_1AmendmentTable__test-members.html | 36 +- classripple_1_1AmendmentTable__test.html | 433 ++- ...e_1_1AmendmentTable__test__coll__graph.map | 30 +- ...e_1_1AmendmentTable__test__coll__graph.md5 | 2 +- ...e_1_1AmendmentTable__test__coll__graph.png | Bin 79979 -> 92495 bytes classripple_1_1Feature__test-members.html | 9 +- classripple_1_1Feature__test.html | 47 +- functions.html | 31 +- functions_c.html | 24 +- functions_e.html | 8 +- functions_func_c.html | 48 +- functions_func_m.html | 21 +- functions_func_r.html | 2 +- functions_func_s.html | 20 +- functions_func_t.html | 42 +- functions_func_w.html | 4 +- functions_j.html | 10 +- functions_m.html | 15 +- functions_n.html | 2 +- functions_o.html | 131 +- functions_r.html | 2 +- functions_s.html | 41 +- functions_t.html | 54 +- functions_v.html | 12 +- functions_vars.html | 3 + functions_vars_e.html | 8 +- functions_vars_j.html | 6 +- functions_vars_o.html | 3 + functions_vars_s.html | 3 - functions_vars_v.html | 2 +- functions_vars_y.html | 3 + functions_w.html | 10 +- functions_y.html | 3 + namespacemembers_d.html | 5 +- namespacemembers_enum.html | 6 +- namespacemembers_func_i.html | 6 +- namespacemembers_func_r.html | 6 +- namespacemembers_func_s.html | 2 +- namespacemembers_i.html | 6 +- namespacemembers_r.html | 6 +- namespacemembers_s.html | 2 +- namespacemembers_v.html | 3 + namespaceripple.html | 760 ++-- namespaceripple_1_1detail.html | 18 +- search/all_1.js | 623 ++-- search/all_10.js | 1246 +++---- search/all_11.js | 96 +- search/all_12.js | 1340 +++---- search/all_13.js | 2875 +++++++------- search/all_14.js | 3287 +++++++++-------- search/all_15.js | 708 ++-- search/all_16.js | 503 +-- search/all_17.js | 472 +-- search/all_18.js | 144 +- search/all_19.js | 15 +- search/all_1a.js | 16 +- search/all_1b.js | 710 ++-- search/all_2.js | 642 ++-- search/all_3.js | 1611 ++++---- search/all_4.js | 1143 +++--- search/all_5.js | 574 +-- search/all_6.js | 986 ++--- search/all_7.js | 1302 +++---- search/all_8.js | 392 +- search/all_9.js | 1578 ++++---- search/all_a.js | 226 +- search/all_b.js | 112 +- search/all_c.js | 932 ++--- search/all_d.js | 1945 +++++----- search/all_e.js | 658 ++-- search/all_f.js | 675 ++-- search/classes_0.js | 4 +- search/classes_1.js | 396 +- search/classes_10.js | 268 +- search/classes_11.js | 22 +- search/classes_12.js | 256 +- search/classes_13.js | 664 ++-- search/classes_14.js | 302 +- search/classes_15.js | 408 +- search/classes_16.js | 254 +- search/classes_17.js | 144 +- search/classes_18.js | 36 +- search/classes_19.js | 4 +- search/classes_1a.js | 10 +- search/classes_2.js | 228 +- search/classes_3.js | 426 +-- search/classes_4.js | 202 +- search/classes_5.js | 182 +- search/classes_6.js | 154 +- search/classes_7.js | 56 +- search/classes_8.js | 80 +- search/classes_9.js | 410 +- search/classes_a.js | 46 +- search/classes_b.js | 32 +- search/classes_c.js | 214 +- search/classes_d.js | 274 +- search/classes_e.js | 170 +- search/classes_f.js | 174 +- search/enums_0.js | 12 +- search/enums_1.js | 20 +- search/enums_10.js | 30 +- search/enums_11.js | 34 +- search/enums_12.js | 9 +- search/enums_13.js | 6 +- search/enums_14.js | 6 +- search/enums_2.js | 9 +- search/enums_3.js | 10 +- search/enums_4.js | 6 +- search/enums_5.js | 4 +- search/enums_6.js | 4 +- search/enums_7.js | 4 +- search/enums_8.js | 4 +- search/enums_9.js | 14 +- search/enums_a.js | 4 +- search/enums_b.js | 6 +- search/enums_c.js | 6 +- search/enums_d.js | 18 +- search/enums_e.js | 2 +- search/enums_f.js | 10 +- search/enumvalues_0.js | 44 +- search/enumvalues_1.js | 46 +- search/enumvalues_10.js | 4 +- search/enumvalues_11.js | 172 +- search/enumvalues_12.js | 176 +- search/enumvalues_13.js | 450 +-- search/enumvalues_14.js | 28 +- search/enumvalues_15.js | 12 +- search/enumvalues_16.js | 18 +- search/enumvalues_17.js | 18 +- search/enumvalues_18.js | 2 +- search/enumvalues_2.js | 50 +- search/enumvalues_3.js | 54 +- search/enumvalues_4.js | 26 +- search/enumvalues_5.js | 36 +- search/enumvalues_6.js | 42 +- search/enumvalues_7.js | 24 +- search/enumvalues_8.js | 32 +- search/enumvalues_9.js | 96 +- search/enumvalues_a.js | 28 +- search/enumvalues_b.js | 164 +- search/enumvalues_c.js | 46 +- search/enumvalues_d.js | 66 +- search/enumvalues_e.js | 38 +- search/enumvalues_f.js | 42 +- search/files_0.js | 8 +- search/files_1.js | 4 +- search/files_10.js | 8 +- search/files_2.js | 68 +- search/files_3.js | 2 +- search/files_4.js | 4 +- search/files_5.js | 10 +- search/files_6.js | 14 +- search/files_7.js | 6 +- search/files_8.js | 8 +- search/files_9.js | 4 +- search/files_a.js | 4 +- search/files_b.js | 2 +- search/files_c.js | 8 +- search/files_d.js | 26 +- search/files_e.js | 10 +- search/files_f.js | 6 +- search/functions_0.js | 2 +- search/functions_1.js | 740 ++-- search/functions_10.js | 750 ++-- search/functions_11.js | 48 +- search/functions_12.js | 608 +-- search/functions_13.js | 1342 +++---- search/functions_14.js | 2255 +++++------ search/functions_15.js | 242 +- search/functions_16.js | 174 +- search/functions_17.js | 298 +- search/functions_18.js | 82 +- search/functions_19.js | 2 +- search/functions_1a.js | 10 +- search/functions_1b.js | 710 ++-- search/functions_2.js | 302 +- search/functions_3.js | 925 ++--- search/functions_4.js | 738 ++-- search/functions_5.js | 300 +- search/functions_6.js | 534 +-- search/functions_7.js | 1190 +++--- search/functions_8.js | 186 +- search/functions_9.js | 844 ++--- search/functions_a.js | 48 +- search/functions_b.js | 34 +- search/functions_c.js | 356 +- search/functions_d.js | 611 +-- search/functions_e.js | 324 +- search/functions_f.js | 430 +-- search/groups_0.js | 2 +- search/namespaces_0.js | 24 +- search/namespaces_1.js | 4 +- search/namespaces_2.js | 2 +- search/namespaces_3.js | 80 +- search/namespaces_4.js | 24 +- search/pages_0.js | 2 +- search/pages_1.js | 4 +- search/pages_2.js | 10 +- search/pages_3.js | 6 +- search/pages_4.js | 2 +- search/pages_5.js | 6 +- search/pages_6.js | 6 +- search/pages_7.js | 4 +- search/pages_8.js | 4 +- search/pages_9.js | 2 +- search/pages_a.js | 4 +- search/pages_b.js | 6 +- search/pages_c.js | 16 +- search/pages_d.js | 8 +- search/pages_e.js | 2 +- search/pages_f.js | 2 +- search/related_0.js | 8 +- search/related_1.js | 16 +- search/related_2.js | 4 +- search/related_3.js | 6 +- search/related_4.js | 2 +- search/related_5.js | 2 +- search/related_6.js | 18 +- search/related_7.js | 14 +- search/related_8.js | 34 +- search/related_9.js | 6 +- search/related_a.js | 10 +- search/related_b.js | 12 +- search/related_c.js | 4 +- search/related_d.js | 6 +- search/typedefs_0.js | 50 +- search/typedefs_1.js | 28 +- search/typedefs_10.js | 2 +- search/typedefs_11.js | 54 +- search/typedefs_12.js | 154 +- search/typedefs_13.js | 80 +- search/typedefs_14.js | 16 +- search/typedefs_15.js | 14 +- search/typedefs_16.js | 10 +- search/typedefs_17.js | 2 +- search/typedefs_18.js | 2 +- search/typedefs_2.js | 62 +- search/typedefs_3.js | 28 +- search/typedefs_4.js | 36 +- search/typedefs_5.js | 20 +- search/typedefs_6.js | 2 +- search/typedefs_7.js | 38 +- search/typedefs_8.js | 52 +- search/typedefs_9.js | 6 +- search/typedefs_a.js | 14 +- search/typedefs_b.js | 52 +- search/typedefs_c.js | 58 +- search/typedefs_d.js | 22 +- search/typedefs_e.js | 20 +- search/typedefs_f.js | 56 +- search/variables_0.js | 329 +- search/variables_1.js | 148 +- search/variables_10.js | 42 +- search/variables_11.js | 330 +- search/variables_12.js | 927 +++-- search/variables_13.js | 382 +- search/variables_14.js | 70 +- search/variables_15.js | 124 +- search/variables_16.js | 96 +- search/variables_17.js | 18 +- search/variables_18.js | 5 +- search/variables_19.js | 2 +- search/variables_2.js | 336 +- search/variables_3.js | 234 +- search/variables_4.js | 118 +- search/variables_5.js | 372 +- search/variables_6.js | 54 +- search/variables_7.js | 106 +- search/variables_8.js | 384 +- search/variables_9.js | 50 +- search/variables_a.js | 26 +- search/variables_b.js | 288 +- search/variables_c.js | 1122 +++--- search/variables_d.js | 200 +- search/variables_e.js | 99 +- search/variables_f.js | 312 +- ...AmendmentTable_1_1FeatureInfo-members.html | 4 +- ...pple_1_1AmendmentTable_1_1FeatureInfo.html | 20 +- 295 files changed, 30501 insertions(+), 29856 deletions(-) diff --git a/AmendmentTable_8cpp_source.html b/AmendmentTable_8cpp_source.html index 4b737b38a1..5e8b2781af 100644 --- a/AmendmentTable_8cpp_source.html +++ b/AmendmentTable_8cpp_source.html @@ -385,472 +385,495 @@ $(function() {
333  }();
334 
335  // Parse supported amendments
-
336  for (auto const& [name, amendment, defaultVote] : supported)
+
336  for (auto const& [name, amendment, votebehavior] : supported)
337  {
338  AmendmentState& s = add(amendment, lock);
339 
340  s.name = name;
341  s.supported = true;
-
342  s.vote = defaultVote == DefaultVote::yes ? AmendmentVote::up
-
343  : AmendmentVote::down;
-
344 
-
345  JLOG(j_.debug()) << "Amendment " << amendment << " (" << s.name
-
346  << ") is supported and will be "
-
347  << (s.vote == AmendmentVote::up ? "up" : "down")
-
348  << " voted if not enabled on the ledger.";
-
349  }
-
350 
-
351  hash_set<uint256> detect_conflict;
-
352  // Parse enabled amendments from config
-
353  for (std::pair<uint256, std::string> const& a : parseSection(enabled))
-
354  {
-
355  if (featureVotesExist)
-
356  { // If the table existed, warn about duplicate config info
-
357  JLOG(j_.warn()) << "[amendments] section in config file ignored"
-
358  " in favor of data in db/wallet.db.";
-
359  break;
-
360  }
-
361  else
-
362  { // Otherwise transfer config data into the table
-
363  detect_conflict.insert(a.first);
-
364  persistVote(a.first, a.second, AmendmentVote::up);
-
365  }
-
366  }
-
367 
-
368  // Parse vetoed amendments from config
-
369  for (auto const& a : parseSection(vetoed))
-
370  {
-
371  if (featureVotesExist)
-
372  { // If the table existed, warn about duplicate config info
-
373  JLOG(j_.warn())
-
374  << "[veto_amendments] section in config file ignored"
-
375  " in favor of data in db/wallet.db.";
-
376  break;
+
342  switch (votebehavior)
+
343  {
+
344  case VoteBehavior::DefaultYes:
+
345  s.vote = AmendmentVote::up;
+
346  break;
+
347 
+
348  case VoteBehavior::DefaultNo:
+
349  s.vote = AmendmentVote::down;
+
350  break;
+
351 
+
352  case VoteBehavior::Obsolete:
+
353  s.vote = AmendmentVote::obsolete;
+
354  break;
+
355  }
+
356 
+
357  JLOG(j_.debug()) << "Amendment " << amendment << " (" << s.name
+
358  << ") is supported and will be "
+
359  << (s.vote == AmendmentVote::up ? "up" : "down")
+
360  << " voted by default if not enabled on the ledger.";
+
361  }
+
362 
+
363  hash_set<uint256> detect_conflict;
+
364  // Parse enabled amendments from config
+
365  for (std::pair<uint256, std::string> const& a : parseSection(enabled))
+
366  {
+
367  if (featureVotesExist)
+
368  { // If the table existed, warn about duplicate config info
+
369  JLOG(j_.warn()) << "[amendments] section in config file ignored"
+
370  " in favor of data in db/wallet.db.";
+
371  break;
+
372  }
+
373  else
+
374  { // Otherwise transfer config data into the table
+
375  detect_conflict.insert(a.first);
+
376  persistVote(a.first, a.second, AmendmentVote::up);
377  }
-
378  else
-
379  { // Otherwise transfer config data into the table
-
380  if (detect_conflict.count(a.first) == 0)
-
381  {
-
382  persistVote(a.first, a.second, AmendmentVote::down);
-
383  }
-
384  else
-
385  {
-
386  JLOG(j_.warn())
-
387  << "[veto_amendments] section in config has amendment "
-
388  << '(' << a.first << ", " << a.second
-
389  << ") both [veto_amendments] and [amendments].";
-
390  }
-
391  }
-
392  }
-
393 
-
394  // Read amendment votes from wallet.db
-
395  auto db = db_.checkoutDb();
-
396  readAmendments(
-
397  *db,
-
398  [&](boost::optional<std::string> amendment_hash,
-
399  boost::optional<std::string> amendment_name,
-
400  boost::optional<AmendmentVote> vote) {
-
401  uint256 amend_hash;
-
402  if (!amendment_hash || !amendment_name || !vote)
-
403  {
-
404  // These fields should never have nulls, but check
-
405  Throw<std::runtime_error>(
-
406  "Invalid FeatureVotes row in wallet.db");
-
407  }
-
408  if (!amend_hash.parseHex(*amendment_hash))
-
409  {
-
410  Throw<std::runtime_error>(
-
411  "Invalid amendment ID '" + *amendment_hash +
-
412  " in wallet.db");
-
413  }
-
414  if (*vote == AmendmentVote::down)
+
378  }
+
379 
+
380  // Parse vetoed amendments from config
+
381  for (auto const& a : parseSection(vetoed))
+
382  {
+
383  if (featureVotesExist)
+
384  { // If the table existed, warn about duplicate config info
+
385  JLOG(j_.warn())
+
386  << "[veto_amendments] section in config file ignored"
+
387  " in favor of data in db/wallet.db.";
+
388  break;
+
389  }
+
390  else
+
391  { // Otherwise transfer config data into the table
+
392  if (detect_conflict.count(a.first) == 0)
+
393  {
+
394  persistVote(a.first, a.second, AmendmentVote::down);
+
395  }
+
396  else
+
397  {
+
398  JLOG(j_.warn())
+
399  << "[veto_amendments] section in config has amendment "
+
400  << '(' << a.first << ", " << a.second
+
401  << ") both [veto_amendments] and [amendments].";
+
402  }
+
403  }
+
404  }
+
405 
+
406  // Read amendment votes from wallet.db
+
407  auto db = db_.checkoutDb();
+
408  readAmendments(
+
409  *db,
+
410  [&](boost::optional<std::string> amendment_hash,
+
411  boost::optional<std::string> amendment_name,
+
412  boost::optional<AmendmentVote> vote) {
+
413  uint256 amend_hash;
+
414  if (!amendment_hash || !amendment_name || !vote)
415  {
-
416  // Unknown amendments are effectively vetoed already
-
417  if (auto s = get(amend_hash, lock))
-
418  {
-
419  JLOG(j_.info()) << "Amendment {" << *amendment_name << ", "
-
420  << amend_hash << "} is downvoted.";
-
421  if (!amendment_name->empty())
-
422  s->name = *amendment_name;
-
423  s->vote = *vote;
-
424  }
+
416  // These fields should never have nulls, but check
+
417  Throw<std::runtime_error>(
+
418  "Invalid FeatureVotes row in wallet.db");
+
419  }
+
420  if (!amend_hash.parseHex(*amendment_hash))
+
421  {
+
422  Throw<std::runtime_error>(
+
423  "Invalid amendment ID '" + *amendment_hash +
+
424  " in wallet.db");
425  }
-
426  else // up-vote
+
426  if (*vote == AmendmentVote::down)
427  {
-
428  AmendmentState& s = add(amend_hash, lock);
-
429 
-
430  JLOG(j_.debug()) << "Amendment {" << *amendment_name << ", "
-
431  << amend_hash << "} is upvoted.";
-
432  if (!amendment_name->empty())
-
433  s.name = *amendment_name;
-
434  s.vote = *vote;
-
435  }
-
436  });
-
437 }
-
438 
-
439 AmendmentState&
-
440 AmendmentTableImpl::add(
-
441  uint256 const& amendmentHash,
-
442  std::lock_guard<std::mutex> const&)
-
443 {
-
444  // call with the mutex held
-
445  return amendmentMap_[amendmentHash];
-
446 }
-
447 
-
448 AmendmentState*
-
449 AmendmentTableImpl::get(
-
450  uint256 const& amendmentHash,
-
451  std::lock_guard<std::mutex> const& lock)
-
452 {
-
453  // Forward to the const version of get.
-
454  return const_cast<AmendmentState*>(
-
455  std::as_const(*this).get(amendmentHash, lock));
-
456 }
-
457 
-
458 AmendmentState const*
-
459 AmendmentTableImpl::get(
-
460  uint256 const& amendmentHash,
-
461  std::lock_guard<std::mutex> const&) const
-
462 {
-
463  // call with the mutex held
-
464  auto ret = amendmentMap_.find(amendmentHash);
-
465 
-
466  if (ret == amendmentMap_.end())
-
467  return nullptr;
-
468 
-
469  return &ret->second;
-
470 }
-
471 
-
472 uint256
-
473 AmendmentTableImpl::find(std::string const& name) const
-
474 {
-
475  std::lock_guard lock(mutex_);
-
476 
-
477  for (auto const& e : amendmentMap_)
-
478  {
-
479  if (name == e.second.name)
-
480  return e.first;
-
481  }
-
482 
-
483  return {};
-
484 }
-
485 
-
486 void
-
487 AmendmentTableImpl::persistVote(
-
488  uint256 const& amendment,
-
489  std::string const& name,
-
490  AmendmentVote vote) const
-
491 {
-
492  auto db = db_.checkoutDb();
-
493  voteAmendment(*db, amendment, name, vote);
-
494 }
-
495 
-
496 bool
-
497 AmendmentTableImpl::veto(uint256 const& amendment)
-
498 {
-
499  std::lock_guard lock(mutex_);
-
500  AmendmentState& s = add(amendment, lock);
+
428  // Unknown amendments are effectively vetoed already
+
429  if (auto s = get(amend_hash, lock))
+
430  {
+
431  JLOG(j_.info()) << "Amendment {" << *amendment_name << ", "
+
432  << amend_hash << "} is downvoted.";
+
433  if (!amendment_name->empty())
+
434  s->name = *amendment_name;
+
435  // An obsolete amendment's vote can never be changed
+
436  if (s->vote != AmendmentVote::obsolete)
+
437  s->vote = *vote;
+
438  }
+
439  }
+
440  else // up-vote
+
441  {
+
442  AmendmentState& s = add(amend_hash, lock);
+
443 
+
444  JLOG(j_.debug()) << "Amendment {" << *amendment_name << ", "
+
445  << amend_hash << "} is upvoted.";
+
446  if (!amendment_name->empty())
+
447  s.name = *amendment_name;
+
448  // An obsolete amendment's vote can never be changed
+
449  if (s.vote != AmendmentVote::obsolete)
+
450  s.vote = *vote;
+
451  }
+
452  });
+
453 }
+
454 
+
455 AmendmentState&
+
456 AmendmentTableImpl::add(
+
457  uint256 const& amendmentHash,
+
458  std::lock_guard<std::mutex> const&)
+
459 {
+
460  // call with the mutex held
+
461  return amendmentMap_[amendmentHash];
+
462 }
+
463 
+
464 AmendmentState*
+
465 AmendmentTableImpl::get(
+
466  uint256 const& amendmentHash,
+
467  std::lock_guard<std::mutex> const& lock)
+
468 {
+
469  // Forward to the const version of get.
+
470  return const_cast<AmendmentState*>(
+
471  std::as_const(*this).get(amendmentHash, lock));
+
472 }
+
473 
+
474 AmendmentState const*
+
475 AmendmentTableImpl::get(
+
476  uint256 const& amendmentHash,
+
477  std::lock_guard<std::mutex> const&) const
+
478 {
+
479  // call with the mutex held
+
480  auto ret = amendmentMap_.find(amendmentHash);
+
481 
+
482  if (ret == amendmentMap_.end())
+
483  return nullptr;
+
484 
+
485  return &ret->second;
+
486 }
+
487 
+
488 uint256
+
489 AmendmentTableImpl::find(std::string const& name) const
+
490 {
+
491  std::lock_guard lock(mutex_);
+
492 
+
493  for (auto const& e : amendmentMap_)
+
494  {
+
495  if (name == e.second.name)
+
496  return e.first;
+
497  }
+
498 
+
499  return {};
+
500 }
501 
-
502  if (s.vote == AmendmentVote::down)
-
503  return false;
-
504  s.vote = AmendmentVote::down;
-
505  persistVote(amendment, s.name, s.vote);
-
506  return true;
-
507 }
-
508 
-
509 bool
-
510 AmendmentTableImpl::unVeto(uint256 const& amendment)
-
511 {
-
512  std::lock_guard lock(mutex_);
-
513  AmendmentState* const s = get(amendment, lock);
-
514 
-
515  if (!s || s->vote == AmendmentVote::up)
-
516  return false;
-
517  s->vote = AmendmentVote::up;
-
518  persistVote(amendment, s->name, s->vote);
-
519  return true;
-
520 }
-
521 
-
522 bool
-
523 AmendmentTableImpl::enable(uint256 const& amendment)
-
524 {
-
525  std::lock_guard lock(mutex_);
-
526  AmendmentState& s = add(amendment, lock);
-
527 
-
528  if (s.enabled)
-
529  return false;
-
530 
-
531  s.enabled = true;
-
532 
-
533  if (!s.supported)
-
534  {
-
535  JLOG(j_.error()) << "Unsupported amendment " << amendment
-
536  << " activated.";
-
537  unsupportedEnabled_ = true;
-
538  }
-
539 
-
540  return true;
-
541 }
-
542 
-
543 bool
-
544 AmendmentTableImpl::isEnabled(uint256 const& amendment) const
-
545 {
-
546  std::lock_guard lock(mutex_);
-
547  AmendmentState const* s = get(amendment, lock);
-
548  return s && s->enabled;
-
549 }
-
550 
-
551 bool
-
552 AmendmentTableImpl::isSupported(uint256 const& amendment) const
-
553 {
-
554  std::lock_guard lock(mutex_);
-
555  AmendmentState const* s = get(amendment, lock);
-
556  return s && s->supported;
-
557 }
-
558 
-
559 bool
-
560 AmendmentTableImpl::hasUnsupportedEnabled() const
-
561 {
-
562  std::lock_guard lock(mutex_);
-
563  return unsupportedEnabled_;
-
564 }
-
565 
-
566 std::optional<NetClock::time_point>
-
567 AmendmentTableImpl::firstUnsupportedExpected() const
-
568 {
-
569  std::lock_guard lock(mutex_);
-
570  return firstUnsupportedExpected_;
-
571 }
-
572 
-
573 std::vector<uint256>
-
574 AmendmentTableImpl::doValidation(std::set<uint256> const& enabled) const
-
575 {
-
576  // Get the list of amendments we support and do not
-
577  // veto, but that are not already enabled
-
578  std::vector<uint256> amendments;
-
579 
-
580  {
-
581  std::lock_guard lock(mutex_);
-
582  amendments.reserve(amendmentMap_.size());
-
583  for (auto const& e : amendmentMap_)
-
584  {
-
585  if (e.second.supported && e.second.vote == AmendmentVote::up &&
-
586  (enabled.count(e.first) == 0))
-
587  {
-
588  amendments.push_back(e.first);
-
589  JLOG(j_.info()) << "Voting for amendment " << e.second.name;
-
590  }
-
591  }
-
592  }
-
593 
-
594  if (!amendments.empty())
-
595  std::sort(amendments.begin(), amendments.end());
+
502 void
+
503 AmendmentTableImpl::persistVote(
+
504  uint256 const& amendment,
+
505  std::string const& name,
+
506  AmendmentVote vote) const
+
507 {
+
508  assert(vote != AmendmentVote::obsolete);
+
509  auto db = db_.checkoutDb();
+
510  voteAmendment(*db, amendment, name, vote);
+
511 }
+
512 
+
513 bool
+
514 AmendmentTableImpl::veto(uint256 const& amendment)
+
515 {
+
516  std::lock_guard lock(mutex_);
+
517  AmendmentState& s = add(amendment, lock);
+
518 
+
519  if (s.vote != AmendmentVote::up)
+
520  return false;
+
521  s.vote = AmendmentVote::down;
+
522  persistVote(amendment, s.name, s.vote);
+
523  return true;
+
524 }
+
525 
+
526 bool
+
527 AmendmentTableImpl::unVeto(uint256 const& amendment)
+
528 {
+
529  std::lock_guard lock(mutex_);
+
530  AmendmentState* const s = get(amendment, lock);
+
531 
+
532  if (!s || s->vote != AmendmentVote::down)
+
533  return false;
+
534  s->vote = AmendmentVote::up;
+
535  persistVote(amendment, s->name, s->vote);
+
536  return true;
+
537 }
+
538 
+
539 bool
+
540 AmendmentTableImpl::enable(uint256 const& amendment)
+
541 {
+
542  std::lock_guard lock(mutex_);
+
543  AmendmentState& s = add(amendment, lock);
+
544 
+
545  if (s.enabled)
+
546  return false;
+
547 
+
548  s.enabled = true;
+
549 
+
550  if (!s.supported)
+
551  {
+
552  JLOG(j_.error()) << "Unsupported amendment " << amendment
+
553  << " activated.";
+
554  unsupportedEnabled_ = true;
+
555  }
+
556 
+
557  return true;
+
558 }
+
559 
+
560 bool
+
561 AmendmentTableImpl::isEnabled(uint256 const& amendment) const
+
562 {
+
563  std::lock_guard lock(mutex_);
+
564  AmendmentState const* s = get(amendment, lock);
+
565  return s && s->enabled;
+
566 }
+
567 
+
568 bool
+
569 AmendmentTableImpl::isSupported(uint256 const& amendment) const
+
570 {
+
571  std::lock_guard lock(mutex_);
+
572  AmendmentState const* s = get(amendment, lock);
+
573  return s && s->supported;
+
574 }
+
575 
+
576 bool
+
577 AmendmentTableImpl::hasUnsupportedEnabled() const
+
578 {
+
579  std::lock_guard lock(mutex_);
+
580  return unsupportedEnabled_;
+
581 }
+
582 
+
583 std::optional<NetClock::time_point>
+
584 AmendmentTableImpl::firstUnsupportedExpected() const
+
585 {
+
586  std::lock_guard lock(mutex_);
+
587  return firstUnsupportedExpected_;
+
588 }
+
589 
+
590 std::vector<uint256>
+
591 AmendmentTableImpl::doValidation(std::set<uint256> const& enabled) const
+
592 {
+
593  // Get the list of amendments we support and do not
+
594  // veto, but that are not already enabled
+
595  std::vector<uint256> amendments;
596 
-
597  return amendments;
-
598 }
-
599 
-
600 std::vector<uint256>
-
601 AmendmentTableImpl::getDesired() const
-
602 {
-
603  // Get the list of amendments we support and do not veto
-
604  return doValidation({});
-
605 }
-
606 
-
607 std::map<uint256, std::uint32_t>
-
608 AmendmentTableImpl::doVoting(
-
609  Rules const& rules,
-
610  NetClock::time_point closeTime,
-
611  std::set<uint256> const& enabledAmendments,
-
612  majorityAmendments_t const& majorityAmendments,
-
613  std::vector<std::shared_ptr<STValidation>> const& valSet)
-
614 {
-
615  JLOG(j_.trace()) << "voting at " << closeTime.time_since_epoch().count()
-
616  << ": " << enabledAmendments.size() << ", "
-
617  << majorityAmendments.size() << ", " << valSet.size();
-
618 
-
619  auto vote = std::make_unique<AmendmentSet>(rules, valSet);
-
620 
-
621  JLOG(j_.debug()) << "Received " << vote->trustedValidations()
-
622  << " trusted validations, threshold is: "
-
623  << vote->threshold();
-
624 
-
625  // Map of amendments to the action to be taken for each one. The action is
-
626  // the value of the flags in the pseudo-transaction
-
627  std::map<uint256, std::uint32_t> actions;
-
628 
-
629  std::lock_guard lock(mutex_);
-
630 
-
631  // process all amendments we know of
-
632  for (auto const& entry : amendmentMap_)
-
633  {
-
634  NetClock::time_point majorityTime = {};
+
597  {
+
598  std::lock_guard lock(mutex_);
+
599  amendments.reserve(amendmentMap_.size());
+
600  for (auto const& e : amendmentMap_)
+
601  {
+
602  if (e.second.supported && e.second.vote == AmendmentVote::up &&
+
603  (enabled.count(e.first) == 0))
+
604  {
+
605  amendments.push_back(e.first);
+
606  JLOG(j_.info()) << "Voting for amendment " << e.second.name;
+
607  }
+
608  }
+
609  }
+
610 
+
611  if (!amendments.empty())
+
612  std::sort(amendments.begin(), amendments.end());
+
613 
+
614  return amendments;
+
615 }
+
616 
+
617 std::vector<uint256>
+
618 AmendmentTableImpl::getDesired() const
+
619 {
+
620  // Get the list of amendments we support and do not veto
+
621  return doValidation({});
+
622 }
+
623 
+
624 std::map<uint256, std::uint32_t>
+
625 AmendmentTableImpl::doVoting(
+
626  Rules const& rules,
+
627  NetClock::time_point closeTime,
+
628  std::set<uint256> const& enabledAmendments,
+
629  majorityAmendments_t const& majorityAmendments,
+
630  std::vector<std::shared_ptr<STValidation>> const& valSet)
+
631 {
+
632  JLOG(j_.trace()) << "voting at " << closeTime.time_since_epoch().count()
+
633  << ": " << enabledAmendments.size() << ", "
+
634  << majorityAmendments.size() << ", " << valSet.size();
635 
-
636  bool const hasValMajority = vote->passes(entry.first);
+
636  auto vote = std::make_unique<AmendmentSet>(rules, valSet);
637 
-
638  {
-
639  auto const it = majorityAmendments.find(entry.first);
-
640  if (it != majorityAmendments.end())
-
641  majorityTime = it->second;
-
642  }
-
643 
-
644  if (enabledAmendments.count(entry.first) != 0)
-
645  {
-
646  JLOG(j_.debug()) << entry.first << ": amendment already enabled";
-
647  }
-
648  else if (
-
649  hasValMajority && (majorityTime == NetClock::time_point{}) &&
-
650  entry.second.vote == AmendmentVote::up)
-
651  {
-
652  // Ledger says no majority, validators say yes
-
653  JLOG(j_.debug()) << entry.first << ": amendment got majority";
-
654  actions[entry.first] = tfGotMajority;
-
655  }
-
656  else if (!hasValMajority && (majorityTime != NetClock::time_point{}))
-
657  {
-
658  // Ledger says majority, validators say no
-
659  JLOG(j_.debug()) << entry.first << ": amendment lost majority";
-
660  actions[entry.first] = tfLostMajority;
-
661  }
-
662  else if (
-
663  (majorityTime != NetClock::time_point{}) &&
-
664  ((majorityTime + majorityTime_) <= closeTime) &&
-
665  entry.second.vote == AmendmentVote::up)
-
666  {
-
667  // Ledger says majority held
-
668  JLOG(j_.debug()) << entry.first << ": amendment majority held";
-
669  actions[entry.first] = 0;
-
670  }
-
671  }
-
672 
-
673  // Stash for reporting
-
674  lastVote_ = std::move(vote);
-
675  return actions;
-
676 }
-
677 
-
678 bool
-
679 AmendmentTableImpl::needValidatedLedger(LedgerIndex ledgerSeq) const
-
680 {
-
681  std::lock_guard lock(mutex_);
-
682 
-
683  // Is there a ledger in which an amendment could have been enabled
-
684  // between these two ledger sequences?
-
685 
-
686  return ((ledgerSeq - 1) / 256) != ((lastUpdateSeq_ - 1) / 256);
-
687 }
-
688 
-
689 void
-
690 AmendmentTableImpl::doValidatedLedger(
-
691  LedgerIndex ledgerSeq,
-
692  std::set<uint256> const& enabled,
-
693  majorityAmendments_t const& majority)
-
694 {
-
695  for (auto& e : enabled)
-
696  enable(e);
-
697 
+
638  JLOG(j_.debug()) << "Received " << vote->trustedValidations()
+
639  << " trusted validations, threshold is: "
+
640  << vote->threshold();
+
641 
+
642  // Map of amendments to the action to be taken for each one. The action is
+
643  // the value of the flags in the pseudo-transaction
+
644  std::map<uint256, std::uint32_t> actions;
+
645 
+
646  std::lock_guard lock(mutex_);
+
647 
+
648  // process all amendments we know of
+
649  for (auto const& entry : amendmentMap_)
+
650  {
+
651  NetClock::time_point majorityTime = {};
+
652 
+
653  bool const hasValMajority = vote->passes(entry.first);
+
654 
+
655  {
+
656  auto const it = majorityAmendments.find(entry.first);
+
657  if (it != majorityAmendments.end())
+
658  majorityTime = it->second;
+
659  }
+
660 
+
661  if (enabledAmendments.count(entry.first) != 0)
+
662  {
+
663  JLOG(j_.debug()) << entry.first << ": amendment already enabled";
+
664  }
+
665  else if (
+
666  hasValMajority && (majorityTime == NetClock::time_point{}) &&
+
667  entry.second.vote == AmendmentVote::up)
+
668  {
+
669  // Ledger says no majority, validators say yes
+
670  JLOG(j_.debug()) << entry.first << ": amendment got majority";
+
671  actions[entry.first] = tfGotMajority;
+
672  }
+
673  else if (!hasValMajority && (majorityTime != NetClock::time_point{}))
+
674  {
+
675  // Ledger says majority, validators say no
+
676  JLOG(j_.debug()) << entry.first << ": amendment lost majority";
+
677  actions[entry.first] = tfLostMajority;
+
678  }
+
679  else if (
+
680  (majorityTime != NetClock::time_point{}) &&
+
681  ((majorityTime + majorityTime_) <= closeTime) &&
+
682  entry.second.vote == AmendmentVote::up)
+
683  {
+
684  // Ledger says majority held
+
685  JLOG(j_.debug()) << entry.first << ": amendment majority held";
+
686  actions[entry.first] = 0;
+
687  }
+
688  }
+
689 
+
690  // Stash for reporting
+
691  lastVote_ = std::move(vote);
+
692  return actions;
+
693 }
+
694 
+
695 bool
+
696 AmendmentTableImpl::needValidatedLedger(LedgerIndex ledgerSeq) const
+
697 {
698  std::lock_guard lock(mutex_);
699 
-
700  // Remember the ledger sequence of this update.
-
701  lastUpdateSeq_ = ledgerSeq;
+
700  // Is there a ledger in which an amendment could have been enabled
+
701  // between these two ledger sequences?
702 
-
703  // Since we have the whole list in `majority`, reset the time flag, even
-
704  // if it's currently set. If it's not set when the loop is done, then any
-
705  // prior unknown amendments have lost majority.
-
706  firstUnsupportedExpected_.reset();
-
707  for (auto const& [hash, time] : majority)
-
708  {
-
709  AmendmentState& s = add(hash, lock);
-
710 
-
711  if (s.enabled)
-
712  continue;
-
713 
-
714  if (!s.supported)
-
715  {
-
716  JLOG(j_.info()) << "Unsupported amendment " << hash
-
717  << " reached majority at " << to_string(time);
-
718  if (!firstUnsupportedExpected_ || firstUnsupportedExpected_ > time)
-
719  firstUnsupportedExpected_ = time;
-
720  }
-
721  }
-
722  if (firstUnsupportedExpected_)
-
723  firstUnsupportedExpected_ = *firstUnsupportedExpected_ + majorityTime_;
-
724 }
-
725 
-
726 void
-
727 AmendmentTableImpl::injectJson(
-
728  Json::Value& v,
-
729  const uint256& id,
-
730  const AmendmentState& fs,
-
731  std::lock_guard<std::mutex> const&) const
-
732 {
-
733  if (!fs.name.empty())
-
734  v[jss::name] = fs.name;
-
735 
-
736  v[jss::supported] = fs.supported;
-
737  v[jss::vetoed] = fs.vote == AmendmentVote::down;
-
738  v[jss::enabled] = fs.enabled;
-
739 
-
740  if (!fs.enabled && lastVote_)
-
741  {
-
742  auto const votesTotal = lastVote_->trustedValidations();
-
743  auto const votesNeeded = lastVote_->threshold();
-
744  auto const votesFor = lastVote_->votes(id);
-
745 
-
746  v[jss::count] = votesFor;
-
747  v[jss::validations] = votesTotal;
-
748 
-
749  if (votesNeeded)
-
750  v[jss::threshold] = votesNeeded;
-
751  }
-
752 }
-
753 
-
754 Json::Value
-
755 AmendmentTableImpl::getJson() const
-
756 {
-
757  Json::Value ret(Json::objectValue);
-
758  {
-
759  std::lock_guard lock(mutex_);
-
760  for (auto const& e : amendmentMap_)
-
761  {
-
762  injectJson(
-
763  ret[to_string(e.first)] = Json::objectValue,
-
764  e.first,
-
765  e.second,
-
766  lock);
-
767  }
-
768  }
-
769  return ret;
-
770 }
+
703  return ((ledgerSeq - 1) / 256) != ((lastUpdateSeq_ - 1) / 256);
+
704 }
+
705 
+
706 void
+
707 AmendmentTableImpl::doValidatedLedger(
+
708  LedgerIndex ledgerSeq,
+
709  std::set<uint256> const& enabled,
+
710  majorityAmendments_t const& majority)
+
711 {
+
712  for (auto& e : enabled)
+
713  enable(e);
+
714 
+
715  std::lock_guard lock(mutex_);
+
716 
+
717  // Remember the ledger sequence of this update.
+
718  lastUpdateSeq_ = ledgerSeq;
+
719 
+
720  // Since we have the whole list in `majority`, reset the time flag, even
+
721  // if it's currently set. If it's not set when the loop is done, then any
+
722  // prior unknown amendments have lost majority.
+
723  firstUnsupportedExpected_.reset();
+
724  for (auto const& [hash, time] : majority)
+
725  {
+
726  AmendmentState& s = add(hash, lock);
+
727 
+
728  if (s.enabled)
+
729  continue;
+
730 
+
731  if (!s.supported)
+
732  {
+
733  JLOG(j_.info()) << "Unsupported amendment " << hash
+
734  << " reached majority at " << to_string(time);
+
735  if (!firstUnsupportedExpected_ || firstUnsupportedExpected_ > time)
+
736  firstUnsupportedExpected_ = time;
+
737  }
+
738  }
+
739  if (firstUnsupportedExpected_)
+
740  firstUnsupportedExpected_ = *firstUnsupportedExpected_ + majorityTime_;
+
741 }
+
742 
+
743 void
+
744 AmendmentTableImpl::injectJson(
+
745  Json::Value& v,
+
746  const uint256& id,
+
747  const AmendmentState& fs,
+
748  std::lock_guard<std::mutex> const&) const
+
749 {
+
750  if (!fs.name.empty())
+
751  v[jss::name] = fs.name;
+
752 
+
753  v[jss::supported] = fs.supported;
+
754  if (!fs.enabled)
+
755  {
+
756  if (fs.vote == AmendmentVote::obsolete)
+
757  v[jss::vetoed] = "Obsolete";
+
758  else
+
759  v[jss::vetoed] = fs.vote == AmendmentVote::down;
+
760  }
+
761  v[jss::enabled] = fs.enabled;
+
762 
+
763  if (!fs.enabled && lastVote_)
+
764  {
+
765  auto const votesTotal = lastVote_->trustedValidations();
+
766  auto const votesNeeded = lastVote_->threshold();
+
767  auto const votesFor = lastVote_->votes(id);
+
768 
+
769  v[jss::count] = votesFor;
+
770  v[jss::validations] = votesTotal;
771 
-
772 Json::Value
-
773 AmendmentTableImpl::getJson(uint256 const& amendmentID) const
-
774 {
-
775  Json::Value ret = Json::objectValue;
-
776  Json::Value& jAmendment = (ret[to_string(amendmentID)] = Json::objectValue);
-
777 
-
778  {
-
779  std::lock_guard lock(mutex_);
-
780  AmendmentState const* a = get(amendmentID, lock);
-
781  if (a)
-
782  injectJson(jAmendment, amendmentID, *a, lock);
-
783  }
-
784 
-
785  return ret;
-
786 }
-
787 
-
788 std::unique_ptr<AmendmentTable>
-
789 make_AmendmentTable(
-
790  Application& app,
-
791  std::chrono::seconds majorityTime,
-
792  std::vector<AmendmentTable::FeatureInfo> const& supported,
-
793  Section const& enabled,
-
794  Section const& vetoed,
-
795  beast::Journal journal)
-
796 {
-
797  return std::make_unique<AmendmentTableImpl>(
-
798  app, majorityTime, supported, enabled, vetoed, journal);
-
799 }
+
772  if (votesNeeded)
+
773  v[jss::threshold] = votesNeeded;
+
774  }
+
775 }
+
776 
+
777 Json::Value
+
778 AmendmentTableImpl::getJson() const
+
779 {
+
780  Json::Value ret(Json::objectValue);
+
781  {
+
782  std::lock_guard lock(mutex_);
+
783  for (auto const& e : amendmentMap_)
+
784  {
+
785  injectJson(
+
786  ret[to_string(e.first)] = Json::objectValue,
+
787  e.first,
+
788  e.second,
+
789  lock);
+
790  }
+
791  }
+
792  return ret;
+
793 }
+
794 
+
795 Json::Value
+
796 AmendmentTableImpl::getJson(uint256 const& amendmentID) const
+
797 {
+
798  Json::Value ret = Json::objectValue;
+
799  Json::Value& jAmendment = (ret[to_string(amendmentID)] = Json::objectValue);
800 
-
801 } // namespace ripple
+
801  {
+
802  std::lock_guard lock(mutex_);
+
803  AmendmentState const* a = get(amendmentID, lock);
+
804  if (a)
+
805  injectJson(jAmendment, amendmentID, *a, lock);
+
806  }
+
807 
+
808  return ret;
+
809 }
+
810 
+
811 std::unique_ptr<AmendmentTable>
+
812 make_AmendmentTable(
+
813  Application& app,
+
814  std::chrono::seconds majorityTime,
+
815  std::vector<AmendmentTable::FeatureInfo> const& supported,
+
816  Section const& enabled,
+
817  Section const& vetoed,
+
818  beast::Journal journal)
+
819 {
+
820  return std::make_unique<AmendmentTableImpl>(
+
821  app, majorityTime, supported, enabled, vetoed, journal);
+
822 }
+
823 
+
824 } // namespace ripple
constexpr std::uint32_t tfGotMajority
Definition: TxFlags.h:118
Holds a collection of configuration values.
Definition: BasicConfig.h:42
@@ -867,23 +890,25 @@ $(function() {
STL class.
Stream trace() const
Severity stream access functions.
Definition: Journal.h:309
int threshold_
+
@ obsolete
std::optional< NetClock::time_point > firstUnsupportedExpected_
STL class.
-
std::vector< uint256 > getDesired() const override
+
std::vector< uint256 > getDesired() const override
std::mutex mutex_
bool unsupportedEnabled_
-
std::vector< uint256 > doValidation(std::set< uint256 > const &enabledAmendments) const override
+
std::vector< uint256 > doValidation(std::set< uint256 > const &enabledAmendments) const override
bool createFeatureVotes(soci::session &session)
createFeatureVotes Creates the FeatureVote table if it does not exist.
Definition: Wallet.cpp:224
STL class.
T find(T... args)
T size(T... args)
+
@ DefaultNo
-
uint256 find(std::string const &name) const override
+
uint256 find(std::string const &name) const override
Stream warn() const
Definition: Journal.h:327
hash_map< uint256, int > votes_
STL class.
-
bool unVeto(uint256 const &amendment) override
+
bool unVeto(uint256 const &amendment) override
AmendmentVote vote
If an amendment is down-voted, a server will not vote to enable it.
The status of all amendments requested in a given window.
T as_const(T... args)
@@ -891,6 +916,7 @@ $(function() {
T sort(T... args)
static std::vector< std::pair< uint256, std::string > > parseSection(Section const &section)
+
@ Obsolete
T push_back(T... args)
bool passes(uint256 const &amendment) const
@ down
@@ -900,17 +926,16 @@ $(function() {
int threshold() const
LockedSociSession checkoutDb()
Definition: DatabaseCon.h:178
@ objectValue
object value (collection of name/value pairs).
Definition: json_value.h:43
-
std::optional< NetClock::time_point > firstUnsupportedExpected() const override
-
@ yes
+
std::optional< NetClock::time_point > firstUnsupportedExpected() const override
constexpr std::ratio< 204, 256 > preFixAmendmentMajorityCalcThreshold
The minimum amount of support an amendment should have.
const uint256 fixAmendmentMajorityCalc
AmendmentTableImpl(Application &app, std::chrono::seconds majorityTime, std::vector< FeatureInfo > const &supported, Section const &enabled, Section const &vetoed, beast::Journal journal)
AmendmentState()=default
-
std::map< uint256, std::uint32_t > doVoting(Rules const &rules, NetClock::time_point closeTime, std::set< uint256 > const &enabledAmendments, majorityAmendments_t const &majorityAmendments, std::vector< std::shared_ptr< STValidation >> const &validations) override
+
std::map< uint256, std::uint32_t > doVoting(Rules const &rules, NetClock::time_point closeTime, std::set< uint256 > const &enabledAmendments, majorityAmendments_t const &majorityAmendments, std::vector< std::shared_ptr< STValidation >> const &validations) override
void readAmendments(soci::session &session, std::function< void(boost::optional< std::string > amendment_hash, boost::optional< std::string > amendment_name, boost::optional< AmendmentVote > vote)> const &callback)
readAmendments Reads all amendments from the FeatureVotes table.
Definition: Wallet.cpp:248
Rules const & rules_
-
AmendmentState * get(uint256 const &amendment, std::lock_guard< std::mutex > const &lock)
-
bool isSupported(uint256 const &amendment) const override
+
AmendmentState * get(uint256 const &amendment, std::lock_guard< std::mutex > const &lock)
+
bool isSupported(uint256 const &amendment) const override
Stream error() const
Definition: Journal.h:333
Stream info() const
Definition: Journal.h:321
@@ -918,10 +943,10 @@ $(function() {
A generic endpoint for log messages.
Definition: Journal.h:58
STL class.
-
bool veto(uint256 const &amendment) override
+
bool veto(uint256 const &amendment) override
int trustedValidations_
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
-
void injectJson(Json::Value &v, uint256 const &amendment, AmendmentState const &state, std::lock_guard< std::mutex > const &lock) const
+
void injectJson(Json::Value &v, uint256 const &amendment, AmendmentState const &state, std::lock_guard< std::mutex > const &lock) const
hash_map< uint256, AmendmentState > amendmentMap_
std::unique_ptr< AmendmentSet > lastVote_
T insert(T... args)
@@ -929,7 +954,7 @@ $(function() {
void voteAmendment(soci::session &session, uint256 const &amendment, std::string const &name, AmendmentVote vote)
voteAmendment Set the veto value for a particular amendment.
Definition: Wallet.cpp:284
bool enabled
Indicates that the amendment has been enabled.
AmendmentSet(Rules const &rules, std::vector< std::shared_ptr< STValidation >> const &valSet)
-
Json::Value getJson() const override
+
Json::Value getJson() const override
Definition: DatabaseCon.h:81
std::string name
The name of this amendment, possibly empty.
T count(T... args)
@@ -940,28 +965,29 @@ $(function() {
Stream debug() const
Definition: Journal.h:315
std::string to_string(Manifest const &m)
Format the specified manifest to a string for debugging purposes.
-
std::unique_ptr< AmendmentTable > make_AmendmentTable(Application &app, std::chrono::seconds majorityTime, std::vector< AmendmentTable::FeatureInfo > const &supported, Section const &enabled, Section const &vetoed, beast::Journal journal)
+
std::unique_ptr< AmendmentTable > make_AmendmentTable(Application &app, std::chrono::seconds majorityTime, std::vector< AmendmentTable::FeatureInfo > const &supported, Section const &enabled, Section const &vetoed, beast::Journal journal)
T make_pair(T... args)
T end(T... args)
-
AmendmentState & add(uint256 const &amendment, std::lock_guard< std::mutex > const &lock)
+
AmendmentState & add(uint256 const &amendment, std::lock_guard< std::mutex > const &lock)
int trustedValidations() const
-
bool isEnabled(uint256 const &amendment) const override
+
bool isEnabled(uint256 const &amendment) const override
T max(T... args)
constexpr bool parseHex(std::string_view sv)
Parse a hex string into a base_uint.
Definition: base_uint.h:496
const beast::Journal j_
The amendment table stores the list of enabled and potential amendments.
-
bool needValidatedLedger(LedgerIndex seq) const override
Called to determine whether the amendment logic needs to process a new validated ledger.
+
bool needValidatedLedger(LedgerIndex seq) const override
Called to determine whether the amendment logic needs to process a new validated ledger.
int votes(uint256 const &amendment) const
STL class.
STL class.
-
void persistVote(uint256 const &amendment, std::string const &name, AmendmentVote vote) const
+
void persistVote(uint256 const &amendment, std::string const &name, AmendmentVote vote) const
STL class.
constexpr std::ratio< 80, 100 > postFixAmendmentMajorityCalcThreshold
-
void doValidatedLedger(LedgerIndex seq, std::set< uint256 > const &enabled, majorityAmendments_t const &majority) override
-
bool enable(uint256 const &amendment) override
+
void doValidatedLedger(LedgerIndex seq, std::set< uint256 > const &enabled, majorityAmendments_t const &majority) override
+
bool enable(uint256 const &amendment) override
Represents a JSON value.
Definition: json_value.h:145
const SF_VECTOR256 sfAmendments
-
bool hasUnsupportedEnabled() const override
returns true if one or more amendments on the network have been enabled that this server does not sup...
+
bool hasUnsupportedEnabled() const override
returns true if one or more amendments on the network have been enabled that this server does not sup...
+
@ DefaultYes