add buildermockv0 to show old / obsolete tx proposals
This commit is contained in:
parent
7f11793b96
commit
2008db932b
3 changed files with 36 additions and 3 deletions
|
|
@ -6,6 +6,7 @@ var bitcore = require('bitcore');
|
|||
var util = bitcore.util;
|
||||
var Transaction = bitcore.Transaction;
|
||||
var Builder = bitcore.TransactionBuilder;
|
||||
var BuilderMockV0 = require('./BuilderMockV0');;
|
||||
var Script = bitcore.Script;
|
||||
var buffertools = bitcore.buffertools;
|
||||
|
||||
|
|
@ -45,8 +46,11 @@ TxProposal.fromObj = function(o) {
|
|||
try {
|
||||
t.builder = new Builder.fromObj(o.builderObj);
|
||||
} catch (e) {
|
||||
if (!process.version)
|
||||
console.log('Ignoring incompatible stored TxProposal:' + JSON.stringify(o.builderObj));
|
||||
if (!o.version) {
|
||||
console.log('Importing old TxProposal V0' + JSON.stringify(o.builderObj));
|
||||
t.builder = new BuilderMockV0(o.builderObj);
|
||||
t.readonly = 1;
|
||||
};
|
||||
}
|
||||
return t;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue