TxSpendingProposal

open class TxSpendingProposal(val wallet: Wallet, val tx: iTransaction, val info: String, _mine: Boolean, val onAccept: SpendingProposal.() -> Unit) : SpendingProposal

Constructors

Link copied to clipboard
constructor(wallet: Wallet, tx: iTransaction, info: String, _mine: Boolean, onAccept: SpendingProposal.() -> Unit)

Properties

Link copied to clipboard

Is this spending proposal accepted? Accepted means that this wallet has "oked" it. But it might not be ready yet. call accept() to set 0 if not accepted, otherwise millinow at the time of acceptance

Link copied to clipboard

Automatically post the completed transaction to the blockchain when completed

Link copied to clipboard
Link copied to clipboard

Derived class sets to millinow when this spending proposal contains enough information to actually spend

Link copied to clipboard
Link copied to clipboard
open override val info: String
Link copied to clipboard
var job: Job?
Link copied to clipboard
var jobs: CoroutineScope?
Link copied to clipboard
val lock: iMutex
Link copied to clipboard
Link copied to clipboard
val onAccept: suspend SpendingProposal.() -> Unit
Link copied to clipboard

Wallet sets to millinow when this completed proposal's transaction is seen in tx pools.

Link copied to clipboard
open override val title: String?
Link copied to clipboard
Link copied to clipboard

Is this spending proposal valid? call invalidate() to assign to false

Link copied to clipboard

Functions

Link copied to clipboard
open suspend override fun accept()
Link copied to clipboard
Link copied to clipboard
open suspend override fun go()

You need to override this function to actually do what should be done after acceptance. Set completed to millinow once the proposal is complete. This does not need to happen right away. There may be other steps (such as other wallet's acceptances) needed before a proposal can be completed. On startup, this function will be called again for every accepted-but-not-completed proposal.

Link copied to clipboard
open override fun invalidate(reason: String)
Link copied to clipboard
Link copied to clipboard
fun jobForInputOrAdd(input: Int, addFn: () -> SpendAnInput): SpendAnInput
Link copied to clipboard
open suspend fun reject()