Changeset View
Changeset View
Standalone View
Standalone View
src/qt/paymentserver.cpp
Show First 20 Lines • Show All 760 Lines • ▼ Show 20 Lines | if (walletModel->wallet().getKeyFromPool(false /* internal */, newKey)) { | ||||
refund_to->set_script(&s[0], s.size()); | refund_to->set_script(&s[0], s.size()); | ||||
} else { | } else { | ||||
// This should never happen, because sending coins should have | // This should never happen, because sending coins should have | ||||
// just unlocked the wallet and refilled the keypool. | // just unlocked the wallet and refilled the keypool. | ||||
qWarning() << "PaymentServer::fetchPaymentACK: Error getting refund " | qWarning() << "PaymentServer::fetchPaymentACK: Error getting refund " | ||||
"key, refund_to not set"; | "key, refund_to not set"; | ||||
} | } | ||||
int length = payment.ByteSize(); | QVariant length; | ||||
#ifdef USE_PROTOBUF_MESSAGE_BYTESIZELONG | |||||
length.setValue(payment.ByteSizeLong()); | |||||
#else | |||||
length.setValue(payment.ByteSize()); | |||||
#endif | |||||
netRequest.setHeader(QNetworkRequest::ContentLengthHeader, length); | netRequest.setHeader(QNetworkRequest::ContentLengthHeader, length); | ||||
QByteArray serData(length, '\0'); | QByteArray serData(length.toInt(), '\0'); | ||||
if (payment.SerializeToArray(serData.data(), length)) { | if (payment.SerializeToArray(serData.data(), length.toInt())) { | ||||
netManager->post(netRequest, serData); | netManager->post(netRequest, serData); | ||||
} else { | } else { | ||||
// This should never happen, either. | // This should never happen, either. | ||||
qWarning() << "PaymentServer::fetchPaymentACK: Error serializing " | qWarning() << "PaymentServer::fetchPaymentACK: Error serializing " | ||||
"payment message"; | "payment message"; | ||||
} | } | ||||
} | } | ||||
▲ Show 20 Lines • Show All 135 Lines • Show Last 20 Lines |