mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-27 15:45:48 +00:00
[FEATURE] Transaction: Allow canonical signing to be disabled via config.
This commit is contained in:
@@ -46,6 +46,7 @@ var log = require('./log').internal.sub('remote');
|
|||||||
max_fee : Maximum acceptable transaction fee
|
max_fee : Maximum acceptable transaction fee
|
||||||
fee_cushion : Extra fee multiplier to account for async fee changes.
|
fee_cushion : Extra fee multiplier to account for async fee changes.
|
||||||
servers : Array of server objects with the following form
|
servers : Array of server objects with the following form
|
||||||
|
canonical_signing : Signatures should be canonicalized and the "canonical" flag set
|
||||||
|
|
||||||
{
|
{
|
||||||
host: <string>
|
host: <string>
|
||||||
@@ -82,6 +83,7 @@ function Remote(opts, trace) {
|
|||||||
this.local_sequence = Boolean(opts.local_sequence); // Locally track sequence numbers
|
this.local_sequence = Boolean(opts.local_sequence); // Locally track sequence numbers
|
||||||
this.local_fee = (typeof opts.local_fee === 'undefined') ? true : opts.local_fee; // Locally set fees
|
this.local_fee = (typeof opts.local_fee === 'undefined') ? true : opts.local_fee; // Locally set fees
|
||||||
this.local_signing = (typeof opts.local_signing === 'undefined') ? true : opts.local_signing;
|
this.local_signing = (typeof opts.local_signing === 'undefined') ? true : opts.local_signing;
|
||||||
|
this.canonical_signing = (typeof opts.canonical_signing === 'undefined') ? true : opts.canonical_signing;
|
||||||
this.fee_cushion = (typeof opts.fee_cushion === 'undefined') ? 1.2 : opts.fee_cushion;
|
this.fee_cushion = (typeof opts.fee_cushion === 'undefined') ? 1.2 : opts.fee_cushion;
|
||||||
this.max_fee = (typeof opts.max_fee === 'undefined') ? Infinity : opts.max_fee;
|
this.max_fee = (typeof opts.max_fee === 'undefined') ? Infinity : opts.max_fee;
|
||||||
this.id = 0;
|
this.id = 0;
|
||||||
|
|||||||
@@ -74,7 +74,8 @@ function Transaction(remote) {
|
|||||||
// Index at which transaction was submitted
|
// Index at which transaction was submitted
|
||||||
this.submitIndex = void(0);
|
this.submitIndex = void(0);
|
||||||
|
|
||||||
this.canonical = true;
|
// Canonical signing setting defaults to the Remote's configuration
|
||||||
|
this.canonical = "object" === typeof remote ? !!remote.canonical_signing : true;
|
||||||
|
|
||||||
// We aren't clever enough to eschew preventative measures so we keep an array
|
// We aren't clever enough to eschew preventative measures so we keep an array
|
||||||
// of all submitted transactionIDs (which can change due to load_factor
|
// of all submitted transactionIDs (which can change due to load_factor
|
||||||
|
|||||||
Reference in New Issue
Block a user