Add public field 'memo' to JSOutput to enable creation of notes with custom memos.
This commit is contained in:
parent
8d08172d0d
commit
4eb1a96f9a
|
@ -214,11 +214,8 @@ public:
|
||||||
ZCNoteEncryption encryptor(h_sig);
|
ZCNoteEncryption encryptor(h_sig);
|
||||||
|
|
||||||
for (size_t i = 0; i < NumOutputs; i++) {
|
for (size_t i = 0; i < NumOutputs; i++) {
|
||||||
// TODO: expose memo in the public interface
|
|
||||||
// 0xF6 is invalid UTF8 as per spec
|
|
||||||
boost::array<unsigned char, ZC_MEMO_SIZE> memo = {{0xF6}};
|
|
||||||
|
|
||||||
NotePlaintext pt(out_notes[i], memo);
|
NotePlaintext pt(out_notes[i], outputs[i].memo);
|
||||||
|
|
||||||
out_ciphertexts[i] = pt.encrypt(encryptor, outputs[i].addr.pk_enc);
|
out_ciphertexts[i] = pt.encrypt(encryptor, outputs[i].addr.pk_enc);
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,6 +35,7 @@ class JSOutput {
|
||||||
public:
|
public:
|
||||||
PaymentAddress addr;
|
PaymentAddress addr;
|
||||||
uint64_t value;
|
uint64_t value;
|
||||||
|
boost::array<unsigned char, ZC_MEMO_SIZE> memo = {{0xF6}}; // 0xF6 is invalid UTF8 as per spec, rest of array is 0x00
|
||||||
|
|
||||||
JSOutput();
|
JSOutput();
|
||||||
JSOutput(PaymentAddress addr, uint64_t value) : addr(addr), value(value) { }
|
JSOutput(PaymentAddress addr, uint64_t value) : addr(addr), value(value) { }
|
||||||
|
|
Loading…
Reference in New Issue