fix counter, add verbose

This commit is contained in:
D-Stacks 2022-07-02 16:58:32 +02:00
parent e1f66e9bc3
commit 3631852f74
2 changed files with 21 additions and 0 deletions

View File

@ -36,6 +36,11 @@ func HandleGetMempoolEntriesByAddresses(context *rpccontext.Context, _ *router.R
if transaction, found := sendingInMempool[address]; found { if transaction, found := sendingInMempool[address]; found {
rpcTransaction := appmessage.DomainTransactionToRPCTransaction(transaction) rpcTransaction := appmessage.DomainTransactionToRPCTransaction(transaction)
err := context.PopulateTransactionWithVerboseData(rpcTransaction, nil)
if err != nil {
return nil, err
}
sending = append(sending, &appmessage.MempoolEntry{ sending = append(sending, &appmessage.MempoolEntry{
Fee: transaction.Fee, Fee: transaction.Fee,
Transaction: rpcTransaction, Transaction: rpcTransaction,
@ -44,6 +49,11 @@ func HandleGetMempoolEntriesByAddresses(context *rpccontext.Context, _ *router.R
if transaction, found := receivingInMempool[address]; found { if transaction, found := receivingInMempool[address]; found {
rpcTransaction := appmessage.DomainTransactionToRPCTransaction(transaction) rpcTransaction := appmessage.DomainTransactionToRPCTransaction(transaction)
err := context.PopulateTransactionWithVerboseData(rpcTransaction, nil)
if err != nil {
return nil, err
}
receiving = append(receiving, &appmessage.MempoolEntry{ receiving = append(receiving, &appmessage.MempoolEntry{
Fee: transaction.Fee, Fee: transaction.Fee,
Transaction: rpcTransaction, Transaction: rpcTransaction,
@ -59,6 +69,11 @@ func HandleGetMempoolEntriesByAddresses(context *rpccontext.Context, _ *router.R
if transaction, found := sendingInOrphanPool[address]; found { if transaction, found := sendingInOrphanPool[address]; found {
rpcTransaction := appmessage.DomainTransactionToRPCTransaction(transaction) rpcTransaction := appmessage.DomainTransactionToRPCTransaction(transaction)
err := context.PopulateTransactionWithVerboseData(rpcTransaction, nil)
if err != nil {
return nil, err
}
sending = append(sending, &appmessage.MempoolEntry{ sending = append(sending, &appmessage.MempoolEntry{
Fee: transaction.Fee, Fee: transaction.Fee,
Transaction: rpcTransaction, Transaction: rpcTransaction,
@ -67,6 +82,11 @@ func HandleGetMempoolEntriesByAddresses(context *rpccontext.Context, _ *router.R
if transaction, found := receivingInOrphanPool[address]; found { if transaction, found := receivingInOrphanPool[address]; found {
rpcTransaction := appmessage.DomainTransactionToRPCTransaction(transaction) rpcTransaction := appmessage.DomainTransactionToRPCTransaction(transaction)
err := context.PopulateTransactionWithVerboseData(rpcTransaction, nil)
if err != nil {
return nil, err
}
receiving = append(receiving, &appmessage.MempoolEntry{ receiving = append(receiving, &appmessage.MempoolEntry{
Fee: transaction.Fee, Fee: transaction.Fee,
Transaction: rpcTransaction, Transaction: rpcTransaction,

View File

@ -396,6 +396,7 @@ func (op *orphansPool) getAllOrphanTransactions(clone bool) []*externalapi.Domai
} else { } else {
allOrphanTransactions[i] = mempoolTransaction.Transaction() allOrphanTransactions[i] = mempoolTransaction.Transaction()
} }
i++
} }
return allOrphanTransactions return allOrphanTransactions
} }