bugfix
This commit is contained in:
parent
274112005f
commit
335d0dcd96
2 changed files with 6 additions and 1 deletions
|
@ -14,7 +14,11 @@ var p2sh_types = {
|
||||||
};
|
};
|
||||||
|
|
||||||
var Address = function (bytes, version) {
|
var Address = function (bytes, version) {
|
||||||
if (typeof bytes === 'string') {
|
if (arguments[0] instanceof Address) {
|
||||||
|
this.hash = arguments[0].hash;
|
||||||
|
this.version = arguments[0].version;
|
||||||
|
}
|
||||||
|
else if (typeof bytes === 'string') {
|
||||||
this.hash =
|
this.hash =
|
||||||
bytes.length <= 34 ? base58.checkDecode(bytes)
|
bytes.length <= 34 ? base58.checkDecode(bytes)
|
||||||
: bytes.length <= 40 ? conv.hexToBytes(bytes)
|
: bytes.length <= 40 ? conv.hexToBytes(bytes)
|
||||||
|
|
|
@ -296,6 +296,7 @@ Script.prototype.writeBytes = function (data)
|
||||||
Script.createOutputScript = function (address)
|
Script.createOutputScript = function (address)
|
||||||
{
|
{
|
||||||
var script = new Script();
|
var script = new Script();
|
||||||
|
address = new Address(address);
|
||||||
// Standard pay-to-pubkey-hash
|
// Standard pay-to-pubkey-hash
|
||||||
if (!address.version) {
|
if (!address.version) {
|
||||||
script.writeOp(Opcode.map.OP_DUP);
|
script.writeOp(Opcode.map.OP_DUP);
|
||||||
|
|
Loading…
Reference in a new issue