mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-05-12 10:58:04 +00:00

* RPC: include orphans into mempool entries * no need for + 1 * give request option to choose mempool pool(s) * add to wallet, fix bg * use orphanpool rpc to test for orphans * fix fmt * fix crash when quering orphan pool in get_mempool_entries * pass the tests, fix fromAppMessage bug * Update config_test.go don't think this is needed * needed for tests to pass * inverse to transactionpoolfilter, cut down code to two ifs. * fmt * update test to true false, forgot one includetransactionpool renaming * update and simplyfiy get_mempool_entry handler * comment outdated * i think we usually use make instead of var. * Fix some leftovers of includeTransactionPool Co-authored-by: Ori Newman <orinewman1@gmail.com>
57 lines
1.7 KiB
Go
57 lines
1.7 KiB
Go
package appmessage
|
|
|
|
// GetMempoolEntryRequestMessage is an appmessage corresponding to
|
|
// its respective RPC message
|
|
type GetMempoolEntryRequestMessage struct {
|
|
baseMessage
|
|
TxID string
|
|
IncludeOrphanPool bool
|
|
FilterTransactionPool bool
|
|
}
|
|
|
|
// Command returns the protocol command string for the message
|
|
func (msg *GetMempoolEntryRequestMessage) Command() MessageCommand {
|
|
return CmdGetMempoolEntryRequestMessage
|
|
}
|
|
|
|
// NewGetMempoolEntryRequestMessage returns a instance of the message
|
|
func NewGetMempoolEntryRequestMessage(txID string, includeOrphanPool bool, filterTransactionPool bool) *GetMempoolEntryRequestMessage {
|
|
return &GetMempoolEntryRequestMessage{
|
|
TxID: txID,
|
|
IncludeOrphanPool: includeOrphanPool,
|
|
FilterTransactionPool: filterTransactionPool,
|
|
}
|
|
}
|
|
|
|
// GetMempoolEntryResponseMessage is an appmessage corresponding to
|
|
// its respective RPC message
|
|
type GetMempoolEntryResponseMessage struct {
|
|
baseMessage
|
|
Entry *MempoolEntry
|
|
|
|
Error *RPCError
|
|
}
|
|
|
|
// MempoolEntry represents a transaction in the mempool.
|
|
type MempoolEntry struct {
|
|
Fee uint64
|
|
Transaction *RPCTransaction
|
|
IsOrphan bool
|
|
}
|
|
|
|
// Command returns the protocol command string for the message
|
|
func (msg *GetMempoolEntryResponseMessage) Command() MessageCommand {
|
|
return CmdGetMempoolEntryResponseMessage
|
|
}
|
|
|
|
// NewGetMempoolEntryResponseMessage returns a instance of the message
|
|
func NewGetMempoolEntryResponseMessage(fee uint64, transaction *RPCTransaction, isOrphan bool) *GetMempoolEntryResponseMessage {
|
|
return &GetMempoolEntryResponseMessage{
|
|
Entry: &MempoolEntry{
|
|
Fee: fee,
|
|
Transaction: transaction,
|
|
IsOrphan: isOrphan,
|
|
},
|
|
}
|
|
}
|