mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
UNLReport working
This commit is contained in:
@@ -117,7 +117,7 @@ NegativeUNLVote::addReportingTx(
|
||||
active.reserve(scoreTable.size());
|
||||
for (auto const& [n, score]: scoreTable)
|
||||
{
|
||||
if (score > 240)
|
||||
if (score > (FLAG_LEDGER_INTERVAL>>1))
|
||||
{
|
||||
active.emplace_back(sfActiveValidator);
|
||||
active.back().setFieldVL(sfPublicKey, nidToKeyMap.at(n));
|
||||
@@ -130,6 +130,7 @@ NegativeUNLVote::addReportingTx(
|
||||
obj.setFieldU32(sfLedgerSequence, seq);
|
||||
});
|
||||
|
||||
|
||||
uint256 txID = repUnlTx.getTransactionID();
|
||||
Serializer s;
|
||||
repUnlTx.add(s);
|
||||
@@ -143,7 +144,9 @@ NegativeUNLVote::addReportingTx(
|
||||
else
|
||||
{
|
||||
JLOG(j_.debug()) << "R-UNL: ledger seq=" << seq
|
||||
<< ", add a ttUNL_REPORT Tx with txID: " << txID;
|
||||
<< ", add a ttUNL_REPORT Tx with txID: " << txID
|
||||
<< ", size=" << s.size()
|
||||
<< ", " << repUnlTx.getJson(JsonOptions::none);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -175,12 +175,14 @@ Change::applyUNLReport()
|
||||
{
|
||||
auto sle = view().peek(keylet::UNLReport());
|
||||
|
||||
bool const created = !!sle;
|
||||
bool const created = !sle;
|
||||
|
||||
if (created)
|
||||
sle = std::make_shared<SLE>(keylet::UNLReport());
|
||||
|
||||
sle->setFieldArray(sfActiveValidators, ctx_.tx.getFieldArray(sfActiveValidators));
|
||||
auto const av = ctx_.tx.getFieldArray(sfActiveValidators);
|
||||
|
||||
sle->setFieldArray(sfActiveValidators, av);
|
||||
|
||||
if (created)
|
||||
view().insert(sle);
|
||||
|
||||
@@ -446,6 +446,7 @@ LedgerEntryTypesMatch::visitEntry(
|
||||
case ltNFTOKEN_OFFER:
|
||||
case ltURI_TOKEN:
|
||||
case ltIMPORT_VLSEQ:
|
||||
case ltUNL_REPORT:
|
||||
break;
|
||||
default:
|
||||
invalidTypeAdded_ = true;
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace ripple {
|
||||
@ingroup protocol
|
||||
*/
|
||||
/** Smallest legal byte size of a transaction. */
|
||||
std::size_t constexpr txMinSizeBytes = 32;
|
||||
std::size_t constexpr txMinSizeBytes = 10;
|
||||
|
||||
/** Largest legal byte size of a transaction. */
|
||||
std::size_t constexpr txMaxSizeBytes = megabytes(1);
|
||||
|
||||
@@ -301,7 +301,9 @@ LedgerFormats::LedgerFormats()
|
||||
add(jss::UNLReport,
|
||||
ltUNL_REPORT,
|
||||
{
|
||||
{sfActiveValidators, soeREQUIRED},
|
||||
{sfActiveValidators, soeREQUIRED},
|
||||
{sfPreviousTxnID, soeREQUIRED},
|
||||
{sfPreviousTxnLgrSeq, soeREQUIRED},
|
||||
},
|
||||
commonFields);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user