Skip to content
This repository has been archived by the owner on Apr 6, 2020. It is now read-only.

Commit

Permalink
Do not set default zero adress, only include signature with from set …
Browse files Browse the repository at this point in the history
…in fake transaction (undo PR #94)
  • Loading branch information
holgerd77 committed Jun 29, 2018
1 parent 2aa7e54 commit 2dfdae9
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions fake.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ module.exports = class FakeTransaction extends Transaction {
}
})

// set from address or default to null address
this.from = (data && data.from) ? data.from : '0x0000000000000000000000000000000000000000'
this.from = data.from
}

/**
Expand All @@ -59,7 +58,7 @@ module.exports = class FakeTransaction extends Transaction {
* @return {Buffer}
*/
hash (includeSignature = true) {
if (includeSignature) {
if (includeSignature && this._from && this._from.toString('hex') !== '') {
// include a fake signature using the from address as a private key
let fakeKey = Buffer.concat([this._from, this._from.slice(0, 12)])
this.sign(fakeKey)
Expand Down

0 comments on commit 2dfdae9

Please sign in to comment.