Skip to content

Commit

Permalink
Fixed SAL parse after fork
Browse files Browse the repository at this point in the history
  • Loading branch information
MoneroOcean committed Nov 5, 2024
1 parent ac5dcc2 commit 0f9c969
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/cryptonote_basic/cryptonote_basic.h
Original file line number Diff line number Diff line change
Expand Up @@ -1097,7 +1097,7 @@ namespace cryptonote
if (blob_type == BLOB_TYPE_CRYPTONOTE_XHV) {
FIELD(pricing_record)
} else if (blob_type == BLOB_TYPE_CRYPTONOTE_SALVIUM) {
if (major_version >= 2) FIELD(salvium_pricing_record)
if (major_version >= 255) FIELD(salvium_pricing_record)
} else if (blob_type == BLOB_TYPE_CRYPTONOTE_ZEPHYR) {
if (major_version >= 6)
{
Expand Down
6 changes: 3 additions & 3 deletions tests/sal.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
let u = require('../build/Release/cryptoforknote');

const b = Buffer.from(
'010194a5ebb406f613c4e7514facf3e5b9923c885357b53f2b02f8e17f9721371296b99113035f00000000020001ffcb6d018f9ffec12d03125e128c041c8a2d41fab9ebe2a7a4b10afbef4e134ec7ba3151c8c730a644310353414c3c7334015f99bdbbe70161dafb2da2fd9a4285da893a7519cff350981a959f525c43e5c60211000000000000000000000000000000000001e3c7bfb00b00020001ffcb6d0023016b6961b458286074406192961c1f0e5236455f45fcd6c175c7142d6353a481d60400020000'
'0202fdaca8b906b1670506d0dc45b11cbc87f9ceedfd0cbfa56c14da72ccc27c45105391d2340300000000020001ffbabe0501a1ca9fab2a035c20fce0617f61abf3872058e15b90650b2ac812bf344766f56ee54b680f571e0353414c3c863401618163d383093580900f735ea9ad5d3d0029dd94c2f2a35db88ec37dc32e863302110000bcdd9d15420000000000000000000001c8f2e7ca0a00020001ffbabe05002301bb1086494863ac8de0987e09f7193ac85a356f8abf8725202cbf4dea8b2611f20400020000'
, 'hex');
const b2 = u.convert_blob(b, 15);
const h1 = b2.toString('hex');

if (h1 === '010194a5ebb406f613c4e7514facf3e5b9923c885357b53f2b02f8e17f9721371296b99113035f00000000ac81ca3e7bc9369e63563923187d2cfdb42eac839c7fe24e6d5d0080c96d758f01') {
if (h1 === '0202fdaca8b906b1670506d0dc45b11cbc87f9ceedfd0cbfa56c14da72ccc27c45105391d2340300000000604ec6923c81b6477bb224a9c53158cea5c5aee36100aad59c498d3dab92750401') {
console.log('PASSED');
} else {
console.log('FAILED: ' + h1);
process.exit(1);
}
}

0 comments on commit 0f9c969

Please sign in to comment.