diff --git a/shared/chain/memo.js b/shared/chain/memo.js index 72cb8abaaca5dac5c28aa814c9ccc96f4bef615c..f4831a01ad700473ef75d4710b09c37cfd46c4bd 100644 --- a/shared/chain/memo.js +++ b/shared/chain/memo.js @@ -33,18 +33,10 @@ export function decode(private_key, memo) { const mbuf = ByteBuffer.fromBinary(memo.toString('binary'), ByteBuffer.DEFAULT_CAPACITY, ByteBuffer.LITTLE_ENDIAN) try { mbuf.mark() - // I get better luck using readVString .. but (see cache) return mbuf.readVString() } catch(e) { - // Piston's encrypted memos fail the above varibale length utf-8 conversion. - // The origainal code works for Piston. - // https://github.com/steemit/steemit.com/issues/202 mbuf.reset() - const len = mbuf.readVarint32() // remove the varint length prefix - const remaining = mbuf.remaining() - if(len !== remaining) // warn - console.error(`Memo's length prefix ${len} does not match remaining bytes ${remaining}`) - + // Sender did not length-prefix the memo memo = new Buffer(mbuf.toString('binary'), 'binary').toString('utf-8') return memo }