mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Payment channels permit off-ledger checkpoints of XRP payments flowing in a single direction. A channel sequesters the owner's XRP in its own ledger entry. The owner can authorize the recipient to claim up to a give balance by giving the receiver a signed message (off-ledger). The recipient can use this signed message to claim any unpaid balance while the channel remains open. The owner can top off the line as needed. If the channel has not paid out all its funds, the owner must wait out a delay to close the channel to give the recipient a chance to supply any claims. The recipient can close the channel at any time. Any transaction that touches the channel after the expiration time will close the channel. The total amount paid increases monotonically as newer claims are issued. When the channel is closed any remaining balance is returned to the owner. Channels are intended to permit intermittent off-ledger settlement of ILP trust lines as balances get substantial. For bidirectional channels, a payment channel can be used in each direction.
105 lines
4.2 KiB
C++
105 lines
4.2 KiB
C++
//------------------------------------------------------------------------------
|
|
/*
|
|
This file is part of rippled: https://github.com/ripple/rippled
|
|
Copyright (c) 2012, 2013 Ripple Labs Inc.
|
|
|
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
purpose with or without fee is hereby granted, provided that the above
|
|
copyright notice and this permission notice appear in all copies.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
*/
|
|
//==============================================================================
|
|
|
|
#ifndef RIPPLE_PROTOCOL_TXFLAGS_H_INCLUDED
|
|
#define RIPPLE_PROTOCOL_TXFLAGS_H_INCLUDED
|
|
|
|
#include <cstdint>
|
|
|
|
namespace ripple {
|
|
|
|
//
|
|
// Transaction flags.
|
|
//
|
|
|
|
/** Transaction flags.
|
|
|
|
These flags modify the behavior of an operation.
|
|
|
|
@note Changing these will create a hard fork
|
|
@ingroup protocol
|
|
*/
|
|
class TxFlag
|
|
{
|
|
public:
|
|
static std::uint32_t const requireDestTag = 0x00010000;
|
|
};
|
|
// VFALCO TODO Move all flags into this container after some study.
|
|
|
|
// Universal Transaction flags:
|
|
const std::uint32_t tfFullyCanonicalSig = 0x80000000;
|
|
const std::uint32_t tfUniversal = tfFullyCanonicalSig;
|
|
const std::uint32_t tfUniversalMask = ~ tfUniversal;
|
|
|
|
// AccountSet flags:
|
|
// VFALCO TODO Javadoc comment every one of these constants
|
|
//const std::uint32_t TxFlag::requireDestTag = 0x00010000;
|
|
const std::uint32_t tfOptionalDestTag = 0x00020000;
|
|
const std::uint32_t tfRequireAuth = 0x00040000;
|
|
const std::uint32_t tfOptionalAuth = 0x00080000;
|
|
const std::uint32_t tfDisallowXRP = 0x00100000;
|
|
const std::uint32_t tfAllowXRP = 0x00200000;
|
|
const std::uint32_t tfAccountSetMask = ~ (tfUniversal | TxFlag::requireDestTag | tfOptionalDestTag
|
|
| tfRequireAuth | tfOptionalAuth
|
|
| tfDisallowXRP | tfAllowXRP);
|
|
|
|
// AccountSet SetFlag/ClearFlag values
|
|
const std::uint32_t asfRequireDest = 1;
|
|
const std::uint32_t asfRequireAuth = 2;
|
|
const std::uint32_t asfDisallowXRP = 3;
|
|
const std::uint32_t asfDisableMaster = 4;
|
|
const std::uint32_t asfAccountTxnID = 5;
|
|
const std::uint32_t asfNoFreeze = 6;
|
|
const std::uint32_t asfGlobalFreeze = 7;
|
|
const std::uint32_t asfDefaultRipple = 8;
|
|
|
|
// OfferCreate flags:
|
|
const std::uint32_t tfPassive = 0x00010000;
|
|
const std::uint32_t tfImmediateOrCancel = 0x00020000;
|
|
const std::uint32_t tfFillOrKill = 0x00040000;
|
|
const std::uint32_t tfSell = 0x00080000;
|
|
const std::uint32_t tfOfferCreateMask = ~ (tfUniversal | tfPassive | tfImmediateOrCancel | tfFillOrKill | tfSell);
|
|
|
|
// Payment flags:
|
|
const std::uint32_t tfNoRippleDirect = 0x00010000;
|
|
const std::uint32_t tfPartialPayment = 0x00020000;
|
|
const std::uint32_t tfLimitQuality = 0x00040000;
|
|
const std::uint32_t tfPaymentMask = ~ (tfUniversal | tfPartialPayment | tfLimitQuality | tfNoRippleDirect);
|
|
|
|
// TrustSet flags:
|
|
const std::uint32_t tfSetfAuth = 0x00010000;
|
|
const std::uint32_t tfSetNoRipple = 0x00020000;
|
|
const std::uint32_t tfClearNoRipple = 0x00040000;
|
|
const std::uint32_t tfSetFreeze = 0x00100000;
|
|
const std::uint32_t tfClearFreeze = 0x00200000;
|
|
const std::uint32_t tfTrustSetMask = ~ (tfUniversal | tfSetfAuth | tfSetNoRipple | tfClearNoRipple
|
|
| tfSetFreeze | tfClearFreeze);
|
|
|
|
// EnableAmendment flags:
|
|
const std::uint32_t tfGotMajority = 0x00010000;
|
|
const std::uint32_t tfLostMajority = 0x00020000;
|
|
|
|
// PaymentChannel flags:
|
|
const std::uint32_t tfRenew = 0x00010000;
|
|
const std::uint32_t tfClose = 0x00020000;
|
|
|
|
} // ripple
|
|
|
|
#endif
|