mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 11:45:36 +02:00
actually send signed transaction from PaymentManager
This commit is contained in:
parent
350c759618
commit
ce4336894a
3 changed files with 17 additions and 1 deletions
|
@ -13,6 +13,9 @@
|
|||
#include <QtCore/QDebug>
|
||||
#include <QtCore/QUuid>
|
||||
|
||||
#include <NodeList.h>
|
||||
#include <PacketHeaders.h>
|
||||
|
||||
#include "SignedWalletTransaction.h"
|
||||
|
||||
#include "PaymentManager.h"
|
||||
|
@ -23,7 +26,6 @@ PaymentManager& PaymentManager::getInstance() {
|
|||
}
|
||||
|
||||
void PaymentManager::sendSignedPayment(qint64 satoshiAmount, const QUuid& nodeUUID, const QUuid& destinationWalletUUID) {
|
||||
qDebug() << "Paying" << satoshiAmount << "satoshis to" << destinationWalletUUID << "via" << nodeUUID;
|
||||
|
||||
// setup a signed wallet transaction
|
||||
const qint64 DEFAULT_TRANSACTION_EXPIRY_SECONDS = 60;
|
||||
|
@ -32,4 +34,15 @@ void PaymentManager::sendSignedPayment(qint64 satoshiAmount, const QUuid& nodeUU
|
|||
currentTimestamp, DEFAULT_TRANSACTION_EXPIRY_SECONDS);
|
||||
|
||||
// send the signed transaction to the redeeming node
|
||||
QByteArray transactionByteArray = byteArrayWithPopulatedHeader(PacketTypeSignedTransactionPayment);
|
||||
|
||||
// append the binary message and the signed message digest
|
||||
transactionByteArray.append(newTransaction.binaryMessage());
|
||||
transactionByteArray.append(newTransaction.signedMessageDigest());
|
||||
|
||||
qDebug() << "Paying" << satoshiAmount << "satoshis to" << destinationWalletUUID << "via" << nodeUUID;
|
||||
|
||||
// use the NodeList to send that to the right node
|
||||
NodeList* nodeList = NodeList::getInstance();
|
||||
nodeList->writeDatagram(transactionByteArray, nodeList->nodeWithUUID(nodeUUID));
|
||||
}
|
|
@ -14,6 +14,8 @@
|
|||
|
||||
#include <WalletTransaction.h>
|
||||
|
||||
const int NUM_BYTES_SIGNED_TRANSACTION_MESSAGE = 72;
|
||||
|
||||
class SignedWalletTransaction : public WalletTransaction {
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
|
|
@ -70,6 +70,7 @@ enum PacketType {
|
|||
PacketTypeVoxelEditNack,
|
||||
PacketTypeParticleEditNack,
|
||||
PacketTypeModelEditNack,
|
||||
PacketTypeSignedTransactionPayment
|
||||
};
|
||||
|
||||
typedef char PacketVersion;
|
||||
|
|
Loading…
Reference in a new issue