xrpld
Loading...
Searching...
No Matches
PaymentChannelHelpers.h
1#pragma once
2
3#include <xrpl/beast/utility/Journal.h>
4#include <xrpl/ledger/ApplyView.h>
5#include <xrpl/protocol/TER.h>
6#include <xrpl/protocol/UintTypes.h>
7
8#include <cstdint>
9#include <memory>
10#include <optional>
11
12namespace xrpl {
13
23TER
24closeChannel(SLE::ref slep, ApplyView& view, uint256 const& key, beast::Journal j);
25
34uint32_t
35saturatingAdd(Rules const& rules, uint32_t const lhs, uint32_t const rhs);
36
46bool
48
49} // namespace xrpl
Writeable view to a ledger, for applying a transaction.
Definition ApplyView.h:118
Rules controlling protocol behavior.
Definition Rules.h:33
std::shared_ptr< STLedgerEntry > const & ref
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
bool isChannelExpired(ApplyView const &view, std::optional< std::uint32_t > timeField)
Determine whether a payment channel time field represents an expired time.
TER closeChannel(SLE::ref slep, ApplyView &view, uint256 const &key, beast::Journal j)
Close a payment channel and return its remaining funds to the channel owner.
uint32_t saturatingAdd(Rules const &rules, uint32_t const lhs, uint32_t const rhs)
Add two uint32_t values with saturation at UINT32_MAX.
TERSubset< CanCvtToTER > TER
Definition TER.h:634
BaseUInt< 256 > uint256
Definition base_uint.h:562