mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
update claim serialization format
This commit is contained in:
@@ -674,7 +674,7 @@ PayChanClaim::preflight(PreflightContext const& ctx)
|
||||
if (isXRP(authAmt))
|
||||
serializePayChanAuthorization(msg, k.key, authAmt.xrp());
|
||||
else
|
||||
serializePayChanAuthorization(msg, k.key, authAmt.iou());
|
||||
serializePayChanAuthorization(msg, k.key, authAmt.iou(), authAmt.getCurrency(), authAmt.getIssuer());
|
||||
|
||||
if (!verify(pk, msg.slice(), *sig, /*canonical*/ true))
|
||||
return temBAD_SIGNATURE;
|
||||
|
||||
@@ -42,7 +42,9 @@ inline void
|
||||
serializePayChanAuthorization(
|
||||
Serializer& msg,
|
||||
uint256 const& key,
|
||||
IOUAmount const& amt)
|
||||
IOUAmount const& amt,
|
||||
Currency const& cur,
|
||||
AccountID const& iss)
|
||||
{
|
||||
msg.add32(HashPrefix::paymentChannelClaim);
|
||||
msg.addBitString(key);
|
||||
@@ -57,6 +59,8 @@ serializePayChanAuthorization(
|
||||
amt.mantissa() |
|
||||
(static_cast<std::uint64_t>(amt.exponent() + 512 + 256 + 97)
|
||||
<< (64 - 10)));
|
||||
msg.addBitString(cur);
|
||||
msg.addBitString(iss);
|
||||
}
|
||||
|
||||
} // namespace ripple
|
||||
|
||||
Reference in New Issue
Block a user