Improve handling of sfLedgerSequence field:

The sfLedgerSequence field is designated as optional in the object
template but it is effectively required and validations which do not
include it were, correctly, rejected.

This commit migrates the check outside of the peer code and into the
constructor used for validations being deserialized for the network.

Furthermore, the code will generate an error if a validation that is
generated by a server does not include the field.
This commit is contained in:
Nik Bougalis
2020-05-05 23:40:29 -07:00
committed by manojsdoshi
parent 3936110c8d
commit ca664b17d3
5 changed files with 94 additions and 9 deletions

View File

@@ -2170,7 +2170,8 @@ PeerImp::onMessage(std::shared_ptr<protocol::TMValidation> const& m)
}
catch (std::exception const& e)
{
JLOG(p_journal_.warn()) << "Validation: Exception, " << e.what();
JLOG(p_journal_.warn())
<< "Exception processing validation: " << e.what();
fee_ = Resource::feeInvalidRequest;
}
}