MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / readPaymentRequestFromFile

Method readPaymentRequestFromFile

src/qt/paymentserver.cpp:491–507  ·  view source on GitHub ↗

Warning: readPaymentRequestFromFile() is used in ipcSendCommandLine() so don't use "Q_EMIT message()", but "QMessageBox::"!

Source from the content-addressed store, hash-verified

489// so don't use "Q_EMIT message()", but "QMessageBox::"!
490//
491bool PaymentServer::readPaymentRequestFromFile(const QString& filename, PaymentRequestPlus& request)
492{
493 QFile f(filename);
494 if (!f.open(QIODevice::ReadOnly)) {
495 qWarning() << QString("PaymentServer::%1: Failed to open %2").arg(__func__).arg(filename);
496 return false;
497 }
498
499 // BIP70 DoS protection
500 if (!verifySize(f.size())) {
501 return false;
502 }
503
504 QByteArray data = f.readAll();
505
506 return request.parse(data);
507}
508
509bool PaymentServer::processPaymentRequest(const PaymentRequestPlus& request, SendCoinsRecipient& recipient)
510{

Callers

nothing calls this directly

Calls 2

sizeMethod · 0.45
parseMethod · 0.45

Tested by

no test coverage detected