- You are buying 1 BTC with PayPal USD to establish a rating on bitcoin-otc. You will pay the latest price + 5% + any PayPal fees
- You are ident'ed with gribble on #bitcoin-otc
- I will provide you with a Bitcoin transaction id as proof
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE OR REPLACE FUNCTION hold_trigger() | |
RETURNS trigger AS | |
$BODY$ | |
BEGIN | |
IF TG_OP = 'INSERT' THEN | |
UPDATE account SET hold = hold + NEW.amount WHERE account_id = NEW.account_id; | |
ELSIF TG_OP = 'UPDATE' AND OLD.amount <> NEW.amount THEN | |
UPDATE account SET hold = hold + (NEW.amount - OLD.amount) WHERE account_id = NEW.account_id; | |
ELSIF TG_OP = 'DELETE' THEN | |
RAISE NOTICE 'releasing hold of % on account % from delete hold % trigger, bringing it from % to %', OLD.amount, OLD.hold_id, OLD.account_id, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE voucher ( | |
voucher_id varchar(30) PRIMARY KEY, | |
created timestamp DEFAULT current_timestamp, | |
redeemed timestamp, | |
hold_id int REFERENCES hold(hold_id) ON DELETE SET NULL, | |
CONSTRAINT no_hold_when_redeemed CHECK (hold_id IS NULL OR redeemed IS NULL), | |
CONSTRAINT not_redeemed_before_created CHECK (redeemed >= created), | |
CONSTRAINT voucher_id_length CHECK (length(voucher_id) = 30) | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- todo: must not be able to create hold on these | |
CREATE TABLE dividend_issue ( | |
issue_id serial PRIMARY KEY, | |
created timestamp DEFAULT current_timestamp, | |
amount bigint CHECK (amount > 0) | |
); | |
CREATE TABLE dividend_issue_transaction ( | |
issue_id NOT NULL REFERENCES issued_dividends(issue_id), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var config = require('../config') | |
, bitcoin = new (require('bitcoin').Client)(config('BTC')) | |
, async = require('async') | |
, db = require('./db') | |
, num = require('num') | |
, minHeight = 209848 | |
var oldHeight, height, hash, block | |
function nextBlock() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var config = require('../config') | |
, bitcoin = new (require('bitcoin').Client)(config('BTC')) | |
, async = require('async') | |
, db = require('./db') | |
, num = require('num') | |
, lastHeight | |
, clientHeight | |
, blockHash | |
, minConf = 3 | |
, txConcurrency = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var config = require('../config') | |
, bitcoin = new (require('bitcoin').Client)(config('BTC')) | |
, async = require('async') | |
, util = require('util') | |
, db = require('./db') | |
, num = require('num') | |
, lastHeight | |
, clientHeight | |
, blockHash | |
, minConf = 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var config = require('../config') | |
, bitcoin = new (require('bitcoin').Client)(config('BTC')) | |
, debug = require('debug')('snow:btc-edge:sender') | |
, db = require('./db') | |
, num = require('num') | |
, util = require('util') | |
, Q = require('q') | |
, client |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var config = require('../config') | |
, bitcoin = new (require('bitcoin').Client)(config('BTC')) | |
, debug = require('debug')('snow:btc-edge:sender') | |
, db = require('./db') | |
, num = require('num') | |
, util = require('util') | |
, Q = require('q') | |
, client |