Correctly calculate Escrow and PayChan identifiers:

This change fixes a technical flaw that resulted from using
32-bit space identifiers instead of the protocol-defined
16-bit values.

Details: https://ripple.com/build/ledger-format/#tree-format
This commit is contained in:
seelabs
2017-03-29 15:22:15 -04:00
parent 0df1b09a73
commit 09f9720ebb

View File

@@ -317,7 +317,7 @@ escrow (AccountID const& source, std::uint32_t seq)
{
sha512_half_hasher h;
using beast::hash_append;
hash_append(h, spaceEscrow);
hash_append(h, std::uint16_t(spaceEscrow));
hash_append(h, source);
hash_append(h, seq);
return { ltESCROW, static_cast<uint256>(h) };
@@ -328,7 +328,7 @@ payChan (AccountID const& source, AccountID const& dst, std::uint32_t seq)
{
sha512_half_hasher h;
using beast::hash_append;
hash_append(h, spaceXRPUChannel);
hash_append(h, std::uint16_t(spaceXRPUChannel));
hash_append(h, source);
hash_append(h, dst);
hash_append(h, seq);